Last change
on this file since 446 was 439, checked in by coas-nagasima, 4 years ago |
mrubyを2.1.1に更新
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-ruby;charset=UTF-8
|
File size:
989 bytes
|
Rev | Line | |
---|
[439] | 1 | unless MRuby::Build.current.kind_of?(MRuby::CrossBuild)
|
---|
| 2 | MRuby::Gem::Specification.new('mruby-bin-config') do |spec|
|
---|
| 3 | name = 'mruby-config'
|
---|
| 4 | spec.license = 'MIT'
|
---|
| 5 | spec.author = 'mruby developers'
|
---|
| 6 | spec.summary = "#{name} command"
|
---|
| 7 |
|
---|
| 8 | mruby_config_dir = "#{build.build_dir}/bin"
|
---|
| 9 | mruby_config = name + (ENV['OS'] == 'Windows_NT' ? '.bat' : '')
|
---|
| 10 | mruby_config_path = "#{mruby_config_dir}/#{mruby_config}"
|
---|
| 11 | make_cfg = "#{build.build_dir}/lib/libmruby.flags.mak"
|
---|
| 12 | tmplt_path = "#{__dir__}/#{mruby_config}"
|
---|
| 13 | build.bins << mruby_config
|
---|
| 14 |
|
---|
| 15 | directory mruby_config_dir
|
---|
| 16 |
|
---|
| 17 | file mruby_config_path => [mruby_config_dir, make_cfg, tmplt_path] do |t|
|
---|
| 18 | config = Hash[File.readlines(make_cfg).map!(&:chomp).map! {|l|
|
---|
| 19 | l.gsub('\\"', '"').split(' = ', 2).map! {|s| s.sub(/^(?=.)/, 'echo ')}
|
---|
| 20 | }]
|
---|
| 21 | tmplt = File.read(tmplt_path)
|
---|
| 22 | File.write(t.name, tmplt.gsub(/(#{Regexp.union(*config.keys)})\b/, config))
|
---|
| 23 | chmod(0755, t.name)
|
---|
| 24 | end
|
---|
| 25 | end
|
---|
| 26 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.