ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen McConnell" <>
Subject RE: AW: ant return status
Date Sat, 17 Dec 2005 03:29:16 GMT

> -----Original Message-----
> From: Steve Loughran [] 

> >>
> >>The ant commandline script under windows (NT/XP/etc.) 
> >>returns either 0 or 1.
> >>A zero value indicates that the build was successful.  A value of 1 
> >>indicates an error. Under Windows you can use the 
> >>ERRORLEVEL variable to test the result of invoking ant.
> >>For example:
> I'm not sure that ant.bat does this, for backwards compat with win98. 
> The perl and python runant scripts work though.

The error status is established in the value passed to System.exit( int )
which is handled in the class startAnt method.
The JVM establishes the ERRORLEVEL on exit before returning to the script -
in other words - the ant.bat file doesn't need to handle this - however - if
you have a bat file that invokes a series of ant builds you can trap success
(or failure) using ERRORLEVEL and handle things like early exit. 

Cheers, Steve.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message