-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current approach doesn't work with JRuby. The patch that aimed to fix the issue didn't actually work (duh): #408 The problem is that I run `gem build *.gemspec` using CRuby, so the JRuby check inside the gemspec always has the same outcome. This change builds gems properly, with `rake gems`.
- Loading branch information
Showing
3 changed files
with
44 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ Gemfile.lock | |
.bundle | ||
doc | ||
.yardoc | ||
pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,46 @@ | ||
require 'rake/clean' | ||
require 'rspec/core/rake_task' | ||
RSpec::Core::RakeTask.new(:spec) | ||
require 'rubygems/package_task' | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
task default: :spec | ||
|
||
# rubocop:disable Security/Eval | ||
def modify_base_gemspec | ||
eval(File.read('airbrake-ruby.gemspec')).tap { |s| yield s } | ||
end | ||
# rubocop:enable Security/Eval | ||
|
||
namespace :ruby do | ||
spec = modify_base_gemspec do |s| | ||
s.platform = Gem::Platform::RUBY | ||
s.add_dependency('rbtree3', '~> 0.5') | ||
end | ||
|
||
Gem::PackageTask.new(spec) do |pkg| | ||
pkg.need_zip = false | ||
pkg.need_tar = false | ||
end | ||
end | ||
|
||
namespace :jruby do | ||
spec = modify_base_gemspec do |s| | ||
s.add_dependency('rbtree-jruby', '~> 0.2') | ||
s.platform = 'java' | ||
end | ||
|
||
Gem::PackageTask.new(spec) do |pkg| | ||
pkg.need_zip = false | ||
pkg.need_tar = false | ||
end | ||
end | ||
|
||
desc 'Build all platform gems at once' | ||
task gems: %w[clean ruby:gem jruby:gem] | ||
|
||
desc 'Build and push platform gems' | ||
task pushgems: :gems do | ||
chdir("#{File.dirname(__FILE__)}/pkg") do | ||
Dir['*.gem'].each { |gem| sh "gem push #{gem}" } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters