using a different logger or including the -find flag. (runant.pl, also add a check for cygwin for path separator, fix ANT_OPTS.) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269797 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -106,12 +106,16 @@ during the execution of Ant. See the next section for example.</p> | |||||
| set):</p> | set):</p> | ||||
| <ul> | <ul> | ||||
| <li><code>JAVACMD</code> full path of the Java executable. Use this | |||||
| <li><code>JAVACMD</code> - full path of the Java executable. Use this | |||||
| to invoke a different JVM than <code>JAVA_HOME/bin/java(.exe)</code>.</li> | to invoke a different JVM than <code>JAVA_HOME/bin/java(.exe)</code>.</li> | ||||
| <li><code>ANT_OPTS</code> command line arguments that should be | |||||
| passed to the JVM - for example, you can define properties or set | |||||
| <li><code>ANT_OPTS</code> - command-line arguments that should be | |||||
| passed to the JVM. For example, you can define properties or set | |||||
| the maximum Java heap size here.</li> | the maximum Java heap size here.</li> | ||||
| <li><code>ANT_ARGS</code> - Ant command-line arguments. For example, | |||||
| set <code>ANT_ARGS</code> to point to a different logger and to | |||||
| include the <code>-find</code> flag.</li> | |||||
| </ul> | </ul> | ||||
| <h2>Running Ant by Hand</h2> | <h2>Running Ant by Hand</h2> | ||||
| @@ -131,4 +131,4 @@ if $cygwin; then | |||||
| LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` | LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` | ||||
| fi | 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 "$@" | |||||
| @@ -90,11 +90,11 @@ 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 %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 | goto end | ||||
| :runAntWithJikes | :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 | :end | ||||
| set LOCALCLASSPATH= | set LOCALCLASSPATH= | ||||
| @@ -55,7 +55,7 @@ $JAVACMD = "java" if $JAVACMD eq ""; | |||||
| #and perl is not too hot at hinting which box it is on. | #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. | #here I assume ":" 'cept on win32 and dos. Add extra tests here as needed. | ||||
| my $s=":"; | my $s=":"; | ||||
| if(($^O eq "MSWin32") || ($^O eq "dos")) | |||||
| if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin")) | |||||
| { | { | ||||
| $s=";"; | $s=";"; | ||||
| } | } | ||||
| @@ -101,19 +101,21 @@ else | |||||
| "to the installation directory of java\n"; | "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 | #jikes | ||||
| my @ANT_OPTS=split $ENV{ANT_OPTS}; | |||||
| if($ENV{JIKESPATH} ne "") | if($ENV{JIKESPATH} ne "") | ||||
| { | { | ||||
| push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}"; | push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}"; | ||||
| } | } | ||||
| #construct arguments to java | #construct arguments to java | ||||
| my @ARGS; | my @ARGS; | ||||
| push @ARGS, "-classpath", "$localpath", "-Dant.home=$HOME"; | push @ARGS, "-classpath", "$localpath", "-Dant.home=$HOME"; | ||||
| push @ARGS, @ANT_OPTS; | push @ARGS, @ANT_OPTS; | ||||
| push @ARGS, "org.apache.tools.ant.Main"; | |||||
| push @ARGS, "org.apache.tools.ant.Main", @ANT_ARGS; | |||||
| push @ARGS, @ARGV; | push @ARGS, @ARGV; | ||||
| print "\n $JAVACMD @ARGS\n\n" if ($debug); | print "\n $JAVACMD @ARGS\n\n" if ($debug); | ||||