[Groonga-commit] ranguba/rroonga at 18f9002 [master] Don't use current directory for cross compile

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Oct 6 22:16:59 JST 2015


Kouhei Sutou	2015-10-06 22:16:59 +0900 (Tue, 06 Oct 2015)

  New Revision: 18f90022a3ae81838d43849e2c818e0b90c7bc0a
  https://github.com/ranguba/rroonga/commit/18f90022a3ae81838d43849e2c818e0b90c7bc0a

  Message:
    Don't use current directory for cross compile

  Modified files:
    Rakefile

  Modified: Rakefile (+21 -7)
===================================================================
--- Rakefile    2015-10-06 22:08:48 +0900 (d054cee)
+++ Rakefile    2015-10-06 22:16:59 +0900 (1bad186)
@@ -17,6 +17,7 @@
 
 require "find"
 require "fileutils"
+require "shellwords"
 require "pathname"
 require "erb"
 require "yard"
@@ -157,17 +158,30 @@ namespace :build do
     architectures.each do |architecture|
       desc "Build gem for Windows #{architecture}"
       task architecture do
-        require "rake_compiler_dock"
-        rm_rf binary_dir
+        build_dir = "tmp/windows"
+        rm_rf build_dir
+        mkdir_p build_dir
+
         commands = [
-          "bundle",
-          "rake clean",
-          "rake cross native gem RUBY_CC_VERSION=#{ruby_versions}",
+          ["git", "clone", "file://#{Dir.pwd}/.git", build_dir],
+          ["cd", build_dir],
+          ["bundle"],
+          ["rake", "cross", "native", "gem", "RUBY_CC_VERSION=#{ruby_versions}"],
         ]
         if architecture == :x64
-          commands.unshift("export RROONGA_USE_GROONGA_X64=true")
+          commands.unshift(["export", "RROONGA_USE_GROONGA_X64=true"])
+        end
+        raw_commands = commands.collect do |command|
+          Shellwords.join(command)
         end
-        RakeCompilerDock.sh(commands.join(" && "))
+        raw_command_line = raw_commands.join(" && ")
+
+        require "rake_compiler_dock"
+        RakeCompilerDock.sh(raw_command_line)
+
+        version = spec.version
+        cp("#{build_dir}/pkg/rroonga-#{version}-#{architecture}-mingw32.gem",
+           "pkg/")
       end
     end
   end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index