How to call Ant scripts

To call an Ant script from Buildr, simply call Ant's main method using the Ruby-Java bridge (RJB):

define "my-project" do

 task :call_ant do
   p 'calling ant..'
   Java.org.apache.tools.ant.Main.main( ['-file', 'build.xml', 'my-target'] )
 end
end

And from the command-line you can call this task directly:

buildr my-project:call_ant
  • No labels