mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge branch 'master' of github.com:mruby/mruby
This commit is contained in:
@@ -9,10 +9,8 @@ load "#{MRUBY_ROOT}/tasks/mruby_build.rake"
|
||||
load "#{MRUBY_ROOT}/tasks/mrbgem_spec.rake"
|
||||
|
||||
# load configuration file
|
||||
MRUBY_CONFIGS = ["#{MRUBY_ROOT}/build_config.rb", ENV['MRUBY_CONFIG']].compact
|
||||
MRUBY_CONFIGS.each do |config|
|
||||
load config unless config.empty?
|
||||
end
|
||||
MRUBY_CONFIG = (ENV['MRUBY_CONFIG'] && ENV['MRUBY_CONFIG'] != '') ? ENV['MRUBY_CONFIG'] : "#{MRUBY_ROOT}/build_config.rb"
|
||||
load MRUBY_CONFIG
|
||||
|
||||
# load basic rules
|
||||
MRuby.each_target do |build|
|
||||
|
||||
+6
-6
@@ -12,22 +12,22 @@ MRuby::Build.new do |conf|
|
||||
# conf.gem :git => 'git@github.com:masuidrive/mrbgems-example.git', :branch => 'master', :options => '-v'
|
||||
|
||||
# Use standard Math module
|
||||
conf.gem 'mrbgems/mruby-math'
|
||||
conf.gem "#{root}/mrbgems/mruby-math"
|
||||
|
||||
# Use standard Time class
|
||||
conf.gem 'mrbgems/mruby-time'
|
||||
conf.gem "#{root}/mrbgems/mruby-time"
|
||||
|
||||
# Use standard Struct class
|
||||
conf.gem 'mrbgems/mruby-struct'
|
||||
conf.gem "#{root}/mrbgems/mruby-struct"
|
||||
|
||||
# Use standard Kernel#sprintf method
|
||||
conf.gem 'mrbgems/mruby-sprintf'
|
||||
conf.gem "#{root}/mrbgems/mruby-sprintf"
|
||||
|
||||
# Use extensional String class
|
||||
conf.gem 'mrbgems/mruby-string-ext'
|
||||
conf.gem "#{root}/mrbgems/mruby-string-ext"
|
||||
|
||||
# Use extensional Numeric class
|
||||
conf.gem 'mrbgems/mruby-numeric-ext'
|
||||
conf.gem "#{root}/mrbgems/mruby-numeric-ext"
|
||||
|
||||
# Generate binaries
|
||||
# conf.bins = %w(mrbc mruby mirb)
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ MRuby.each_target do
|
||||
# loader all gems
|
||||
self.libmruby << objfile("#{build_dir}/mrbgems/gem_init")
|
||||
file objfile("#{build_dir}/mrbgems/gem_init") => "#{build_dir}/mrbgems/gem_init.c"
|
||||
file "#{build_dir}/mrbgems/gem_init.c" => MRUBY_CONFIGS.flatten do |t|
|
||||
file "#{build_dir}/mrbgems/gem_init.c" => [MRUBY_CONFIG] do |t|
|
||||
FileUtils.mkdir_p "#{build_dir}/mrbgems"
|
||||
open(t.name, 'w') do |f|
|
||||
f.puts %Q[/*]
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
module MRuby
|
||||
module LoadGems
|
||||
def gem(gemdir, &block)
|
||||
gemdir = load_external_gem(gemdir) if gemdir.is_a?(Hash)
|
||||
caller_dir = File.expand_path(File.dirname(/^(.*?):\d/.match(caller.first).to_a[1]))
|
||||
if gemdir.is_a?(Hash)
|
||||
gemdir = load_external_gem(gemdir)
|
||||
else
|
||||
gemdir = File.expand_path(gemdir, caller_dir)
|
||||
end
|
||||
gemrake = File.join(gemdir, "mrbgem.rake")
|
||||
|
||||
fail "Can't find #{gemrake}" unless File.exists?(gemrake)
|
||||
|
||||
Reference in New Issue
Block a user