diff --git a/docs/manual/running.html b/docs/manual/running.html
index 1d6479e8e..bc6237e22 100644
--- a/docs/manual/running.html
+++ b/docs/manual/running.html
@@ -106,12 +106,16 @@ during the execution of Ant. See the next section for example.
set):
- JAVACMD
full path of the Java executable. Use this
+ JAVACMD
- full path of the Java executable. Use this
to invoke a different JVM than JAVA_HOME/bin/java(.exe)
.
- ANT_OPTS
command line arguments that should be
- passed to the JVM - for example, you can define properties or set
+ ANT_OPTS
- command-line arguments that should be
+ passed to the JVM. For example, you can define properties or set
the maximum Java heap size here.
+
+ ANT_ARGS
- Ant command-line arguments. For example,
+ set ANT_ARGS
to point to a different logger and to
+ include the -find
flag.
Running Ant by Hand
diff --git a/src/script/ant b/src/script/ant
index 365f90049..cb3bb5137 100644
--- a/src/script/ant
+++ b/src/script/ant
@@ -131,4 +131,4 @@ if $cygwin; then
LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
fi
-$JAVACMD -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main "$@"
+$JAVACMD -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"
diff --git a/src/script/ant.bat b/src/script/ant.bat
index 81a2835be..261cf1ef5 100755
--- a/src/script/ant.bat
+++ b/src/script/ant.bat
@@ -90,11 +90,11 @@ echo.
if not "%JIKESPATH%" == "" goto runAntWithJikes
:runAnt
-"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
+"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS%
goto end
:runAntWithJikes
-"%_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_ARGS% %ANT_CMD_LINE_ARGS%
:end
set LOCALCLASSPATH=
diff --git a/src/script/runant.pl b/src/script/runant.pl
index a2cc523e7..9535cfa7f 100644
--- a/src/script/runant.pl
+++ b/src/script/runant.pl
@@ -55,7 +55,7 @@ $JAVACMD = "java" if $JAVACMD eq "";
#and perl is not too hot at hinting which box it is on.
#here I assume ":" 'cept on win32 and dos. Add extra tests here as needed.
my $s=":";
-if(($^O eq "MSWin32") || ($^O eq "dos"))
+if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin"))
{
$s=";";
}
@@ -101,19 +101,21 @@ else
"to the installation directory of java\n";
}
+#set JVM options and Ant arguments, if any
+my @ANT_OPTS=split(" ", $ENV{ANT_OPTS});
+my @ANT_ARGS=split(" ", $ENV{ANT_ARGS});
+
#jikes
-my @ANT_OPTS=split $ENV{ANT_OPTS};
if($ENV{JIKESPATH} ne "")
{
push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";
}
#construct arguments to java
-
my @ARGS;
push @ARGS, "-classpath", "$localpath", "-Dant.home=$HOME";
push @ARGS, @ANT_OPTS;
-push @ARGS, "org.apache.tools.ant.Main";
+push @ARGS, "org.apache.tools.ant.Main", @ANT_ARGS;
push @ARGS, @ARGV;
print "\n $JAVACMD @ARGS\n\n" if ($debug);