Skip to content

Commit f83ff48

Browse files
committed
Merge pull request #8 from zzak/cleanup-rake
Use mruby_root instead of the constant
2 parents 0c21e6c + 0aeab4b commit f83ff48

2 files changed

Lines changed: 14 additions & 16 deletions

File tree

Rakefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ load "#{mruby_root}/Rakefile"
1515

1616
desc "compile all the binaries"
1717
task :compile => [:mruby, :all] do
18-
%W(#{MRUBY_ROOT}/build/host/bin/#{APP_NAME} #{MRUBY_ROOT}/build/i686-pc-linux-gnu/#{APP_NAME}").each do |bin|
18+
%W(#{mruby_root}/build/host/bin/#{APP_NAME} #{mruby_root}/build/i686-pc-linux-gnu/#{APP_NAME}").each do |bin|
1919
sh "strip --strip-unneeded #{bin}" if File.exist?(bin)
2020
end
2121
end
@@ -25,8 +25,8 @@ namespace :test do
2525
# only build mtest for host
2626
task :mtest => [:compile] + MRuby.targets.values.map {|t| t.build_mrbtest_lib_only? ? nil : t.exefile("#{t.build_dir}/test/mrbtest") }.compact do
2727
# in order to get mruby/test/t/synatx.rb __FILE__ to pass,
28-
# we need to make sure the tests are built relative from MRUBY_ROOT
29-
load "#{MRUBY_ROOT}/test/mrbtest.rake"
28+
# we need to make sure the tests are built relative from mruby_root
29+
load "#{mruby_root}/test/mrbtest.rake"
3030
MRuby.each_target do |target|
3131
# only run unit tests here
3232
target.enable_bintest = false
@@ -62,7 +62,7 @@ task :test => ['test:bintest', 'test:mtest']
6262

6363
desc "cleanup"
6464
task :clean do
65-
sh "cd #{MRUBY_ROOT} && rake deep_clean"
65+
sh "rake deep_clean"
6666
end
6767

6868
desc "generate a release tarball"

mrblib/setup.rb

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def rakefile
308308
309309
desc "compile binary"
310310
task :compile => [:mruby, :all] do
311-
%W(\#{MRUBY_ROOT}/build/host/bin/\#{APP_NAME} \#{MRUBY_ROOT}/build/i686-pc-linux-gnu/\#{APP_NAME}").each do |bin|
311+
%W(\#{mruby_root}/build/host/bin/\#{APP_NAME} \#{mruby_root}/build/i686-pc-linux-gnu/\#{APP_NAME}").each do |bin|
312312
sh "strip --strip-unneeded \#{bin}" if File.exist?(bin)
313313
end
314314
end
@@ -317,16 +317,14 @@ def rakefile
317317
desc "run mruby & unit tests"
318318
# only build mtest for host
319319
task :mtest => [:compile] + MRuby.targets.values.map {|t| t.build_mrbtest_lib_only? ? nil : t.exefile("\#{t.build_dir}/test/mrbtest") }.compact do
320-
# mruby-io tests expect to be in MRUBY_ROOT
321-
Dir.chdir(MRUBY_ROOT) do
322-
# in order to get mruby/test/t/synatx.rb __FILE__ to pass,
323-
# we need to make sure the tests are built relative from MRUBY_ROOT
324-
load "\#{MRUBY_ROOT}/test/mrbtest.rake"
325-
MRuby.each_target do |target|
326-
# only run unit tests here
327-
target.enable_bintest = false
328-
run_test unless build_mrbtest_lib_only?
329-
end
320+
# mruby-io tests expect to be in mruby_root
321+
# in order to get mruby/test/t/synatx.rb __FILE__ to pass,
322+
# we need to make sure the tests are built relative from mruby_root
323+
load "\#{mruby_root}/test/mrbtest.rake"
324+
MRuby.each_target do |target|
325+
# only run unit tests here
326+
target.enable_bintest = false
327+
run_test unless build_mrbtest_lib_only?
330328
end
331329
end
332330
@@ -358,7 +356,7 @@ def clean_env(envs)
358356
359357
desc "cleanup"
360358
task :clean do
361-
sh "cd \#{MRUBY_ROOT} && rake deep_clean"
359+
sh "rake deep_clean"
362360
end
363361
RAKEFILE
364362
end

0 commit comments

Comments
 (0)