box-o-sand/oldstuff/sylvilagus/jruby/Rakefile

44 lines
1.4 KiB
Ruby
Raw Normal View History

RMQ_URI_BASE = 'http://www.rabbitmq.com/releases/rabbitmq-java-client'
RMQV = '2.8.7'
GSONV = '2.2.2'
directory './tmp'
directory './lib/java'
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"
end
end
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
file "./tmp/rabbitmq-java-client-bin-#{RMQV}/rabbitmq-client.jar" =>
["./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz"] do
Dir.chdir('./tmp') do
sh "tar xzf rabbitmq-java-client-bin-#{RMQV}.tar.gz"
end
end
file './lib/java/rabbitmq-client.jar' =>
["./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/"
end
desc 'Do everything to set up the things'
task :setup => ['./lib/java/rabbitmq-client.jar', './lib/java/gson.jar']
task :default => :setup