ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgeny Goldin <gen...@netvision.net.il>
Subject Re: "If Ant fails, it will return a non-zero exit code" - doesn't hold any more ?
Date Wed, 17 Dec 2003 17:40:35 GMT

MG> You can call cmd.exe and send along the command line parms of the batch file
MG> (and get all of the env vars set properly)
MG> OR you can call the perl script I mentioned earlier

I ended up with the following code (in fact, it was surprisingly simple to save
the java process exit code in variable and exit with it later on):

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%JAVA_HOME%\jre\bin\java ... org.apache.tools.ant.Main
set exit_code=%ERRORLEVEL%

... // some more commands

exit /b %exit_code%
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If such a code was used in original ant.bat - it's exit code returned to the
outside world was indeed 1 for the failed projects.

P.S.
DOS manual to the rescue !

"DOS Batch Language: A personal view"
http://gearbox.maem.umr.edu/~batch/batchtoc.htm
http://gearbox.maem.umr.edu/~batch/variable.htm
http://gearbox.maem.umr.edu/~batch/intrin1.htm#ifer




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message