summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-07-16 09:48:52 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2013-07-16 09:48:52 -0700
commit259fcf2ee002a0442fbad48d75c8bca122377087 (patch)
tree0bc1facf931a0a6e524804585ab1d56042c548ee
parent6ee9858b670a30a49e3d1c88bf932e1ba41a6847 (diff)
parent122770d17ffb2038b91e4b99d88c6586463b0f50 (diff)
downloadmruby-259fcf2ee002a0442fbad48d75c8bca122377087.tar.gz
mruby-259fcf2ee002a0442fbad48d75c8bca122377087.zip
Merge pull request #1384 from xxuejie/customize-build-dir
Allow programmers to specify build path manually
-rw-r--r--tasks/mruby_build.rake7
-rw-r--r--tasks/mruby_build_gem.rake6
2 files changed, 5 insertions, 8 deletions
diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake
index eeebd161b..ef7f06a81 100644
--- a/tasks/mruby_build.rake
+++ b/tasks/mruby_build.rake
@@ -43,7 +43,7 @@ module MRuby
end
include Rake::DSL
include LoadGems
- attr_accessor :name, :bins, :exts, :file_separator
+ attr_accessor :name, :bins, :exts, :file_separator, :build_dir
attr_reader :libmruby, :gems
COMPILERS = %w(cc cxx objc asm)
@@ -63,6 +63,7 @@ module MRuby
end
@file_separator = '/'
+ @build_dir = "#{MRUBY_ROOT}/build/#{@name}"
@cc = Command::Compiler.new(self, %w(.c))
@cxx = Command::Compiler.new(self, %w(.cc .cxx .cpp))
@objc = Command::Compiler.new(self, %w(.m))
@@ -95,10 +96,6 @@ module MRuby
MRUBY_ROOT
end
- def build_dir
- "#{MRUBY_ROOT}/build/#{self.name}"
- end
-
def mrbcfile
MRuby.targets['host'].exefile("#{MRuby.targets['host'].build_dir}/bin/mrbc")
end
diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake
index 975b032a6..24aea71ab 100644
--- a/tasks/mruby_build_gem.rake
+++ b/tasks/mruby_build_gem.rake
@@ -39,18 +39,18 @@ module MRuby
gemdir = "#{root}/mrbgems/#{params[:core]}"
elsif params[:git]
url = params[:git]
- gemdir = "build/mrbgems/#{url.match(/([-\w]+)(\.[-\w]+|)$/).to_a[1]}"
+ gemdir = "#{build_dir}/mrbgems/#{url.match(/([-\w]+)(\.[-\w]+|)$/).to_a[1]}"
if File.exists?(gemdir)
if $pull_gems
git.run_pull gemdir, url
else
gemdir
- end
+ end
else
options = [params[:options]] || []
options << "--branch \"#{params[:branch]}\"" if params[:branch]
- FileUtils.mkdir_p "build/mrbgems"
+ FileUtils.mkdir_p "#{build_dir}/mrbgems"
git.run_clone gemdir, url, options
end
else