diff options
| author | KOBAYASHI Shuji <[email protected]> | 2021-01-08 20:32:08 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2021-01-08 20:36:54 +0900 |
| commit | 3a8d7bdf82dddb8d5e54330503d9ed11b4f68ad0 (patch) | |
| tree | e5c1e9c5f62a9bd4e495593c59b0d035a1d193ff /tasks/bin.rake | |
| parent | 04561cd999431264e10bb96915a26049cff29d92 (diff) | |
| download | mruby-3a8d7bdf82dddb8d5e54330503d9ed11b4f68ad0.tar.gz mruby-3a8d7bdf82dddb8d5e54330503d9ed11b4f68ad0.zip | |
Delay test code build until `rake test`
With this change, the test code will not be built unless `rake test` is
run, so there will be almost no side effects even if `enable_test` is
always set (but, gems specified by `add_test_dependency` are included
in `libmruby.a`).
Also added are `test: build` task, which only builds the test code
(including the main code), and `test: run` task, which only runs tests
independent of build. Therefore, the idiom for building in parallel and
not running tests in parallel is `rake -m test:build && rake test:run`.
Diffstat (limited to 'tasks/bin.rake')
| -rw-r--r-- | tasks/bin.rake | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/tasks/bin.rake b/tasks/bin.rake index afef065a1..bc8820b66 100644 --- a/tasks/bin.rake +++ b/tasks/bin.rake @@ -1,35 +1,23 @@ -install_task = ->(src) do - dst = "#{MRuby::Build.install_dir}/#{File.basename(src)}" - file dst => src do - install_D src, dst - end - dst -end - MRuby.each_target do |build| if build.host? && build.mrbc_build && !build.gems["mruby-bin-mrbc"] exe = build.exefile("#{build.mrbc_build.build_dir}/bin/mrbc") - build.products << install_task.(exe) + build.products << build.define_installer(exe) end - build.bins.each do |bin| - exe = build.exefile("#{build.build_dir}/bin/#{bin}") - build.products << (build.host? ? install_task.(exe) : exe) - end + build.bins.each{|bin| build.products << define_installer_if_needed(bin)} - linker_attrs = build.gems.map{|gem| gem.linker.run_attrs}.transpose + linker_attrs = build.gems.linker_attrs build.gems.each do |gem| gem.bins.each do |bin| exe = build.exefile("#{build.build_dir}/bin/#{bin}") objs = Dir["#{gem.dir}/tools/#{bin}/*.{c,cpp,cxx,cc}"].map do |f| build.objfile(f.pathmap("#{gem.build_dir}/tools/#{bin}/%n")) end - file exe => objs.concat(build.libraries) do |t| build.linker.run t.name, t.prerequisites, *linker_attrs end - build.products << (build.host? ? install_task.(exe) : exe) + build.products << define_installer_if_needed(bin) end end end |
