summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2015-06-20 22:40:49 +0200
committerLars Kanis <kanis@comcard.de>2015-06-23 16:48:01 +0200
commit78c2ec93725d8aecbb48da4872f4f94a59cc0f8e (patch)
treee3f769ac21590b2b9c43a72447fa6de8dd13b0ae /Rakefile
parentd06ee6f2315eae1eb858c174459a85c4cc618c75 (diff)
downloadffi-78c2ec93725d8aecbb48da4872f4f94a59cc0f8e.tar.gz
Simplify cross build tasks and add rake-compiler-dock for building Windows binary gems.
rake-compiler-dock makes building Windows gems faster and with little to no setup compared to rake-compiler-dev-box. A simple 'rake gem:windows' should be enough. The cross ruby versions used by gem:windows are not passed to the container, so the rake-compiler-dock's defaults are used. These are slightly different.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile20
1 files changed, 8 insertions, 12 deletions
diff --git a/Rakefile b/Rakefile
index 3aa7a75..98d14d2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -169,27 +169,23 @@ if USE_RAKE_COMPILER
ext.cross_platform = %w[i386-mingw32 x64-mingw32] # forces the Windows platform instead of the default one
end
- task 'gem:win32' => ['gem:win32-x64', 'gem:win32-i386']
+ ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3:2.0.0:2.1.5:2.2.1'
- task 'gem:win32-i386' do
- sh("rake cross native:i386-mingw32 gem RUBY_CC_VERSION='1.8.7:1.9.3:2.0.0:2.1.5:2.2.1'") || raise("win32-i386 build failed!")
- end
-
- task 'gem:win32-x64' do
- sh("rake cross native:x64-mingw32 gem RUBY_CC_VERSION='2.0.0:2.1.5:2.2.1'") || raise("win32-x64 build failed!")
- end
-
- (ENV['RUBY_CC_VERSION'] || '1.8.7:1.9.3:2.0.0:2.1.5:2.2.1' ).to_s.split(':').each do |ruby_version|
+ ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
task "copy:ffi_c:i386-mingw32:#{ruby_version}" do |t|
sh "i686-w64-mingw32-strip -S #{BUILD_DIR}/i386-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so"
end
- end
- (ENV['RUBY_CC_VERSION'] || '2.0.0:2.1.5:2.2.1' ).to_s.split(':').each do |ruby_version|
task "copy:ffi_c:x64-mingw32:#{ruby_version}" do |t|
sh "x86_64-w64-mingw32-strip -S #{BUILD_DIR}/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so"
end
end
+
+ desc "build a windows gem without all the ceremony."
+ task "gem:windows" do
+ require "rake_compiler_dock"
+ RakeCompilerDock.sh "bundle && rake cross native gem MAKE='nice make -j`nproc`'"
+ end
end
Gem::Tasks.new do |t|