|
| 1 | +# Common usage |
| 2 | +# |
| 3 | +# rake build:adapters - to build all specific adapter gems and the base gem |
| 4 | +# rake release:do - build:adapters + git tag + push gems |
| 5 | +# |
| 6 | +# Environment variables used by this Rakefile: |
| 7 | +# |
| 8 | +# INCLUDE_JAR_IN_GEM [default task - false, other taks - true]: |
| 9 | +# Note: This is something you should not normally have to set. |
| 10 | +# For local development we always will end up including the jar file |
| 11 | +# in any task which generates our main gem. The wrinkle to this |
| 12 | +# is when we do a custom github link in bundler: |
| 13 | +# |
| 14 | +# gem 'ar-jdbc', github: '...' |
| 15 | +# |
| 16 | +# Because we stopped committing a .jar file for every change and so when |
| 17 | +# we include a gem like this it clones the repository and does a default |
| 18 | +# build in rake. This in turn will end up forcing a compile to generate |
| 19 | +# that jar (similar to how c-extensions compile at the time of install). |
| 20 | +# For shipped gems we do include the jar so that people do not require |
| 21 | +# this compile step. |
| 22 | +# |
| 23 | +# NOOP [release:do - false] |
| 24 | +# |
| 25 | +# No commands or gem pushing during a release. |
| 26 | + |
1 | 27 | require 'rake/clean'
|
2 | 28 |
|
3 | 29 | CLEAN.include 'derby*', 'test.db.*', '*test.sqlite3', 'test/reports'
|
@@ -38,7 +64,8 @@ rake = lambda { |task| ruby "-S", "rake", task }
|
38 | 64 |
|
39 | 65 | desc "Build #{gem_name} gem into the pkg directory."
|
40 | 66 | task :build => :jar do
|
41 |
| - sh("RELEASE=#{ENV['RELEASE']} gem build -V '#{gemspec_path}'") do |
| 67 | + include_jar = ENV['INCLUDE_JAR_IN_GEM'] || 'true' |
| 68 | + sh("INCLUDE_JAR_IN_GEM=#{include_jar} gem build -V '#{gemspec_path}'") do |
42 | 69 | gem_path = built_gem_path.call
|
43 | 70 | file_name = File.basename(gem_path)
|
44 | 71 | FileUtils.mkdir_p(File.join(base_dir, 'pkg'))
|
|
58 | 85 |
|
59 | 86 | desc "Releasing AR-JDBC gems (use NOOP=true to disable gem pushing)"
|
60 | 87 | task 'release:do' do
|
61 |
| - ENV['RELEASE'] = 'true' # so that .gemspec is built with adapter_java.jar |
62 | 88 | Rake::Task['build'].invoke
|
63 | 89 | Rake::Task['build:adapters'].invoke
|
64 | 90 |
|
@@ -297,7 +323,7 @@ if defined? JRUBY_VERSION
|
297 | 323 | # class_files.gsub!('$', '\$') unless windows?
|
298 | 324 | # args = class_files.map { |path| [ "-C #{classes_dir}", path ] }.flatten
|
299 | 325 |
|
300 |
| - if ENV['RELEASE'] == 'true'; require 'tempfile' |
| 326 | + if ENV['INCLUDE_JAR_IN_GEM'] == 'true'; require 'tempfile' |
301 | 327 | manifest = "Built-Time: #{Time.now.utc.strftime('%Y-%m-%d %H:%M:%S')}\n"
|
302 | 328 | manifest += "Built-JRuby: #{JRUBY_VERSION}\n"
|
303 | 329 | manifest += "Specification-Title: ActiveRecord-JDBC\n"
|
|
0 commit comments