Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. diff --git a/Rakefile b/Rakefile
  2. index 2bd2499f..9e36cb96 100644
  3. --- a/Rakefile
  4. +++ b/Rakefile
  5. @@ -1,3 +1,29 @@
  6. +# Common usage
  7. +#
  8. +# rake build:adapters - to build all specific adapter gems and the base gem
  9. +# rake release:do - build:adapters + git tag + push gems
  10. +#
  11. +# Environment variables used by this Rakefile:
  12. +#
  13. +# INCLUDE_JAR_IN_GEM [default task - false, other taks - true]:
  14. +# Note: This is something you should not normally have to set.
  15. +# For local development we always will end up including the jar file
  16. +# in any task which generates our main gem. The wrinkle to this
  17. +# is when we do a custom github link in bundler:
  18. +#
  19. +# gem 'ar-jdbc', github: '...'
  20. +#
  21. +# Because we stopped committing a .jar file for every change and so when
  22. +# we include a gem like this it clones the repository and does a default
  23. +# build in rake. This in turn will end up forcing a compile to generate
  24. +# that jar (similar to how c-extensions compile at the time of install).
  25. +# For shipped gems we do include the jar so that people do not require
  26. +# this compile step.
  27. +#
  28. +# NOOP [release:do - false]
  29. +#
  30. +# No commands or gem pushing during a release.
  31. +
  32. require 'rake/clean'
  33.  
  34. CLEAN.include 'derby*', 'test.db.*', '*test.sqlite3', 'test/reports'
  35. @@ -38,7 +64,7 @@ rake = lambda { |task| ruby "-S", "rake", task }
  36.  
  37. desc "Build #{gem_name} gem into the pkg directory."
  38. task :build => :jar do
  39. - sh("RELEASE=#{ENV['RELEASE']} gem build -V '#{gemspec_path}'") do
  40. + sh("INCLUDE_JAR_IN_GEM=#{ENV['INCLUDE_JAR_IN_GEM']} gem build -V '#{gemspec_path}'") do
  41. gem_path = built_gem_path.call
  42. file_name = File.basename(gem_path)
  43. FileUtils.mkdir_p(File.join(base_dir, 'pkg'))
  44. @@ -58,7 +84,7 @@ end
  45.  
  46. desc "Releasing AR-JDBC gems (use NOOP=true to disable gem pushing)"
  47. task 'release:do' do
  48. - ENV['RELEASE'] = 'true' # so that .gemspec is built with adapter_java.jar
  49. + ENV['INCLUDE_JAR_IN_GEM'] = 'true' # so that .gemspec is built with adapter_java.jar
  50. Rake::Task['build'].invoke
  51. Rake::Task['build:adapters'].invoke
  52.  
  53. @@ -297,7 +323,7 @@ if defined? JRUBY_VERSION
  54. # class_files.gsub!('$', '\$') unless windows?
  55. # args = class_files.map { |path| [ "-C #{classes_dir}", path ] }.flatten
  56.  
  57. - if ENV['RELEASE'] == 'true'; require 'tempfile'
  58. + if ENV['INCLUDE_JAR_IN_GEM'] == 'true'; require 'tempfile'
  59. manifest = "Built-Time: #{Time.now.utc.strftime('%Y-%m-%d %H:%M:%S')}\n"
  60. manifest += "Built-JRuby: #{JRUBY_VERSION}\n"
  61. manifest += "Specification-Title: ActiveRecord-JDBC\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement