diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-12-28 16:55:25 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-12-28 17:03:37 +0900 |
| commit | bb98fd78c3d14c550187a96b9ed6975e8b719a68 (patch) | |
| tree | 33b63ae388810dd3fd1f1f4e96990b37c7229586 /lib | |
| parent | d2f34a845514d45e9651a87d445e2d1bdabe680a (diff) | |
| download | mruby-bb98fd78c3d14c550187a96b9ed6975e8b719a68.tar.gz mruby-bb98fd78c3d14c550187a96b9ed6975e8b719a68.zip | |
Use `Rake.verbose` instead of `$verbose` and `$pp_show` in build scripts
The incompatibility that the commands of `FileUtils` origin output verbose
by default due to the changes in d8a5163b and 26e6e75b is also fixed.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mruby-core-ext.rb | 21 | ||||
| -rw-r--r-- | lib/mruby/build.rb | 4 | ||||
| -rw-r--r-- | lib/mruby/build/command.rb | 2 |
3 files changed, 4 insertions, 23 deletions
diff --git a/lib/mruby-core-ext.rb b/lib/mruby-core-ext.rb index 7b78bfa91..433f1bb1a 100644 --- a/lib/mruby-core-ext.rb +++ b/lib/mruby-core-ext.rb @@ -20,27 +20,8 @@ class String end end -$pp_show = true - -if $verbose.nil? - if Rake.respond_to?(:verbose) && !Rake.verbose.nil? - if Rake.verbose.class == TrueClass - # verbose message logging - $pp_show = false - else - $pp_show = true - Rake.verbose(false) - end - else - # could not identify rake version - $pp_show = false - end -else - $pp_show = false if $verbose -end - def _pp(cmd, src, tgt=nil, options={}) - return unless $pp_show + return if Rake.verbose width = 5 template = options[:indent] ? "%#{width*options[:indent]}s %s %s" : "%-#{width}s %s %s" diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb index 749b7fe3f..1e0ef67d7 100644 --- a/lib/mruby/build.rb +++ b/lib/mruby/build.rb @@ -320,7 +320,7 @@ EOS end def verbose_flag - $verbose ? ' -v' : '' + Rake.verbose ? ' -v' : '' end def run_test @@ -386,7 +386,7 @@ EOS end def run_test - @test_runner.runner_options << ' -v' if $verbose + @test_runner.runner_options << verbose_flag mrbtest = exefile("#{build_dir}/bin/mrbtest") if (@test_runner.command == nil) puts "You should run #{mrbtest} on target device." diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb index 098eb77b0..03d814800 100644 --- a/lib/mruby/build/command.rb +++ b/lib/mruby/build/command.rb @@ -342,7 +342,7 @@ module MRuby _pp "MRBC", f.relative_path, nil, :indent => 2 end cmd = "#{filename @command} #{@compile_options % {:funcname => funcname}} #{filename(infiles).join(' ')}" - print("#{cmd}\n") if $verbose + puts cmd if Rake.verbose IO.popen(cmd, 'r+') do |io| out.puts io.read end |
