-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
36 lines (30 loc) · 848 Bytes
/
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
MRUBY_CONFIG=File.expand_path(ENV["MRUBY_CONFIG"] || ".travis_build_config.rb")
MRUBY_VERSION=ENV["MRUBY_VERSION"] || "2.0.0"
file :mruby do
sh "git clone --depth=1 https://github.com/mruby/mruby.git"
if MRUBY_VERSION != 'master'
Dir.chdir 'mruby' do
sh "git fetch --tags"
rev = %x{git rev-parse #{MRUBY_VERSION}}
sh "git checkout #{rev}"
end
end
end
desc "compile binary"
task :compile => :mruby do
sh "cd mruby && rake all MRUBY_CONFIG=#{MRUBY_CONFIG}"
end
desc "test"
task :test => :mruby do
sh "cd mruby && rake all test MRUBY_CONFIG=#{MRUBY_CONFIG}"
end
desc "mirb"
task :mirb => :mruby do
sh "cd mruby && rake all MRUBY_CONFIG=#{MRUBY_CONFIG} && ./bin/mirb"
end
desc "cleanup"
task :clean do
exit 0 unless File.directory?('mruby')
sh "cd mruby && rake deep_clean"
end
task :default => :compile