Browse Source

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
master
Conor MacNeill 24 years ago
parent
commit
13ccc6a803
1 changed files with 16 additions and 0 deletions
  1. +16
    -0
      src/script/ant.bat

+ 16
- 0
src/script/ant.bat View File

@@ -87,6 +87,7 @@ echo to the installation directory of java.
echo. echo.


:checkJikes :checkJikes
set ANT_ERROR=no
if not "%JIKESPATH%" == "" goto runAntWithJikes if not "%JIKESPATH%" == "" goto runAntWithJikes


:runAnt :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% "%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" -Djikes.class.path="%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%


:end :end
if errorlevel 1 set ANT_ERROR=yes
set LOCALCLASSPATH= set LOCALCLASSPATH=
set _JAVACMD= set _JAVACMD=
set ANT_CMD_LINE_ARGS= set ANT_CMD_LINE_ARGS=


if not "%OS%"=="Windows_NT" goto mainEnd if not "%OS%"=="Windows_NT" goto mainEnd

:winNTend :winNTend
if %ANT_ERROR% == yes goto winNTError

:winNTOK
@endlocal @endlocal
set ANT_ERROR=no
goto :mainEnd

:winNTError
@endlocal
set ANT_ERROR=yes
goto :mainEnd


:mainEnd :mainEnd
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat" if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
if %ANT_ERROR%=="yes" exit 1




Loading…
Cancel
Save