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-22 21:23:42 +00:00
|
|
|
GSONV = '2.2.2'
|
2012-11-17 01:25:44 +00:00
|
|
|
|
2012-11-17 00:38:13 +00:00
|
|
|
directory './tmp'
|
2012-11-22 21:23:42 +00:00
|
|
|
directory './lib/java'
|
2012-11-17 00:38:13 +00:00
|
|
|
|
2012-11-22 21:23:42 +00:00
|
|
|
file "./tmp/google-gson-#{GSONV}-release.zip" => ['./tmp'] do |t|
|
|
|
|
sh "curl -s -o #{t.name} " <<
|
|
|
|
"http://google-gson.googlecode.com/files/google-gson-#{GSONV}-release.zip"
|
|
|
|
end
|
|
|
|
|
|
|
|
file "./tmp/google-gson-#{GSONV}" => ["./tmp/google-gson-#{GSONV}-release.zip"] do
|
|
|
|
Dir.chdir('./tmp') do
|
|
|
|
sh "unzip -f -o google-gson-#{GSONV}-release.zip"
|
2012-11-17 00:38:13 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-11-22 21:23:42 +00:00
|
|
|
file "./lib/java/gson.jar" => ["./tmp/google-gson-#{GSONV}", './lib/java'] do |t|
|
|
|
|
sh "cp ./tmp/google-gson-#{GSONV}/gson-#{GSONV}.jar #{t.name}"
|
|
|
|
end
|
|
|
|
|
|
|
|
file "./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz" => ['./tmp'] do |t|
|
|
|
|
sh "curl -s -o #{t.name} " <<
|
|
|
|
"#{RMQ_URI_BASE}/v#{RMQV}/rabbitmq-java-client-bin-#{RMQV}.tar.gz"
|
|
|
|
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
|
2012-11-17 00:38:13 +00:00
|
|
|
Dir.chdir('./tmp') do
|
2012-11-22 21:23:42 +00:00
|
|
|
sh "tar xzf rabbitmq-java-client-bin-#{RMQV}.tar.gz"
|
2012-11-17 00:38:13 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-11-17 01:25:44 +00:00
|
|
|
file './lib/java/rabbitmq-client.jar' =>
|
2012-11-22 21:23:42 +00:00
|
|
|
["./tmp/rabbitmq-java-client-bin-#{RMQV}/rabbitmq-client.jar", './lib/java'] do
|
|
|
|
sh "cp ./tmp/rabbitmq-java-client-bin-#{RMQV}/rabbitmq-client.jar ./lib/java/"
|
2012-11-17 00:38:13 +00:00
|
|
|
end
|
|
|
|
|
2012-11-22 21:23:42 +00:00
|
|
|
desc 'Do everything to set up the things'
|
|
|
|
task :setup => ['./lib/java/rabbitmq-client.jar', './lib/java/gson.jar']
|
2012-11-17 00:38:13 +00:00
|
|
|
|
2012-11-22 21:23:42 +00:00
|
|
|
task :default => :setup
|