diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-22 22:38:33 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-11-22 22:38:33 +0900 |
| commit | 2d9bf22730d69b0450b47421bc23146e23dc1ebf (patch) | |
| tree | ff306ac37e6ed3e5d810db33ea3c59249803ccd3 /lib | |
| parent | 17532874a89157e7d48f4ef23da6f780dfb2cbe7 (diff) | |
| parent | 2a97e97db49533a37b341bb58545cc2ed1630b59 (diff) | |
| download | mruby-2d9bf22730d69b0450b47421bc23146e23dc1ebf.tar.gz mruby-2d9bf22730d69b0450b47421bc23146e23dc1ebf.zip | |
Merge pull request #5173 from shuujii/refine-build-log-for-generated-files
Refine build log for generated files
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mruby/build/command.rb | 4 | ||||
| -rw-r--r-- | lib/mruby/core_ext.rb | 4 | ||||
| -rw-r--r-- | lib/mruby/gem.rb | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb index 854346a7e..e6becd3f6 100644 --- a/lib/mruby/build/command.rb +++ b/lib/mruby/build/command.rb @@ -308,8 +308,8 @@ module MRuby def run(out, infiles, funcname, cdump = true) @command ||= @build.mrbcfile infiles = [infiles].flatten - infiles.each do |f| - _pp "MRBC", f.relative_path, nil, :indent => 2 + infiles.each_with_index do |f, i| + _pp i == 0 ? "MRBC" : "", f.relative_path, indent: 2 end cmd = %Q["#{filename @command}" #{cdump ? "-S" : ""} #{@compile_options % {:funcname => funcname}} #{filename(infiles).map{|f| %Q["#{f}"]}.join(' ')}] puts cmd if Rake.verbose diff --git a/lib/mruby/core_ext.rb b/lib/mruby/core_ext.rb index 47a47d8c8..3b2406c36 100644 --- a/lib/mruby/core_ext.rb +++ b/lib/mruby/core_ext.rb @@ -26,10 +26,10 @@ def install_D(src, dst) cp src, dst end -def _pp(cmd, src, tgt=nil, options={}) +def _pp(cmd, src, tgt=nil, indent: nil) return if Rake.verbose width = 5 - template = options[:indent] ? "%#{width*options[:indent]}s %s %s" : "%-#{width}s %s %s" + template = indent ? "%#{width * indent}s %s %s" : "%-#{width}s %s %s" puts template % [cmd, src, tgt ? "-> #{tgt}" : nil] end diff --git a/lib/mruby/gem.rb b/lib/mruby/gem.rb index f506e5442..e01dffe84 100644 --- a/lib/mruby/gem.rb +++ b/lib/mruby/gem.rb @@ -184,6 +184,7 @@ module MRuby end def generate_gem_init(fname) + _pp "GEN", fname.relative_path open(fname, 'w') do |f| print_gem_init_header f unless rbfiles.empty? |
