@@ -7,23 +7,23 @@ require 'concurrent/utility/native_extension_loader'
7
7
8
8
## load the two gemspec files
9
9
CORE_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' )
11
11
EDGE_GEMSPEC = Gem ::Specification . load ( 'concurrent-ruby-edge.gemspec' )
12
12
13
13
## constants used for compile/build tasks
14
14
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'
18
18
JAVA_EXT_NAME = 'concurrent_ruby_ext'
19
19
20
20
if Concurrent . on_jruby?
21
- CORE_GEM = "#{ GEM_NAME } -#{ Concurrent ::VERSION } -java.gem"
21
+ CORE_GEM = "#{ GEM_NAME } -#{ Concurrent ::VERSION } -java.gem"
22
22
else
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"
25
25
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"
27
27
end
28
28
29
29
## safely load all the rake tasks in the `tasks` directory
@@ -41,6 +41,11 @@ Dir.glob('tasks/**/*.rake').each do |rakefile|
41
41
safe_load rakefile
42
42
end
43
43
44
+ def has_docker?
45
+ system ( "docker version > /dev/null 2>&1" )
46
+ 0 == $?. exitstatus
47
+ end
48
+
44
49
if Concurrent . on_jruby?
45
50
46
51
## create the compile task for the JRuby-specific gem
@@ -135,21 +140,27 @@ namespace :build do
135
140
end
136
141
end
137
142
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
142
148
bundle --without="development testing" &&
143
149
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
145
153
end
146
154
end
147
155
148
156
if Concurrent . on_jruby?
149
157
desc 'Build JRuby-specific core gem (alias for `build:core`)'
150
158
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' ]
151
162
else
152
- desc 'Build core, extension, and edge gems'
163
+ desc 'Build core, extension, and edge gems (excluding Windows binaries) '
153
164
task :build => [ 'build:core' , 'build:ext' , 'build:edge' ]
154
165
end
155
166
0 commit comments