Created
December 4, 2014 10:22
-
-
Save jsvd/8b6b061ad3b4ab00032e to your computer and use it in GitHub Desktop.
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
diff --git a/logstash.gemspec b/logstash.gemspec | |
index dbc88ed..ec7cf22 100644 | |
--- a/logstash.gemspec | |
+++ b/logstash.gemspec | |
@@ -39,6 +39,7 @@ Gem::Specification.new do |gem| | |
# gem.add_runtime_dependency "jar-dependencies", [">= 0.1.2"] #(MIT license) | |
gem.add_runtime_dependency "ruby-maven" #(EPL license) | |
+ gem.add_runtime_dependency "maven-tools", "= 1.0.5" | |
gem.add_runtime_dependency "minitar" | |
if RUBY_PLATFORM == 'java' | |
diff --git a/rakelib/plugin.rake b/rakelib/plugin.rake | |
index 4997ac8..2a6a033 100644 | |
--- a/rakelib/plugin.rake | |
+++ b/rakelib/plugin.rake | |
@@ -15,7 +15,11 @@ namespace "plugin" do | |
gem_path = ENV['GEM_PATH'] | |
gem_home = ENV['GEM_HOME'] | |
env = { | |
- "GEM_PATH" => "#{ENV['GEM_PATH']}:vendor/bundle/jruby/1.9", | |
+ "GEM_PATH" => [ | |
+ ENV['GEM_PATH'], | |
+ ::File.join(LogStash::Environment::LOGSTASH_HOME, 'build/bootstrap'), | |
+ ::File.join(LogStash::Environment::LOGSTASH_HOME, 'vendor/jruby/lib/ruby/gems/shared') | |
+ ].join(":"), | |
"GEM_HOME" => "vendor/plugins/jruby/1.9" | |
} | |
if ENV['USE_RUBY'] != '1' | |
diff --git a/rakelib/vendor.rake b/rakelib/vendor.rake | |
index 7b1e5ae..9235784 100644 | |
--- a/rakelib/vendor.rake | |
+++ b/rakelib/vendor.rake | |
@@ -238,9 +238,19 @@ namespace "vendor" do | |
else | |
# Use the vendored jruby binary | |
jruby = File.join("vendor", "jruby", "bin", "jruby") | |
+ bundler = File.join("build", "bootstrap", "bin", "bundle") | |
end | |
- cmd = [jruby, bundler, "install", "--gemfile=tools/Gemfile", "--path", LogStash::Environment::BUNDLE_DIR, "--standalone", "--clean", "--without", "development", "--jobs", "4"] | |
+ backup_gem_home = ENV['GEM_HOME'] | |
+ backup_gem_path = ENV['GEM_PATH'] | |
+ ENV['GEM_HOME'] = LogStash::Environment.gem_home | |
+ ENV['GEM_PATH'] = [ | |
+ ::File.join(LogStash::Environment::LOGSTASH_HOME, 'build/bootstrap'), | |
+ ::File.join(LogStash::Environment::LOGSTASH_HOME, 'vendor/jruby/lib/ruby/gems/shared') | |
+ ].join(":") | |
+ cmd = [jruby, "-S", bundler, "install", "--gemfile=tools/Gemfile"] | |
system(*cmd) | |
+ ENV['GEM_HOME'] = backup_gem_home | |
+ ENV['GEM_PATH'] = backup_gem_path | |
raise RuntimeError, $!.to_s unless $?.success? | |
break | |
rescue Gem::RemoteFetcher::FetchError => e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment