You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Ed O'Loughlin <yu...@snkmail.com> on 2013/01/22 13:05:20 UTC

Buildr exits after when Ant task completes

Hi,

I'm using buildr to wrap the generation of a library (
http://jspeex.sourceforge.net/), which uses Ant as its own build tool. I
use

  Java.org.apache.tools.ant.Main.main(['-file', 'build.xml', 'package'])

To run the 'package' target in the Ant project. This completes but buildr
exits with a zero exit code after running this line. Nothing that follows
this in my buildfile is executed.

Any ideas?

Thanks,
Ed O'Loughlin

Re: Buildr exits after when Ant task completes

Posted by Alex Boisvert <al...@gmail.com>.
Looking quickly at the Ant Main source code reveals it's using
System.exit() and therefore killing the JVM upon exit.
https://github.com/apache/ant/blob/trunk/src/main/org/apache/tools/ant/Main.java

You may have to either subclass Main and override the exit() method or fork
the process to execute ant.

e.g.  java('org.apache.tools.ant.Main', '-file', 'build.xml',
'package', :classpath
=> Ant.dependencies)

alex

On Tue, Jan 22, 2013 at 4:05 AM, Ed O'Loughlin <yu...@snkmail.com>wrote:

> Hi,
>
> I'm using buildr to wrap the generation of a library (
> http://jspeex.sourceforge.net/), which uses Ant as its own build tool. I
> use
>
>   Java.org.apache.tools.ant.Main.main(['-file', 'build.xml', 'package'])
>
> To run the 'package' target in the Ant project. This completes but buildr
> exits with a zero exit code after running this line. Nothing that follows
> this in my buildfile is executed.
>
> Any ideas?
>
> Thanks,
> Ed O'Loughlin
>