@@ -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,10 @@ 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 || boot2docker version > /dev/null 2>&1" )
46+ end
47+
4448if Concurrent . on_jruby?
4549
4650 ## create the compile task for the JRuby-specific gem
@@ -135,21 +139,27 @@ namespace :build do
135139 end
136140 end
137141
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+ if has_docker?
143+ desc "Build the windows binary #{ Concurrent ::VERSION } gems per rake-compiler-dock"
144+ task :windows do
145+ require 'rake_compiler_dock'
146+ RakeCompilerDock . sh <<-EOT
142147 bundle --without="development testing" &&
143148 rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0:2.1.6:2.2.2
144- EOT
149+ rm -rf .bundle
150+ EOT
151+ end
145152 end
146153end
147154
148155if Concurrent . on_jruby?
149156 desc 'Build JRuby-specific core gem (alias for `build:core`)'
150157 task :build => [ 'build:core' ]
158+ elsif has_docker?
159+ desc 'Build core, extension, and edge gems, including Windows binaries'
160+ task :build => [ 'build:core' , 'build:ext' , 'build:edge' , 'build:windows' ]
151161else
152- desc 'Build core, extension, and edge gems'
162+ desc 'Build core, extension, and edge gems (excluding Windows binaries) '
153163 task :build => [ 'build:core' , 'build:ext' , 'build:edge' ]
154164end
155165
@@ -170,7 +180,20 @@ begin
170180 '--tag ~notravis'
171181 end
172182
173- task :ci => [ :clean , :compile , :travis ]
183+ RSpec ::Core ::RakeTask . new ( :appveyor ) do |t |
184+ t . rspec_opts = '--backtrace ' \
185+ '--tag ~unfinished ' \
186+ '--seed 1 ' \
187+ '--format documentation ' \
188+ '--tag ~notravis'
189+ end
190+
191+ if Concurrent . on_windows?
192+ task :ci => [ :clean , :compile , :appveyor ]
193+ else
194+ task :ci => [ :clean , :compile , :travis ]
195+ end
196+
174197 task :default => [ :clean , :compile , :spec ]
175198rescue LoadError
176199 puts 'Error loading Rspec rake tasks, probably building the gem...'
0 commit comments