-
Notifications
You must be signed in to change notification settings - Fork 68
/
Rakefile
53 lines (43 loc) · 1.4 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require 'rspec/core/rake_task'
require 'rubygems/package_task'
RSpec::Core::RakeTask.new(:spec)
task default: :spec
# rubocop:disable Security/Eval
def modify_base_gemspec(&block)
eval(File.read('airbrake-ruby.gemspec')).tap(&block)
end
# rubocop:enable Security/Eval
namespace :ruby do
spec = modify_base_gemspec do |s|
# We keep this dependency in Gemfile, so we can run CI builds. When we
# generate gems, duplicate dependencies are not allowed.
s.dependencies.delete_if { |d| d.name == 'rbtree-jruby' || 'rbtree3' }
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|
# We keep this dependency in Gemfile, so we can run CI builds. When we
# generate gems, duplicate dependencies are not allowed.
s.dependencies.delete_if { |d| d.name == 'rbtree-jruby' || 'rbtree3' }
s.platform = 'java'
s.add_dependency('rbtree-jruby', '~> 0.2')
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[ruby:clobber_package 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