@@ -7,23 +7,23 @@ require 'concurrent/utility/native_extension_loader'
77
88## load the two gemspec files
99CORE_GEMSPEC = Gem ::Specification . load ( 'concurrent-ruby.gemspec' )
10- EXT_GEMSPEC = Gem ::Specification . load ( 'concurrent-ruby-ext.gemspec' )
10+ EXT_GEMSPEC = Gem ::Specification . load ( 'concurrent-ruby-ext.gemspec' )
1111EDGE_GEMSPEC = Gem ::Specification . load ( 'concurrent-ruby-edge.gemspec' )
1212
1313## constants used for compile/build tasks
1414
15- GEM_NAME = 'concurrent-ruby'
16- EXT_NAME = 'extension'
17- EDGE_NAME = 'edge'
15+ GEM_NAME = 'concurrent-ruby'
16+ EXT_NAME = 'extension'
17+ EDGE_NAME = 'edge'
1818JAVA_EXT_NAME = 'concurrent_ruby_ext'
1919
2020if Concurrent . on_jruby?
21- CORE_GEM = "#{ GEM_NAME } -#{ Concurrent ::VERSION } -java.gem"
21+ CORE_GEM = "#{ GEM_NAME } -#{ Concurrent ::VERSION } -java.gem"
2222else
23- CORE_GEM = "#{ GEM_NAME } -#{ Concurrent ::VERSION } .gem"
24- EXT_GEM = "#{ GEM_NAME } -ext-#{ Concurrent ::VERSION } .gem"
23+ CORE_GEM = "#{ GEM_NAME } -#{ Concurrent ::VERSION } .gem"
24+ EXT_GEM = "#{ GEM_NAME } -ext-#{ Concurrent ::VERSION } .gem"
2525 NATIVE_GEM = "#{ GEM_NAME } -ext-#{ Concurrent ::VERSION } -#{ Gem ::Platform . new ( RUBY_PLATFORM ) } .gem"
26- EDGE_GEM = "#{ GEM_NAME } -edge-#{ Concurrent ::EDGE_VERSION } .gem"
26+ EDGE_GEM = "#{ GEM_NAME } -edge-#{ Concurrent ::EDGE_VERSION } .gem"
2727end
2828
2929## safely load all the rake tasks in the `tasks` directory
@@ -41,6 +41,11 @@ Dir.glob('tasks/**/*.rake').each do |rakefile|
4141 safe_load rakefile
4242end
4343
44+ def has_docker?
45+ system ( "docker version > /dev/null 2>&1" )
46+ 0 == $?. exitstatus
47+ end
48+
4449if Concurrent . on_jruby?
4550
4651 ## create the compile task for the JRuby-specific gem
@@ -135,21 +140,27 @@ namespace :build do
135140 end
136141 end
137142
138- desc "Build the windows binary gems per rake-compiler-dock"
139- task :windows do
140- require 'rake_compiler_dock'
141- RakeCompilerDock . sh <<-EOT
143+ if has_docker?
144+ desc "Build the windows binary #{ Concurrent ::VERSION } gems per rake-compiler-dock"
145+ task :windows do
146+ require 'rake_compiler_dock'
147+ RakeCompilerDock . sh <<-EOT
142148 bundle --without="development testing" &&
143149 rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0:2.1.6:2.2.2
144- EOT
150+ rm -rf .bundle
151+ EOT
152+ end
145153 end
146154end
147155
148156if Concurrent . on_jruby?
149157 desc 'Build JRuby-specific core gem (alias for `build:core`)'
150158 task :build => [ 'build:core' ]
159+ elsif has_docker?
160+ desc 'Build core, extension, and edge gems, including Windows binaries'
161+ task :build => [ 'build:core' , 'build:ext' , 'build:edge' , 'build:windows' ]
151162else
152- desc 'Build core, extension, and edge gems'
163+ desc 'Build core, extension, and edge gems (excluding Windows binaries) '
153164 task :build => [ 'build:core' , 'build:ext' , 'build:edge' ]
154165end
155166
0 commit comments