ant-user mailing list archives

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

> -----Original Message-----
> From: Steve Loughran [mailto:stevel@apache.org] 

> >>
> >>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 org.apache.tools.ant.Main 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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message