diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-06-14 10:13:35 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-06-14 10:13:35 +0900 |
| commit | 896de5532b6283e81e4e492edfcf5e91c1d232b1 (patch) | |
| tree | a8494a78e0771a43d2e56bc2436838446e7f1558 | |
| parent | 23a4e7149dc4253caf5ed0a528ffe5c21c4afb80 (diff) | |
| parent | f715f2ddeacdf6301e8882b771252080b90d2b18 (diff) | |
| download | mruby-896de5532b6283e81e4e492edfcf5e91c1d232b1.tar.gz mruby-896de5532b6283e81e4e492edfcf5e91c1d232b1.zip | |
Merge pull request #4043 from take-cheeze/fix_test_dep
Fix unnecessary rebuild of tests.
| -rw-r--r-- | mrbgems/mruby-test/mrbgem.rake | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/mrbgems/mruby-test/mrbgem.rake b/mrbgems/mruby-test/mrbgem.rake index 7da0b5e50..27c635a5d 100644 --- a/mrbgems/mruby-test/mrbgem.rake +++ b/mrbgems/mruby-test/mrbgem.rake @@ -155,14 +155,18 @@ MRuby::Gem::Specification.new('mruby-test') do |spec| # store the last gem selection and make the re-build # of the test gem depending on a change to the gem # selection - active_gems = "#{build_dir}/active_gems.lst" - FileUtils.mkdir_p File.dirname(active_gems) - open(active_gems, 'w+') do |f| - build.gems.each do |g| - f.puts g.name - end + active_gems_path = "#{build_dir}/active_gems_path.lst" + active_gem_list = if File.exist? active_gems_path + File.read active_gems_path + else + FileUtils.mkdir_p File.dirname(active_gems_path) + nil + end + current_gem_list = build.gems.map(&:name).join("\n") + if active_gem_list != current_gem_list + File.write active_gems_path, current_gem_list end - file clib => active_gems + file clib => active_gems_path file mlib => clib file clib => init do |t| |
