logstash/rakelib/gems.rake
Colin Surprenant 48bcc5b74d cleanup dependencies and rely on logstash-core gem
remove unused load path

use either local core lib dir or logstash-core gem

include spec in logstash-core

do not include lib, spec and locales dirs in package root

environment bootstrapping in lib/bootstrap.rb

added comments

move pluginmanager out of logstash-core

kafla installation solved by pluginmanager refactor

refactor bootstrap code

refactor shell scripts to simplify and DRY, indirect rspec command to our ruby launcher

add bin/rspec

cut by half the bin/plugin and bin/rspec startup time

fix drip context

use printf instead of tr

updated Windows bin scripts

missing gemspec in gemspec

use gem instead of gemspec so our plugin manager can correctly install logstash-core

generate packages including locally built logstash-core gem

move jenkins developmnent dependencies into Gemfile, they do not belong in logstash-core

path leftover

clean help agent help usage message and remore rspec in available command

comments cosmetics

update Bundler dependency, all recent testing have been made with 1.9.4

updated .lock file with regard to updated Gemfile

cleanup gemspec, Gemfile and regen .lock file

added progress output

avoid dual require on version

closes #3096
2015-05-04 18:17:22 -04:00

52 lines
1.8 KiB
Ruby

require "rubygems/specification"
require "rubygems/commands/install_command"
namespace "gem" do
task "require", :name, :requirement do |task, args|
name, requirement = args[:name], args[:requirement]
require "bootstrap/environment"
ENV["GEM_HOME"] = ENV["GEM_PATH"] = LogStash::Environment.logstash_gem_home
Gem.use_paths(LogStash::Environment.logstash_gem_home)
begin
gem name, requirement
rescue Gem::LoadError => e
puts "Installing #{name} #{requirement} because the build process needs it."
Rake::Task["gem:install"].invoke(name, requirement, LogStash::Environment.logstash_gem_home)
end
task.reenable # Allow this task to be run again
end
task "install", [:name, :requirement, :target] => ["build/bootstrap"] do |task, args|
name, requirement, target = args[:name], args[:requirement], args[:target]
ENV["GEM_HOME"] = ENV["GEM_PATH"] = target
Gem.use_paths(target)
puts "[bootstrap] Fetching and installing gem: #{name} (#{requirement})"
installer = Gem::Commands::InstallCommand.new
installer.options[:generate_rdoc] = false
installer.options[:generate_ri] = false
installer.options[:version] = requirement
installer.options[:args] = [name]
installer.options[:install_dir] = target
# ruby 2.0.0 / rubygems 2.x; disable documentation generation
installer.options[:document] = []
begin
installer.execute
rescue Gem::LoadError => e
# For some weird reason the rescue from the 'require' task is being brought down here
# We don't know why placing this solves it, but it does.
rescue Gem::SystemExitException => e
if e.exit_code != 0
puts "Installation of #{name} failed"
raise
end
end
task.reenable # Allow this task to be run again
end # task "install"
end # namespace "gem"