box-o-sand/sylvilagus/jruby/Rakefile
Dan Buch 4b81b14358 Stubbing in jruby version
mostly to get used to jruby, I suppose, but I need to know how to use
the official rabbitmq java client in this context, too.
2012-11-16 19:38:13 -05:00

29 lines
888 B
Ruby

require 'open-uri'
directory './tmp'
file './tmp/rabbitmq-java-client-bin-2.8.7.tar.gz' => ['./tmp'] do |f|
open('http://www.rabbitmq.com/releases/rabbitmq-java-client/v2.8.7/rabbitmq-java-client-bin-2.8.7.tar.gz') do |f|
open('./tmp/rabbitmq-java-client-bin.tar.gz', 'w') do |out|
out.write(f.read)
end
end
end
file './tmp/rabbitmq-java-client-bin-2.8.7' => ['./tmp/rabbitmq-java-client-bin-2.8.7.tar.gz'] do
Dir.chdir('./tmp') do
`tar xzvf rabbitmq-java-client-bin.tar.gz`
end
end
file './lib/java/rabbitmq-client.jar' => ['./tmp/rabbitmq-java-client-bin-2.8.7'] do
Dir['./tmp/rabbitmq-java-client-bin-2.8.7/*.jar'].each do |jar|
FileUtils.mv(jar, './lib/java', :verbose => true)
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]