forked from mamarjan/gff3-pltools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
126 lines (104 loc) · 3.47 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# encoding: utf-8
# To be able to load the D library in our tests,
# we need to add it's path to this env var:
require 'rake/clean'
ENV["LD_LIBRARY_PATH"] = File.dirname(__FILE__)
rule ".o" => [".d"] do |t|
sh "dmd -c -m32 -g #{t.source} -of#{t.name} -fPIC"
end
directory "builddir"
CLEAN.include("builddir")
task :compiledebug => ["builddir"] do
sh "dmd -c -m32 -g dlib/lib_init.d -ofbuilddir/lib_init.o -fPIC"
sh "dmd -c -m32 -g dlib/bio/gff3.d -ofbuilddir/gff3.o -fPIC"
sh "dmd -g -m32 builddir/*.o -ofbio-hpc-dlib.so -shared -fPIC"
sh "mv bio-hpc-dlib.so lib/"
end
task :compile => ["builddir"] do
sh "dmd -c -m32 -g dlib/lib_init.d -ofbuilddir/lib_init.o -fPIC"
sh "dmd -c -m32 -g dlib/bio/gff3.d -ofbuilddir/gff3.o -fPIC"
sh "dmd -g -m32 builddir/*.o -ofbio-hpc-dlib.so -shared -fPIC"
sh "mv bio-hpc-dlib.so lib/"
end
CLEAN.include("lib/*.so")
DFILES = ["dlib/bio/gff3/file.d",
"dlib/bio/gff3/data.d",
"dlib/bio/gff3/record.d",
"dlib/bio/gff3/record_range.d",
"dlib/bio/gff3/validation.d",
"dlib/bio/fasta.d",
"dlib/bio/gff3/feature.d",
"dlib/bio/gff3/feature_range.d",
"dlib/bio/gff3/filtering.d",
"dlib/util/esc_char_conv.d",
"dlib/util/join_lines.d",
"dlib/util/read_file.d",
"dlib/util/split_into_lines.d",
"dlib/util/range_with_cache.d",
"dlib/util/split_file.d",
"dlib/util/split_line.d",
"dlib/util/dlist.d",
"dlib/util/string_hash.d",
"dlib/bio/exceptions.d"].join(" ")
desc "Compile and run D unit tests"
task :unittests do
sh "dmd -g -m32 -unittest dlib/unittests.d #{DFILES} -Idlib -ofunittests"
sh "./unittests"
end
CLEAN.include("unittests")
CLEAN.include("unittests.o")
desc "Compile the validate-gff3 utility"
task :validator do
sh "dmd -O -release -m32 dlib/bin/validate_gff3.d #{DFILES} -Idlib -ofvalidate-gff3"
end
CLEAN.include("validate-gff3")
CLEAN.include("validate-gff3.o")
desc "Compile the benchmark-gff3 utility"
task :benchmark do
sh "dmd -O -release -m32 dlib/bin/benchmark_gff3.d #{DFILES} -Idlib -ofbenchmark-gff3"
end
CLEAN.include("benchmark-gff3")
CLEAN.include("benchmark-gff3.o")
desc "Compile utilities"
task :utilities do
sh "dmd -O -release -m32 dlib/bin/count_features.d #{DFILES} -Idlib -ofcount-features"
end
CLEAN.include("count-features")
CLEAN.include("count-features.o")
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
gem.name = "bio-hpc-gff3"
gem.homepage = "http://github.com/mamarjan/bioruby-hpc-gff3"
gem.license = "MIT"
gem.summary = %Q{Fast parallized GFF3 parser}
gem.description = %Q{}
gem.email = "marian.povolny@gmail.com"
gem.authors = ["Marjan Povolni"]
# dependencies defined in Gemfile
end
Jeweler::RubygemsDotOrgTasks.new
require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end
RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
task :default => :spec
require 'yard'
YARD::Rake::YardocTask.new