ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: "If Ant fails, it will return a non-zero exit code" - doesn't hold any more ?
Date Wed, 17 Dec 2003 06:19:43 GMT
Evegny
You can call cmd.exe and send along the command line parms of the batch file
(and get all of the env vars set properly)
OR you can call the perl script I mentioned earlier
Your choice
Shalom,
Martin

----- Original Message ----- 
From: "Evgeny Goldin" <geniek@netvision.net.il>
To: "Ant Users List" <user@ant.apache.org>
Sent: Tuesday, December 16, 2003 11:12 AM
Subject: Re: "If Ant fails, it will return a non-zero exit code" - doesn't
hold any more ?


>
> EG> It's being said on this list that "If Ant fails, it will return a
non-zero exit
> EG> code". Unfortunately, it doesn't work for me:
>
> Taking a look on ant.bat I see:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> :runAnt
> "%_JAVACMD%" %ANT_OPTS% -classpath "%LOCALCLASSPATH%"
"-Dant.home=%ANT_HOME%" org.apache.tools.ant.Main %ANT_ARGS%
%ANT_CMD_LINE_ARGS%
> goto end
>
> :runAntWithJikes
> "%_JAVACMD%" %ANT_OPTS% -classpath "%LOCALCLASSPATH%"
"-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%"
org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS%
> goto end
>
> :end
> set LOCALCLASSPATH=
> set _JAVACMD=
> set ANT_CMD_LINE_ARGS=
>
> if "%OS%"=="Windows_NT" @endlocal
>
> :mainEnd
> if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> So my thought is following: since running Java isn't the latest operation
in
> the batch file - all following operations simply overwrite the exit code
of java
> process which is indeed 1 when it fails. But since following operations do
succeed -
> what is finally returned to the outside world is *their* exit code, not
java's
> (never was a batch-files pro, so this is only a guess).
>
> After I removed everything after first "%_JAVACMD%" in :runAnt label (to
make sure
> "%_JAVACMD%" is the latest operation executed) - the exit code I received
from running
> 'ant' has become 1 for failed projects.
>
> That's weird ... Did nobody notice this behavior before ?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message