Skip to content

Commit e77e51f

Browse files
committed
Merge pull request #364 from ruby-concurrency/build-updates
Build updates
2 parents d31bf98 + 28627ca commit e77e51f

File tree

5 files changed

+62
-25
lines changed

5 files changed

+62
-25
lines changed

Gemfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ 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'
9+
gem 'rake-compiler-dock', '~> 0.4.2'
1010
gem 'gem-compiler', '~> 0.3.0'
1111
gem 'benchmark-ips', '~> 2.2.0'
1212

1313
# documentation
1414
gem 'countloc', '~> 0.4.0', :platforms => :mri, :require => false
1515
gem 'yard', '~> 0.8.7.6', :require => false
16-
gem 'inch', '~> 0.6.2', :platforms => :mri, :require => false
17-
gem 'redcarpet', '~> 3.2.3', platforms: :mri # understands github markdown
16+
gem 'inch', '~> 0.6.3', :platforms => :mri, :require => false
17+
gem 'redcarpet', '~> 3.3.2', platforms: :mri # understands github markdown
1818
end
1919

2020
group :testing do
21-
gem 'rspec', '~> 3.2.0'
22-
gem 'timecop', '~> 0.7.3'
21+
gem 'rspec', '~> 3.3.0'
22+
gem 'timecop', '~> 0.7.4'
2323

2424
# Coverage
2525
gem 'simplecov', '~> 0.10.0', :require => false
26-
gem 'coveralls', '~> 0.8.1', :require => false
26+
gem 'coveralls', '~> 0.8.2', :require => false
2727
end

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,16 @@ bundle exec rake build # Build JRuby-specific core gem (alias for `
249249
bundle exec rake build:core # Build concurrent-ruby-<version>-java.gem into the pkg directory
250250
251251
*All except JRuby*
252-
bundle exec rake build # Build core and extension gems
253252
bundle exec rake build:core # Build concurrent-ruby-<version>.gem into the pkg directory
254253
bundle exec rake build:ext # Build concurrent-ruby-ext-<version>.gem into the pkg directory
255254
255+
*When Docker IS installed*
256+
bundle exec rake build:windows # Build the windows binary <version> gems per rake-compiler-dock
257+
bundle exec rake build # Build core, extension, and edge gems, including Windows binaries
258+
259+
*When Docker is NOT installed*
260+
bundle exec rake build # Build core, extension, and edge gems (excluding Windows binaries)
261+
256262
*All*
257263
bundle exec rake clean # Remove any temporary products
258264
bundle exec rake clobber # Remove any generated file
@@ -261,7 +267,7 @@ bundle exec rake compile # Compile all the extensions
261267

262268
## Maintainers
263269

264-
* [Jerry D'Antonio](https://github.com/jdantonio)
270+
* [Jerry D'Antonio](https://github.com/jdantonio) (creator)
265271
* [Michele Della Torre](https://github.com/mighe)
266272
* [Chris Seaton](https://github.com/chrisseaton)
267273
* [Lucas Allan](https://github.com/lucasallan)

Rakefile

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ require 'concurrent/utility/native_extension_loader'
77

88
## load the two gemspec files
99
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')
1111
EDGE_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'
1818
JAVA_EXT_NAME = 'concurrent_ruby_ext'
1919

2020
if Concurrent.on_jruby?
21-
CORE_GEM = "#{GEM_NAME}-#{Concurrent::VERSION}-java.gem"
21+
CORE_GEM = "#{GEM_NAME}-#{Concurrent::VERSION}-java.gem"
2222
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"
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"
2727
end
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
4242
end
4343

44+
def has_docker?
45+
system("docker version > /dev/null 2>&1 || boot2docker version > /dev/null 2>&1")
46+
end
47+
4448
if 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
146153
end
147154

148155
if 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']
151161
else
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']
154164
end
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]
175198
rescue LoadError
176199
puts 'Error loading Rspec rake tasks, probably building the gem...'

lib/concurrent/utility/engine.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def on_rbx?
1919
ruby_engine == 'rbx'
2020
end
2121

22+
def on_windows?
23+
!(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/).nil?
24+
end
25+
2226
def ruby_engine
2327
defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
2428
end

spec/spec_helper.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
require 'simplecov'
99
require 'coveralls'
1010

11-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
11+
if ENV['TRAVIS']
12+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
1213
SimpleCov::Formatter::HTMLFormatter,
1314
Coveralls::SimpleCov::Formatter
14-
]
15+
]
16+
else
17+
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
18+
end
1519

1620
SimpleCov.start do
1721
project_name 'concurrent-ruby'

0 commit comments

Comments
 (0)