2012-11-17 00:38:13 +00:00
|
|
|
require 'open-uri'
|
|
|
|
|
2012-11-17 01:25:44 +00:00
|
|
|
RMQ_URI_BASE = 'http://www.rabbitmq.com/releases/rabbitmq-java-client'
|
|
|
|
RMQV = '2.8.7'
|
|
|
|
|
2012-11-17 00:38:13 +00:00
|
|
|
directory './tmp'
|
|
|
|
|
2012-11-17 01:25:44 +00:00
|
|
|
file "./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz" => ['./tmp'] do |f|
|
|
|
|
puts "*** Downloading tarball"
|
|
|
|
open("#{RMQ_URI_BASE}/v#{RMQV}/rabbitmq-java-client-bin-#{RMQV}.tar.gz") do |f|
|
2012-11-17 00:38:13 +00:00
|
|
|
open('./tmp/rabbitmq-java-client-bin.tar.gz', 'w') do |out|
|
|
|
|
out.write(f.read)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-11-17 01:25:44 +00:00
|
|
|
file "./tmp/rabbitmq-java-client-bin-#{RMQV}/rabbitmq-client.jar" =>
|
|
|
|
["./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz"] do
|
|
|
|
puts "*** Extracting tarball"
|
2012-11-17 00:38:13 +00:00
|
|
|
Dir.chdir('./tmp') do
|
|
|
|
`tar xzvf rabbitmq-java-client-bin.tar.gz`
|
2012-11-17 01:25:44 +00:00
|
|
|
puts "*** Extracted, exit code = #{$?}"
|
2012-11-17 00:38:13 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-11-17 01:25:44 +00:00
|
|
|
file './lib/java/rabbitmq-client.jar' =>
|
|
|
|
["./tmp/rabbitmq-java-client-bin-#{RMQV}/rabbitmq-client.jar"] do
|
|
|
|
puts "*** Copying jars"
|
|
|
|
Dir["./tmp/rabbitmq-java-client-bin-#{RMQV}/*.jar"].each do |jar|
|
|
|
|
puts "*** Copying #{jar} to ./lib/java"
|
|
|
|
FileUtils.cp(jar, './lib/java', :verbose => true)
|
2012-11-17 00:38:13 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Download and copy over the rabbitmq client jar'
|
|
|
|
task :rabbitmq_client_jar => ['./lib/java/rabbitmq-client.jar']
|
|
|
|
|
|
|
|
task :default => [:rabbitmq_client_jar]
|