From 13ccc6a803a5723b53abcee93e5501a770b6be6f Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Sat, 21 Jul 2001 13:03:19 +0000 Subject: [PATCH] Add exit code to batch files PR: 314 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269369 13f79535-47bb-0310-9956-ffa450edef68 --- src/script/ant.bat | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/script/ant.bat b/src/script/ant.bat index 81a2835be..a913fb75f 100755 --- a/src/script/ant.bat +++ b/src/script/ant.bat @@ -87,6 +87,7 @@ echo to the installation directory of java. echo. :checkJikes +set ANT_ERROR=no if not "%JIKESPATH%" == "" goto runAntWithJikes :runAnt @@ -97,14 +98,29 @@ goto end "%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" -Djikes.class.path="%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% :end +if errorlevel 1 set ANT_ERROR=yes set LOCALCLASSPATH= set _JAVACMD= set ANT_CMD_LINE_ARGS= if not "%OS%"=="Windows_NT" goto mainEnd + :winNTend +if %ANT_ERROR% == yes goto winNTError + +:winNTOK @endlocal +set ANT_ERROR=no +goto :mainEnd + +:winNTError +@endlocal +set ANT_ERROR=yes +goto :mainEnd :mainEnd if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat" +if %ANT_ERROR%=="yes" exit 1 + +