Browse Source

Fixed errors wrt

* 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-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
99f86d5034
5 changed files with 29 additions and 33 deletions
  1. +5
    -5
      build.bat
  2. +7
    -2
      build.sh
  3. +10
    -3
      build.xml
  4. +7
    -21
      src/main/org/apache/tools/ant/Main.java
  5. +0
    -2
      src/main/org/apache/tools/ant/version.txt

+ 5
- 5
build.bat View File

@@ -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=

+ 7
- 2
build.sh View File

@@ -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 $*





+ 10
- 3
build.xml View File

@@ -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"/>


+ 7
- 21
src/main/org/apache/tools/ant/Main.java View File

@@ -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();
} }


/** /**


+ 0
- 2
src/main/org/apache/tools/ant/version.txt View File

@@ -1,2 +0,0 @@
VERSION=@VERSION@
DATE=@DATE@

Loading…
Cancel
Save