diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-14 18:48:05 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-14 18:52:57 +0900 |
| commit | 600e3330b3c4f170bd15e37554af533c2a3176ab (patch) | |
| tree | 4d514706417f3565fcc083f92331142a1ccc44a0 | |
| parent | 4dcd8dd7cec202d09e5b21f7c55f527916c44aea (diff) | |
| download | mruby-600e3330b3c4f170bd15e37554af533c2a3176ab.tar.gz mruby-600e3330b3c4f170bd15e37554af533c2a3176ab.zip | |
Scan source files only from `cdump` enabled gems.
| -rw-r--r-- | Rakefile | 22 | ||||
| -rw-r--r-- | lib/mruby/gem.rb | 4 | ||||
| -rw-r--r-- | mrblib/enum.rb | 2 |
3 files changed, 15 insertions, 13 deletions
@@ -60,6 +60,9 @@ else depfiles = [] end +cfiles = Dir.glob("#{MRUBY_ROOT}/src/*.c") +rbfiles = Dir.glob("#{MRUBY_ROOT}/mrblib/**/*.rb") +psfiles = [] MRuby.each_target do |target| gems.map do |gem| current_dir = gem.dir.relative_path_from(Dir.pwd) @@ -94,21 +97,16 @@ MRuby.each_target do |target| depfiles += [ exec ] end end + + if gem.cdump? + cfiles += Dir.glob(relative_from_root+"/{src,core}/*.c") + rbfiles += Dir.glob(relative_from_root+"/mrblib/**/*.rb") + psfiles += Dir.glob(relative_from_root+"/**/presym") + end end end mkdir_p "#{MRUBY_ROOT}/build" -cfiles = ( - Dir.glob("#{MRUBY_ROOT}/src/*.c")+ - Dir.glob("#{MRUBY_ROOT}/mrbgems/**/*.c")+ - Dir.glob("#{MRUBY_ROOT}/build/repos/**/{src,core}/*.c") -).uniq -rbfiles = ( - Dir.glob("#{MRUBY_ROOT}/mrblib/**/*.rb")+ - Dir.glob("#{MRUBY_ROOT}/mrbgems/*/mrblib/**/*.rb").grep_v(/mruby-test/)+ - Dir.glob("#{MRUBY_ROOT}/build/repos/**/mrblib/**/*.rb") -).uniq -psfiles = Dir.glob("#{MRUBY_ROOT}/{mrblib,mrbgems,build/repos}/**/presym") symbols = [] psfiles.each do |file| symbols += File.readlines(file).grep_v(/^# /) @@ -197,7 +195,7 @@ file presym_file => cfiles+rbfiles+psfiles+[__FILE__] do src.scan(/[ \(\[\{]:'([^']+)'/) ] end - symbols = (symbols+csymbols+rbsymbols+op_table.keys).flatten.compact.uniq.sort.map{|x| x.gsub("\n", '\n')} + symbols = (symbols+csymbols+rbsymbols+op_table.keys).flatten.compact.uniq.sort.grep_v(/#/).map{|x| x.gsub("\n", '\n')} presyms = File.readlines(presym_file) rescue [] presyms.each{|x| x.chomp!} if presyms != symbols diff --git a/lib/mruby/gem.rb b/lib/mruby/gem.rb index 349423bb7..f506e5442 100644 --- a/lib/mruby/gem.rb +++ b/lib/mruby/gem.rb @@ -123,6 +123,10 @@ module MRuby @cdump = true end + def cdump? + @cdump + end + def add_dependency(name, *requirements) default_gem = requirements.last.kind_of?(Hash) ? requirements.pop : nil requirements = ['>= 0.0.0'] if requirements.empty? diff --git a/mrblib/enum.rb b/mrblib/enum.rb index 15687e159..23b275ae2 100644 --- a/mrblib/enum.rb +++ b/mrblib/enum.rb @@ -10,7 +10,7 @@ # implement a meaningful `<=>` operator, as these methods # rely on an ordering between members of the collection. # -# @ISO 15.3.2 +# ISO 15.3.2 module Enumerable NONE = Object.new |
