mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Scan source files only from cdump enabled gems.
This commit is contained in:
@@ -60,6 +60,9 @@ else
|
|||||||
depfiles = []
|
depfiles = []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cfiles = Dir.glob("#{MRUBY_ROOT}/src/*.c")
|
||||||
|
rbfiles = Dir.glob("#{MRUBY_ROOT}/mrblib/**/*.rb")
|
||||||
|
psfiles = []
|
||||||
MRuby.each_target do |target|
|
MRuby.each_target do |target|
|
||||||
gems.map do |gem|
|
gems.map do |gem|
|
||||||
current_dir = gem.dir.relative_path_from(Dir.pwd)
|
current_dir = gem.dir.relative_path_from(Dir.pwd)
|
||||||
@@ -94,21 +97,16 @@ MRuby.each_target do |target|
|
|||||||
depfiles += [ exec ]
|
depfiles += [ exec ]
|
||||||
end
|
end
|
||||||
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
|
||||||
end
|
end
|
||||||
|
|
||||||
mkdir_p "#{MRUBY_ROOT}/build"
|
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 = []
|
symbols = []
|
||||||
psfiles.each do |file|
|
psfiles.each do |file|
|
||||||
symbols += File.readlines(file).grep_v(/^# /)
|
symbols += File.readlines(file).grep_v(/^# /)
|
||||||
@@ -197,7 +195,7 @@ file presym_file => cfiles+rbfiles+psfiles+[__FILE__] do
|
|||||||
src.scan(/[ \(\[\{]:'([^']+)'/)
|
src.scan(/[ \(\[\{]:'([^']+)'/)
|
||||||
]
|
]
|
||||||
end
|
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 = File.readlines(presym_file) rescue []
|
||||||
presyms.each{|x| x.chomp!}
|
presyms.each{|x| x.chomp!}
|
||||||
if presyms != symbols
|
if presyms != symbols
|
||||||
|
|||||||
@@ -123,6 +123,10 @@ module MRuby
|
|||||||
@cdump = true
|
@cdump = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cdump?
|
||||||
|
@cdump
|
||||||
|
end
|
||||||
|
|
||||||
def add_dependency(name, *requirements)
|
def add_dependency(name, *requirements)
|
||||||
default_gem = requirements.last.kind_of?(Hash) ? requirements.pop : nil
|
default_gem = requirements.last.kind_of?(Hash) ? requirements.pop : nil
|
||||||
requirements = ['>= 0.0.0'] if requirements.empty?
|
requirements = ['>= 0.0.0'] if requirements.empty?
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
# implement a meaningful `<=>` operator, as these methods
|
# implement a meaningful `<=>` operator, as these methods
|
||||||
# rely on an ordering between members of the collection.
|
# rely on an ordering between members of the collection.
|
||||||
#
|
#
|
||||||
# @ISO 15.3.2
|
# ISO 15.3.2
|
||||||
module Enumerable
|
module Enumerable
|
||||||
|
|
||||||
NONE = Object.new
|
NONE = Object.new
|
||||||
|
|||||||
Reference in New Issue
Block a user