Skip to content

Commit

Permalink
Fix bug in mruby-test gem.
Browse files Browse the repository at this point in the history
In an used build path mruby-test wasn't updating mrbtest.c in the
case that the mgem selection was changed. This lead to:
  - a missing reference in case a GEM was removed
  - ignoring all new GEMs added to the build configuration

This fix keeps track of the active gems and demands a rebuild of
mrbtest.c in case that the gem selection changed.
  • Loading branch information
bovi committed Feb 11, 2016
1 parent 1887042 commit 5976185
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mrbgems/mruby-test/mrbgem.rake
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,19 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
end

init = "#{spec.dir}/init_mrbtest.c"

# 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
end
file clib => active_gems

file mlib => clib
file clib => init do |t|
_pp "GEN", "*.rb", "#{clib.relative_path}"
Expand Down

0 comments on commit 5976185

Please sign in to comment.