* junit not being on primordial classloader. * ANT_HOME being overidden * no install target * no version data git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268509 13f79535-47bb-0310-9956-ffa450edef68master
@@ -12,11 +12,9 @@ echo ---------------- | |||||
rem exit | rem exit | ||||
set LOCALCLASSPATH=build\classes | |||||
set LOCALCLASSPATH=lib\optional\junit.jar;build\classes | |||||
for %%i in (lib\*.jar) do call src\script\lcp.bat %%i | for %%i in (lib\*.jar) do call src\script\lcp.bat %%i | ||||
set ANT_HOME=. | |||||
if "%JAVA_HOME%" == "" goto noJavaHome | if "%JAVA_HOME%" == "" goto noJavaHome | ||||
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java | if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java | ||||
if exist "%JAVA_HOME%\lib\tools.jar" call src\script\lcp.bat "%JAVA_HOME%\lib\tools.jar" | if exist "%JAVA_HOME%\lib\tools.jar" call src\script\lcp.bat "%JAVA_HOME%\lib\tools.jar" | ||||
@@ -33,9 +31,11 @@ echo to the installation directory of java. | |||||
echo. | echo. | ||||
:runAnt | :runAnt | ||||
set NEW_ANT_HOME=%ANT_HOME% | |||||
if "x%ANT_HOME%" == "x" set NEW_ANT_HOME=dist | |||||
set CLASSPATH=%LOCALCLASSPATH% | set CLASSPATH=%LOCALCLASSPATH% | ||||
set LOCALCLASSPATH= | set LOCALCLASSPATH= | ||||
%_JAVACMD% -classpath %CLASSPATH% %ANT_OPTS% org.apache.tools.ant.Main -logger org.apache.tools.ant.NoBannerLogger -emacs %1 %2 %3 %4 %5 %6 %7 %8 | |||||
%_JAVACMD% -classpath %CLASSPATH% %ANT_OPTS% org.apache.tools.ant.Main "-Dant.home=%NEW_ANT_HOME%" -logger org.apache.tools.ant.NoBannerLogger -emacs %1 %2 %3 %4 %5 %6 %7 %8 | |||||
set ANT_HOME= | |||||
set CLASSPATH= | set CLASSPATH= | ||||
set NEW_ANT_HOME= |
@@ -4,7 +4,6 @@ if test ! -f build\classes\org\apache\tools\ant\Main.class ; then | |||||
./bootstrap.sh $* | ./bootstrap.sh $* | ||||
fi | fi | ||||
# Cygwin support. $cygwin _must_ be set to either true or false. | # Cygwin support. $cygwin _must_ be set to either true or false. | ||||
case "`uname`" in | case "`uname`" in | ||||
CYGWIN*) cygwin=true ;; | CYGWIN*) cygwin=true ;; | ||||
@@ -20,6 +19,7 @@ if $cygwin; then | |||||
fi | fi | ||||
LOCALCLASSPATH=`echo lib/*.jar | tr ' ' ':'` | LOCALCLASSPATH=`echo lib/*.jar | tr ' ' ':'` | ||||
LOCALCLASSPATH=$LOCALCLASSPATH:build/classes:lib/optional/junit.jar | |||||
if [ "$CLASSPATH" != "" ] ; then | if [ "$CLASSPATH" != "" ] ; then | ||||
LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH | LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH | ||||
@@ -51,6 +51,11 @@ if $cygwin; then | |||||
LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` | LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` | ||||
fi | fi | ||||
${JAVA_HOME}/bin/java -classpath $LOCALCLASSPATH org.apache.tools.ant.Main -logger org.apache.tools.ant.NoBannerLogger -emacs $* | |||||
NEW_ANT_HOME=$ANT_HOME | |||||
if [ "$NEW_ANT_HOME" == "" ] ; then | |||||
NEW_ANT_HOME=dist | |||||
fi | |||||
${JAVA_HOME}/bin/java -classpath $LOCALCLASSPATH org.apache.tools.ant.Main -Dant.home=$NEW_ANT_HOME -logger org.apache.tools.ant.NoBannerLogger -emacs $* | |||||
@@ -193,10 +193,10 @@ | |||||
<fileset dir="${java.dir}"/> | <fileset dir="${java.dir}"/> | ||||
</copy> | </copy> | ||||
<replace file="${build.src}/org/apache/tools/ant/version.txt" | |||||
<replace file="${build.src}/org/apache/tools/ant/Main.java" | |||||
token="@VERSION@" | token="@VERSION@" | ||||
value="${version}"/> | value="${version}"/> | ||||
<replace file="${build.src}/org/apache/tools/ant/version.txt" | |||||
<replace file="${build.src}/org/apache/tools/ant/Main.java" | |||||
token="@DATE@" | token="@DATE@" | ||||
value="${date}"/> | value="${date}"/> | ||||
<replace file="${build.src}/org/apache/tools/ant/defaultManifest.mf" | <replace file="${build.src}/org/apache/tools/ant/defaultManifest.mf" | ||||
@@ -446,6 +446,12 @@ | |||||
<delete dir="${dist.name}" /> | <delete dir="${dist.name}" /> | ||||
</target> | </target> | ||||
<target name="install"> | |||||
<antcall target="dist-lite"> | |||||
<param name="dist.dir" value="${ant.home}" /> | |||||
</antcall> | |||||
</target> | |||||
<!-- | <!-- | ||||
=================================================================== | =================================================================== | ||||
Cleans up build and distribution directories | Cleans up build and distribution directories | ||||
@@ -509,6 +515,7 @@ | |||||
=================================================================== | =================================================================== | ||||
--> | --> | ||||
<target name="run-tests" depends="compile-tests, define-junit" if="junit.present"> | <target name="run-tests" depends="compile-tests, define-junit" if="junit.present"> | ||||
<junit printsummary="no" haltonfailure="yes" fork="${junit.fork}"> | <junit printsummary="no" haltonfailure="yes" fork="${junit.fork}"> | ||||
<jvmarg value="-classic"/> | <jvmarg value="-classic"/> | ||||
<classpath refid="tests-classpath"/> | <classpath refid="tests-classpath"/> | ||||
@@ -547,7 +554,7 @@ | |||||
<delete file="${tests.dir}/taskdefs/tmp.jar" /> | <delete file="${tests.dir}/taskdefs/tmp.jar" /> | ||||
</target> | </target> | ||||
<target name="run-single-test" if="testcase, define-junit" depends="compile-tests"> | |||||
<target name="run-single-test" if="testcase" depends="compile-tests, define-junit"> | |||||
<junit printsummary="no" haltonfailure="yes" fork="${junit.fork}"> | <junit printsummary="no" haltonfailure="yes" fork="${junit.fork}"> | ||||
<jvmarg value="-classic"/> | <jvmarg value="-classic"/> | ||||
@@ -72,6 +72,11 @@ import java.util.*; | |||||
public class Main { | public class Main { | ||||
public final static String VERSION = "@VERSION@"; | |||||
public final static String DATE = "@DATE@"; | |||||
public final static String BANNER = | |||||
"Ant version " + DATE + " compiled on " + DATE; | |||||
/** The default build file name */ | /** The default build file name */ | ||||
public static final String DEFAULT_BUILD_FILENAME = "build.xml"; | public static final String DEFAULT_BUILD_FILENAME = "build.xml"; | ||||
@@ -510,27 +515,8 @@ public class Main { | |||||
} | } | ||||
private static void printVersion() { | private static void printVersion() { | ||||
try { | |||||
Properties props = new Properties(); | |||||
InputStream in = | |||||
Main.class.getResourceAsStream("/org/apache/tools/ant/version.txt"); | |||||
props.load(in); | |||||
in.close(); | |||||
String lSep = System.getProperty("line.separator"); | |||||
StringBuffer msg = new StringBuffer(); | |||||
msg.append("Ant version "); | |||||
msg.append(props.getProperty("VERSION")); | |||||
msg.append(" compiled on "); | |||||
msg.append(props.getProperty("DATE")); | |||||
msg.append(lSep); | |||||
System.out.println(msg.toString()); | |||||
} catch (IOException ioe) { | |||||
System.err.println("Could not load the version information."); | |||||
System.err.println(ioe.getMessage()); | |||||
} catch (NullPointerException npe) { | |||||
System.err.println("Could not load the version information."); | |||||
} | |||||
System.out.println( BANNER ); | |||||
System.out.println(); | |||||
} | } | ||||
/** | /** | ||||
@@ -1,2 +0,0 @@ | |||||
VERSION=@VERSION@ | |||||
DATE=@DATE@ |