Browse Source

Allow an arbitrary number of arguments to be passed to Ant - even on Win98.

Submitted by:	Glenn McAllister <glennm@ca.ibm.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267971 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
76e7f15fd2
1 changed files with 19 additions and 2 deletions
  1. +19
    -2
      src/bin/ant.bat

+ 19
- 2
src/bin/ant.bat View File

@@ -1,4 +1,20 @@
@echo off @echo off

rem Slurp the command line arguments. This loop allows for an unlimited number of
rem agruments (up to the command line limit, anyway).

set ANT_CMD_LINE_ARGS=

:setupArgs
if %1a==a goto doneArgs
set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
shift
goto setupArgs

:doneArgs
rem The doneArgs label is here just to provide a place for the argument list loop
rem to break out to.

rem find ANT_HOME rem find ANT_HOME
if not "%ANT_HOME%"=="" goto checkJava if not "%ANT_HOME%"=="" goto checkJava


@@ -40,12 +56,13 @@ echo.
if not "%JIKESPATH%" == "" goto runAntWithJikes if not "%JIKESPATH%" == "" goto runAntWithJikes


:runAnt :runAnt
%JAVACMD% -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
%JAVACMD% -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
goto end goto end


:runAntWithJikes :runAntWithJikes
%JAVACMD% -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" -Djikes.class.path=%JIKESPATH% %ANT_OPTS% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
%JAVACMD% -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" -Djikes.class.path=%JIKESPATH% %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%


:end :end
set LOCALCLASSPATH= set LOCALCLASSPATH=
set ANT_CMD_LINE_ARGS=



Loading…
Cancel
Save