diff --git a/.gitmodules b/.gitmodules index 1eb35b9..9452bde 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "modules/emscripten"] path = modules/emscripten url = git://github.com/kripken/emscripten.git +[submodule "modules/mrubymix"] + path = modules/mrubymix + url = git://github.com/xxuejie/mrubymix.git diff --git a/Rakefile b/Rakefile index ffabc19..59196fc 100644 --- a/Rakefile +++ b/Rakefile @@ -21,6 +21,8 @@ LIBMRUBY_FILE = File.join(MRUBY_DIR, LIBMRUBY) MRBTEST = File.join(%w[build emscripten test mrbtest]) MRBTEST_FILE = File.join(MRUBY_DIR, MRBTEST) +MRUBYMIX = File.join(BASE_DIR, %w[modules mrubymix bin mrubymix]) + # Specify supported loading modes of webruby, see rakelib/functions.rb file # for details, by default all 3 loading modes are supported LOADING_MODE = ENV['LOADING_MODE'] || 2 diff --git a/app/app.rake b/app/app.rake index ce27af8..f255776 100644 --- a/app/app.rake +++ b/app/app.rake @@ -17,11 +17,5 @@ file "#{BUILD_DIR}/rbcode.c" => ["#{BUILD_DIR}/rbcode.rb", "#{MRBC}"] do |t| end file "#{BUILD_DIR}/rbcode.rb" => app_files do |t| - # Puts the entrypoint file at the end of the list - if (i = app_files.index(ENTRYPOINT_FILE)) - last_i = app_files.length - 1 - app_files[i], app_files[last_i] = app_files[last_i], app_files[i] - end - - sh "cat #{app_files.join(' ')} > #{BUILD_DIR}/rbcode.rb" + sh "ruby #{MRUBYMIX} #{ENTRYPOINT_FILE} #{BUILD_DIR}/rbcode.rb" end diff --git a/modules/mrubymix b/modules/mrubymix new file mode 160000 index 0000000..4154a8e --- /dev/null +++ b/modules/mrubymix @@ -0,0 +1 @@ +Subproject commit 4154a8ef29d1307ca61f8d61a249acd30c9cb0bc