-
Notifications
You must be signed in to change notification settings - Fork 8
/
Rakefile
executable file
·84 lines (66 loc) · 1.81 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
# Rake file for managing Ruby gems
#
# rake # build test with cmake
# rake gem # creates a gem
require 'rubygems'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
PROJECT_NAME = "biolib"
BIOLIB_VERSION = `cat VERSION`
desc "Building BioLib for this system"
task :default => [:build, :test, :install]
task :build do
# Dir.chdir('../..') do
install_path = File.expand_path(File.dirname(__FILE__))
sh "cmake -DBUILD_RUBY:BOOLEAN=TRUE -DCMAKE_INSTALL_PREFIX=/usr ."
sh "make"
# end
end
task :test do
sh "make test"
end
task :install do
# this may need to be adapted for a gem!
sh "make install"
end
desc "Clean up everything"
task :clean => [:clobber] do
end
spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::CURRENT
s.required_ruby_version = ">=1.8.0"
s.name = PROJECT_NAME
s.version = BIOLIB_VERSION
s.summary = 'BioLib'
s.homepage = 'http://biolib.open-bio.org/'
s.author = 'Pjotr Prins'
s.email = "[email protected]"
s.description = <<-END
BioLib
END
s.extensions << 'Rakefile'
s.has_rdoc = false
# s.extra_rdoc_files = [ "README.rdoc" ]
# s.rdoc_options = [ "--main", "README.rdoc" ]
# s.test_suite_file = "test/tests.rb"
patterns = [
'Rakefile',
'**/CMakeLists.txt',
'LICENSE', 'README', 'VERSION', 'INSTALL', 'TODO', 'install.sh',
'cmake_modules/*',
'doc/*.txt',
'src/clibs/biolib*/**/*.{h,c,txt}',
'src/clibs/example-*/*.{h,c,txt}',
'src/clibs/affyio-*/src/*.{h,c,txt}',
'src/clibs/staden_io_lib-*/io_lib/*.{h,c,txt}',
'src/mappings/swig/*.i',
'src/mappings/swig/ruby/**/*.{rb,i}',
'src/mappings/swig/perl/**/*.{pl,i}',
'src/test/**/*'
]
s.files = patterns.map {|p| Dir.glob(p) }.flatten
s.require_paths = ['.']
end
Rake::GemPackageTask.new(spec) do |pkg|
end