Skip to content

Commit 931f208

Browse files
committed
Merge pull request #359 from larskanis/rake-compiler-dock
Add rake-compiler-dock for building Windows binary gems.
2 parents 35cbacf + 0a64571 commit 931f208

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ gemspec name: 'concurrent-ruby-edge'
66
group :development do
77
gem 'rake', '~> 10.4.2'
88
gem 'rake-compiler', '~> 0.9.5'
9+
gem 'rake-compiler-dock', '~> 0.4.0'
910
gem 'gem-compiler', '~> 0.3.0'
1011
gem 'benchmark-ips', '~> 2.2.0'
1112

Rakefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ elsif Concurrent.allow_c_extensions?
7070
}
7171
platforms.each do |platform, prefix|
7272
task "copy:#{EXT_NAME}:#{platform}:#{ruby_version}" do |t|
73-
%w[lib tmp/#{platform}/stage/lib].each do |dir|
73+
["lib", "tmp/#{platform}/stage/lib/concurrent"].each do |dir|
7474
so_file = "#{dir}/#{ruby_version[/^\d+\.\d+/]}/#{EXT_NAME}.so"
7575
if File.exists?(so_file)
7676
sh "#{prefix}-strip -S #{so_file}"
@@ -87,9 +87,8 @@ end
8787
task :clean do
8888
rm_rf 'pkg/classes'
8989
rm_rf 'tmp'
90-
rm_rf 'lib/concurrent/1.9'
91-
rm_rf 'lib/concurrent/2.0'
92-
rm_rf 'lib/concurrent/2.1'
90+
rm_rf Dir.glob('lib/concurrent/1.?')
91+
rm_rf Dir.glob('lib/concurrent/2.?')
9392
rm_f Dir.glob('./**/*.so')
9493
rm_f Dir.glob('./**/*.bundle')
9594
rm_f Dir.glob('./lib/*.jar')
@@ -135,6 +134,15 @@ namespace :build do
135134
sh 'mv *.gem pkg/'
136135
end
137136
end
137+
138+
desc "Build the windows binary gems per rake-compiler-dock"
139+
task :windows do
140+
require 'rake_compiler_dock'
141+
RakeCompilerDock.sh <<-EOT
142+
bundle --without="development testing" &&
143+
rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0:2.1.6:2.2.2
144+
EOT
145+
end
138146
end
139147

140148
if Concurrent.on_jruby?

0 commit comments

Comments
 (0)