Browse Source

Checked in alpha version of new build system.

May not fully build on *nix platforms yet.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268504 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
27491607d8
16 changed files with 476 additions and 575 deletions
  1. +2
    -1
      .cvsignore
  2. +15
    -23
      bootstrap.bat
  3. +41
    -57
      bootstrap.sh
  4. +35
    -13
      build.bat
  5. +48
    -8
      build.sh
  6. +334
    -472
      build.xml
  7. BIN
      lib/core/junit.jar
  8. +0
    -0
      lib/jaxp.jar
  9. +0
    -0
      lib/optional/README
  10. +0
    -0
      lib/parser.jar
  11. +0
    -0
      src/script/ant
  12. +1
    -1
      src/script/ant.bat
  13. +0
    -0
      src/script/antRun
  14. +0
    -0
      src/script/antRun.bat
  15. +0
    -0
      src/script/lcp.bat
  16. +0
    -0
      src/script/runant.pl

+ 2
- 1
.cvsignore View File

@@ -1,5 +1,6 @@
.ant.properties
bin
dist
build
prj.el
emacs-jprj.el
bootstrap.bat.pif


+ 15
- 23
bootstrap.bat View File

@@ -18,33 +18,29 @@ if "" == "%JAVAC%" set JAVAC=%JAVA_HOME%\bin\javac
echo.
echo ... Bootstrapping Ant Distribution

if exist lib\ant.jar erase lib\ant.jar
SET CLASSDIR=build\classes
SET LOCALCLASSPATH=lib\parser.jar;lib\jaxp.jar

SET LOCALCLASSPATH=
for %%i in (lib\core\*.jar) do call src\bin\lcp.bat %%i

if exist %JAVA_HOME%\lib\tools.jar call src\bin\lcp.bat %JAVA_HOME%\lib\tools.jar
if exist %JAVA_HOME%\lib\classes.zip call src\bin\lcp.bat %JAVA_HOME%\lib\classes.zip

set TOOLS=src\main\org\apache\tools
set CLASSDIR=classes

SET CLASSPATH=%LOCALCLASSPATH%;%CLASSDIR%;src\main;%CLASSPATH%
if exist %JAVA_HOME%\lib\tools.jar call src\script\lcp.bat %JAVA_HOME%\lib\tools.jar
if exist %JAVA_HOME%\lib\classes.zip call src\script\lcp.bat %JAVA_HOME%\lib\classes.zip

echo JAVA_HOME=%JAVA_HOME%
echo JAVA=%JAVA%
echo JAVAC=%JAVAC%
echo CLASSPATH=%CLASSPATH%
echo CLASSPATH=%LOCALCLASSPATH%

if "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul rmdir/s/q %CLASSDIR%
if not "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul deltree/y %CLASSDIR%
if "%OS%" == "Windows_NT" if exist build rmdir/s/q build
if not "%OS%" == "Windows_NT" deltree/y build

mkdir %CLASSDIR%
mkdir build
mkdir build\classes

echo.
echo ... Compiling Ant Classes

%JAVAC% -d %CLASSDIR% %TOOLS%\tar\*.java %TOOLS%\ant\*.java %TOOLS%\ant\types\*.java %TOOLS%\ant\taskdefs\*.java %TOOLS%\ant\util\*.java %TOOLS%\ant\util\regexp\RegexpMatcher.java %TOOLS%\ant\util\regexp\RegexpMatcherFactory.java
SET TOOLS=src\main\org\apache\tools

%JAVAC% -classpath %LOCALCLASSPATH%;src\main -d build\classes %TOOLS%\tar\*.java %TOOLS%\ant\*.java %TOOLS%\ant\types\*.java %TOOLS%\ant\taskdefs\*.java %TOOLS%\ant\util\*.java %TOOLS%\ant\util\regexp\RegexpMatcher.java %TOOLS%\ant\util\regexp\RegexpMatcherFactory.java

echo.
echo ... Copying Required Files
@@ -55,13 +51,8 @@ copy %TOOLS%\ant\types\*.properties %CLASSDIR%\org\apache\tools\ant\types
echo.
echo ... Building Ant Distribution

%JAVA% %ANT_OPTS% org.apache.tools.ant.Main clean main bootstrap %1 %2 %3 %4 %5

echo.
echo ... Cleaning Up Build Directories

if "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul rmdir/s/q %CLASSDIR%
if not "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul deltree/y %CLASSDIR%
SET CLASSPATH=%LOCALCLASSPATH%;build\classes
call build.bat

echo.
echo ... Done Bootstrapping Ant Distribution
@@ -73,6 +64,7 @@ set ANT_HOME=%OLDANTHOME%
set OLDJAVA=
set OLDJAVAC=
set OLDCLASSPATH=
set CLASSPATH=
set LOCALCLASSPATH=
set OLDANTHOME=
set TOOLS=


+ 41
- 57
bootstrap.sh View File

@@ -1,17 +1,35 @@
#!/bin/sh

# You will need to specify JAVA_HOME if compiling with 1.2 or later.
# Cygwin support. $cygwin _must_ be set to either true or false.
case "`uname`" in
CYGWIN*) cygwin=true ;;
*) cygwin=false ;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi

LOCALCLASSPATH=lib/parser.jar:lib/jaxp.jar

if [ "$CLASSPATH" != "" ] ; then
LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH
fi

if [ "$JAVA_HOME" != "" ] ; then
if [ -f $JAVA_HOME/lib/tools.jar ] ; then
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
if test -f $JAVA_HOME/lib/tools.jar ; then
LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
fi
if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip
if test -f $JAVA_HOME/lib/classes.zip ; then
LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip
fi
else
echo "Warning: JAVA_HOME environment variable not set."
echo "Warning: JAVA_HOME environment variable is not set."
echo " If build fails because sun.* classes could not be found"
echo " you will need to set the JAVA_HOME environment variable"
echo " to the installation directory of java."
@@ -23,63 +41,29 @@ if [ ! -x "$JAVA_HOME/bin/java" ] ; then
exit
fi

# More Cygwin support
if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi

ANT_HOME=.
export ANT_HOME

if [ -z "$JAVAC" ] ; then
JAVAC=${JAVA_HOME}/bin/javac;
fi

echo ... Bootstrapping Ant Distribution

if [ -f "lib/ant.jar" ] ; then
rm lib/ant.jar
fi
if [ -f "lib/optional.jar" ] ; then
rm lib/optional.jar
fi

# add in the dependency .jar files
DIRLIBS=${ANT_HOME}/lib/*.jar
for i in ${DIRLIBS}
do
# if the directory is empty, then it will return the input string
# this is stupid, so case for it
if [ "$i" != "${DIRLIBS}" ] ; then
CLASSPATH=$CLASSPATH:"$i"
fi
done
DIRCORELIBS=${ANT_HOME}/lib/core/*.jar
for i in ${DIRCORELIBS}
do
# if the directory is empty, then it will return the input string
# this is stupid, so case for it
if [ "$i" != "${DIRCORELIBS}" ] ; then
CLASSPATH=$CLASSPATH:"$i"
fi
done
rm -rf build

TOOLS=src/main/org/apache/tools
CLASSDIR=classes

CLASSPATH=${CLASSDIR}:src/main:${CLASSPATH}

# convert the unix path to windows
if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
fi

export CLASSPATH
CLASSDIR=build\classes

mkdir -p build
mkdir -p ${CLASSDIR}

echo ... Compiling Ant Classes

export CLASSPATH=$LOCALCLASSPATH:src/main

# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
fi

${JAVAC} -d ${CLASSDIR} ${TOOLS}/tar/*.java \
${TOOLS}/ant/util/regexp/RegexpMatcher.java \
${TOOLS}/ant/util/regexp/RegexpMatcherFactory.java \
@@ -95,13 +79,13 @@ cp src/main/org/apache/tools/ant/types/defaults.properties \

echo ... Building Ant Distribution

${JAVA_HOME}/bin/java -classpath ${CLASSPATH} org.apache.tools.ant.Main \
-buildfile build.xml clean main bootstrap
export CLASSPATH=$LOCALCLASSPATH:build/classes

echo ... Cleaning Up Build Directories

chmod +x bin/ant bin/antRun
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
fi

rm -rf ${CLASSDIR}
${JAVA_HOME}/bin/java -classpath ${CLASSPATH} org.apache.tools.ant.Main

echo ... Done Bootstrapping Ant Distribution

+ 35
- 13
build.bat View File

@@ -1,19 +1,41 @@
@echo off

set REALANTHOME=%ANT_HOME%
if exist build\classes\org\apache\tools\ant\Main.class goto doBuild

bootstrap.bat

:doBuild

echo ----------------
echo Ant Build System
echo ----------------

rem exit

set LOCALCLASSPATH=build\classes
for %%i in (lib\*.jar) do call src\script\lcp.bat %%i

set ANT_HOME=.
if exist lib\ant.jar if exist bin\ant.bat if exist bin\lcp.bat if exist bin\antRun.bat goto runAnt
call bootstrap.bat

:runAnt
if not "%REALANTHOME%" == "" goto install_ant
call .\bin\ant.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
goto cleanup
if "%JAVA_HOME%" == "" goto noJavaHome
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\classes.zip" call src\script\lcp.bat" "%JAVA_HOME%\lib\classes.zip"
goto runAnt

:install_ant
call .\bin\ant.bat -Dant.install="%REALANTHOME%" %1 %2 %3 %4 %5 %6 %7 %8 %9
:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java
echo.
echo Warning: JAVA_HOME environment variable is not set.
echo If build fails because sun.* classes could not be found
echo you will need to set the JAVA_HOME environment variable
echo to the installation directory of java.
echo.

:runAnt
set CLASSPATH=%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

rem clean up
:cleanup
set ANT_HOME=%REALANTHOME%
set REALANTHOME=
set ANT_HOME=
set CLASSPATH=

+ 48
- 8
build.sh View File

@@ -1,16 +1,56 @@
#!/bin/sh

REALANTHOME=$ANT_HOME
ANT_HOME=.
export ANT_HOME

if test ! -f lib/ant.jar -o ! -x bin/ant -o ! -x bin/antRun ; then
if test ! -f build\classes\org\apache\tools\ant\Main.class ; then
./bootstrap.sh
fi

if [ "$REALANTHOME" != "" ] ; then
ANT_INSTALL="-Dant.install $REALANTHOME"

# Cygwin support. $cygwin _must_ be set to either true or false.
case "`uname`" in
CYGWIN*) cygwin=true ;;
*) cygwin=false ;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi

LOCALCLASSPATH=`echo lib/*.jar | tr ' ' ':'`

if [ "$CLASSPATH" != "" ] ; then
LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH
fi

if [ "$JAVA_HOME" != "" ] ; then
if test -f $JAVA_HOME/lib/tools.jar ; then
LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
fi

if test -f $JAVA_HOME/lib/classes.zip ; then
LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip
fi
else
echo "Warning: JAVA_HOME environment variable is not set."
echo " If build fails because sun.* classes could not be found"
echo " you will need to set the JAVA_HOME environment variable"
echo " to the installation directory of java."
fi

if [ ! -x "$JAVA_HOME/bin/java" ] ; then
echo "Error: JAVA_HOME is not defined correctly."
echo " We cannot execute JAVA_HOME/bin/java"
exit
fi

bin/ant $ANT_INSTALL $*
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
fi

${JAVA_HOME}/bin/java -classpath $LOCALCLASSPATH org.apache.tools.ant.Main -logger org.apache.tools.ant.NoBannerLogger -emacs $*



+ 334
- 472
build.xml View File

@@ -1,60 +1,100 @@
<?xml version="1.0"?>

<!-- ======================================================================= -->
<!-- Ant own build file -->
<!-- ======================================================================= -->

<!--
=======================================================================
Ant own build file
=======================================================================
-->
<project name="Ant" default="main" basedir=".">

<!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it) -->
<property file="${user.home}/.ant.properties" />
<property file=".ant.properties" />
<property file="${user.home}/.ant.properties" />

<property name="Name" value="Ant"/>
<property name="name" value="ant"/>
<property name="version" value="1.3alpha"/>

<property name="ant.home" value="."/>
<property name="src.bin.dir" value="src/bin"/>
<property name="src.etc.dir" value="src/etc"/>
<property name="src.dir" value="src/main"/>
<property name="srclib.dir" value="lib"/>
<property name="src.tests.dir" value="src/testcases"/>
<property name="docs.dir" value="docs"/>
<property name="build.dir" value="../build/ant"/>
<property name="lib.dir" value="${build.dir}/lib"/>
<property name="bin.dir" value="${build.dir}/bin"/>
<property name="build.classes.core" value="${build.dir}/classes/core"/>
<property name="build.classes.optional" value="${build.dir}/classes/optional"/>
<!--
===================================================================
Set the properties for source directories
===================================================================
-->
<property name="src.base" value="src"/>
<property name="manifest.dir" value="${src.base}/manifest"/>
<property name="java.dir" value="${src.base}/main"/>
<property name="script.dir" value="${src.base}/script"/>
<property name="lib.dir" value="lib"/>

<!--
===================================================================
Set the properties for intermediate directory
===================================================================
-->
<property name="build.dir" value="build"/>
<property name="build.lib" value="${build.dir}/lib"/>
<property name="build.src" value="${build.dir}/src"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.javadocs" value="${build.dir}/javadocs"/>
<property name="build.docs" value="${build.dir}/docs"/>
<property name="build.tests" value="${build.dir}/testcases"/>
<property name="ant.dist.dir" value="../dist/ant"/>

<!--
===================================================================
Set the properties related dist target
===================================================================
-->
<property name="dist.name" value="${Name}-${version}"/>
<!-- <property name="dist.dir" value="${dist.name}"/> -->
<property name="dist.dir" value="dist"/>
<property name="dist.bin" value="${dist.dir}/bin"/>
<property name="dist.lib" value="${dist.dir}/lib"/>
<property name="dist.docs" value="${dist.dir}/docs"/>
<property name="dist.javadocs" value="${dist.dir}/docs/api"/>

<property name="java.dir" value="src/main"/>
<property name="docs.dir" value="docs"/>
<property name="tests.dir" value="src/testcases"/>

<path id="classpath">
<pathelement path="${java.class.path}"/>
<fileset dir="lib/optional">
<include name="*.jar"/>
<include name="*.zip"/>
</fileset>
</path>

<path id="tests-classpath">
<pathelement location="${build.classes}" />
<pathelement location="${build.tests}" />
<path refid="classpath" />
</path>

<property name="ant.package" value="org/apache/tools/ant"/>
<property name="optional.package" value="${ant.package}/taskdefs/optional"/>
<property name="packages" value="org.apache.tools.*"/>
<property name="manifest" value="src/etc/manifest"/>


<!-- =================================================================== -->
<!-- Set some the defaults the user can override in .ant.properties -->
<!-- =================================================================== -->
<property name="build.compiler"/>
<property name="build.compiler.emacs" value="on"/>
<property name="build.compiler.warnings" value="true"/>
<property name="build.compiler.depend" value="true"/>
<property name="build.compiler.fulldepend" value="true"/>

<property name="debug" value="false" />
<property name="deprecation" value="false" />
<property name="optimize" value="true" />
<property name="junit.fork" value="false" />
<property name="javac.optimize" value="true" />

<!-- =================================================================== -->
<!-- Define a global set of patterns that can be referenced by -->
<!-- its id attribute -->
<!-- =================================================================== -->
<patternset id="chmod.patterns">
<include name="**/ant" />
<include name="**/antRun" />
<include name="**/bootstrap.sh" />
<include name="**/build.sh" />
</patternset>
<!--
===================================================================
Main target
===================================================================
-->
<target name="main" depends="dist-lite" />

<!-- =================================================================== -->
<!-- Check to see what optional dependencies are available -->
@@ -62,159 +102,191 @@
<target name="check_for_optional_packages">
<available property="jdk1.2+" classname="java.lang.ThreadLocal" />
<available property="jdk1.3+" classname="java.lang.StrictMath" />
<available property="bsf.present" classname="com.ibm.bsf.BSFManager" />
<available property="netrexx.present" classname="netrexx.lang.Rexx" />
<available property="bsf.present"
classname="com.ibm.bsf.BSFManager"
classpathref="classpath" />
<available property="netrexx.present"
classname="netrexx.lang.Rexx"
classpathref="classpath" />
<available property="xslp.present"
classname="com.kvisco.xsl.XSLProcessor" />
classname="com.kvisco.xsl.XSLProcessor"
classpathref="classpath" />
<available property="trax.present"
classname="javax.xml.transform.Transformer" />
classname="javax.xml.transform.Transformer"
classpathref="classpath" />
<available property="xalan.present"
classname="org.apache.xalan.xslt.XSLTProcessorFactory" />
<available property="ejb.ejbc.present" classname="weblogic.ejbc" />
<available property="ejb.DDCreator.present" classname="weblogic.ejb.utils.DDCreator" />
<available property="ejb.wls.present" classname="weblogic.Server" />
<available property="junit.present" classname="junit.framework.TestCase" />
<available property="netcomp.present" classname="com.oroinc.net.ftp.FTPClient" />
<available property="starteam.present" classname="com.starbase.util.Platform" />
<available property="antlr.present" classname="antlr.Tool" />
<available property="vaj.present" classname="com.ibm.ivj.util.base.Workspace" />
<available property="stylebook.present" classname="org.apache.stylebook.Engine" />
<available property="jakarta.regexp.present" classname="org.apache.regexp.RE" />
<available property="jakarta.oro.present" classname="org.apache.oro.text.regex.Perl5Matcher" />
<available property="jmf.present" classname="javax.sound.sampled.Clip" />
classname="org.apache.xalan.xslt.XSLTProcessorFactory"
classpathref="classpath" />
<available property="ejb.ejbc.present"
classname="weblogic.ejbc"
classpathref="classpath" />
<available property="ejb.DDCreator.present"
classname="weblogic.ejb.utils.DDCreator"
classpathref="classpath" />
<available property="ejb.wls.present"
classname="weblogic.Server"
classpathref="classpath" />
<available property="junit.present"
classname="junit.framework.TestCase"
classpathref="classpath" />
<available property="netcomp.present"
classname="com.oroinc.net.ftp.FTPClient"
classpathref="classpath" />
<available property="starteam.present"
classname="com.starbase.util.Platform"
classpathref="classpath" />
<available property="antlr.present"
classname="antlr.Tool"
classpathref="classpath"/>
<available property="vaj.present"
classname="com.ibm.ivj.util.base.Workspace"
classpathref="classpath"/>
<available property="stylebook.present"
classname="org.apache.stylebook.Engine"
classpathref="classpath"/>
<available property="jakarta.regexp.present"
classname="org.apache.regexp.RE"
classpathref="classpath"/>
<available property="jakarta.oro.present"
classname="org.apache.oro.text.regex.Perl5Matcher"
classpathref="classpath" />
<available property="jmf.present"
classname="javax.sound.sampled.Clip"
classpathref="classpath"/>
</target>

<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare">
<mkdir dir="${build.dir}"/>
<!--
===================================================================
Prepares the build
===================================================================
-->
<target name="prepare" depends="check_for_optional_packages">
<tstamp />

<property name="version" value="${version}"/>
<property name="date" value="${TODAY}"/>

<mkdir dir="${build.dir}"/>
<mkdir dir="${build.src}"/>
<mkdir dir="${build.lib}"/>
<mkdir dir="${build.classes}"/>

<copy todir="${build.src}">
<fileset dir="${java.dir}"/>
</copy>

<replace file="${build.src}/org/apache/tools/ant/version.txt"
token="@VERSION@"
value="${version}"/>
<replace file="${build.src}/org/apache/tools/ant/version.txt"
token="@DATE@"
value="${date}"/>
<replace file="${build.src}/org/apache/tools/ant/defaultManifest.mf"
token="@VERSION@"
value="${version}"/>

</target>

<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile-core" depends="prepare,check_for_optional_packages">
<mkdir dir="${build.classes.core}"/>

<javac srcdir="${src.dir}"
destdir="${build.classes.core}"
debug="on"
deprecation="off"
optimize="${javac.optimize}" >
<!--
===================================================================
Compiles the source code
===================================================================
-->
<target name="compile" depends="prepare">

<javac srcdir="${build.src}"
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}" >
<classpath refid="classpath" />

<exclude name="org/apache/tools/ant/taskdefs/optional/**/*.java"/>
<exclude name="**/JakartaRegexpMatcher.java" unless="jakarta.regexp.present" />
<exclude name="**/JakartaOroMatcher.java" unless="jakarta.oro.present" />
<exclude name="${ant.package}/util/regexp/JakartaRegexpMatcher.java"
unless="jakarta.regexp.present" />
<exclude name="${ant.package}/util/regexp/JakartaOroMatcher.java"
unless="jakarta.oro.present" />
<exclude name="${optional.package}/Script.java" unless="bsf.present" />
<exclude name="${optional.package}/StyleBook.java" unless="stylebook.present" />
<exclude name="${optional.package}/NetRexxC.java" unless="netrexx.present" />
<exclude name="${optional.package}/XslpLiaison.java" unless="xslp.present" />
<exclude name="${optional.package}/XalanLiaison.java" unless="xalan.present" />
<exclude name="${optional.package}/TraXLiaison.java" unless="trax.present" />
<exclude name="${optional.package}/ejb/Ejbc*.java" unless="ejb.ejbc.present" />
<exclude name="${optional.package}/ejb/DDCreator*.java" unless="ejb.DDCreator.present" />
<exclude name="${optional.package}/ejb/WLRun.java" unless="ejb.wls.present" />
<exclude name="${optional.package}/ejb/WLStop.java" unless="ejb.wls.present" />
<exclude name="${optional.package}/ejb/EjbJar.java" unless="jdk1.2+" />
<exclude name="${optional.package}/ejb/*DeploymentTool.java" unless="jdk1.2+" />
<exclude name="${optional.package}/Javah.java" unless="jdk1.2+" />
<exclude name="${optional.package}/junit/*" unless="junit.present" />
<exclude name="${optional.package}/net/*.java" unless="netcomp.present" />
<exclude name="${optional.package}/scm/AntStarTeam*.java" unless="starteam.present" />
<exclude name="${optional.package}/ANTLR.java" unless="antlr.present" />
<exclude name="${optional.package}/ide/VAJ*.java" unless="vaj.present" />
<exclude name="${optional.package}/perforce/*.java" unless="jakarta.oro.present" />
<exclude name="${optional.package}/sound/*.java" unless="jmf.present" />
</javac>
<copy todir="${build.classes.core}">
<fileset dir="${src.dir}">
<include name="**/*.properties" />
</fileset>
</copy>

<filter token="VERSION" value="${version}" />
<filter token="DATE" value="${TODAY}" />
<filter token="TIME" value="${TSTAMP}" />
<copy todir="${build.classes.core}"
overwrite="true"
filtering="on">
<fileset dir="${src.dir}">
<include name="**/version.txt" />
<include name="**/defaultManifest.mf" />
</fileset>
</copy>
</target>

<target name="compile-optional" depends="compile-core">
<mkdir dir="${build.classes.optional}"/>

<javac srcdir="${src.dir}"
destdir="${build.classes.optional}"
debug="on"
deprecation="off"
optimize="${javac.optimize}" >
<classpath>
<path refid="classpath" />
<pathelement location="${build.classes.core}" />
</classpath>
<include name="org/apache/tools/ant/taskdefs/optional/**/*.java"/>
<exclude name="**/Script.java" unless="bsf.present" />
<exclude name="**/StyleBook.java" unless="stylebook.present" />
<exclude name="**/NetRexxC.java" unless="netrexx.present" />
<exclude name="**/XslpLiaison.java" unless="xslp.present" />
<exclude name="**/XalanLiaison.java" unless="xalan.present" />
<exclude name="**/TraXLiaison.java" unless="trax.present" />
<exclude name="**/Ejbc*.java" unless="ejb.ejbc.present" />
<exclude name="**/DDCreator*.java" unless="ejb.DDCreator.present" />
<exclude name="**/WLRun.java" unless="ejb.wls.present" />
<exclude name="**/WLStop.java" unless="ejb.wls.present" />
<exclude name="**/EjbJar.java" unless="jdk1.2+" />
<exclude name="**/*DeploymentTool.java" unless="jdk1.2+" />
<exclude name="**/Javah.java" unless="jdk1.2+" />
<exclude name="**/junit/*" unless="junit.present" />
<exclude name="**/net/*.java" unless="netcomp.present" />
<exclude name="**/AntStarTeam*.java" unless="starteam.present" />
<exclude name="**/ANTLR.java" unless="antlr.present" />
<exclude name="**/ide/VAJ*.java" unless="vaj.present" />
<exclude name="**/perforce/*.java" unless="jakarta.oro.present" />
<exclude name="org/apache/tools/ant/taskdefs/optional/sound/*.java"
unless="jmf.present" />
</javac>
<!--
===================================================================
Creates the lib directory including the ant jars, ant.jar and
optional.jar
===================================================================
-->
<target name="jars" depends="compile">

<jar jarfile="${build.lib}/${name}.jar" basedir="${build.classes}" manifest="${manifest}">
<exclude name="org/apache/tools/ant/taskdefs/optional/**" />
</jar>

<jar jarfile="${build.lib}/optional.jar" basedir="${build.classes}" manifest="${manifest}">
<include name="org/apache/tools/ant/taskdefs/optional/**" />
</jar>

</target>

<!-- =================================================================== -->
<!-- Creates the lib directory including the ant jars, ant.jar and -->
<!-- optional.jar -->
<!-- =================================================================== -->
<target name="jars" depends="compile-core, compile-optional">
<mkdir dir="${lib.dir}"/>
<jar jarfile="${lib.dir}/${name}.jar"
basedir="${build.classes.core}"
includes="org/**"
manifest="${manifest}"
/>
<jar jarfile="${lib.dir}/optional.jar"
basedir="${build.classes.optional}"
includes="org/**"
manifest="${manifest}"
/>
<copy todir="${lib.dir}">
<fileset dir="${srclib.dir}">
<include name="**/*.jar"/>
<exclude name="ant.jar"/>
</fileset>
<!--
===================================================================
Create the test build
===================================================================
-->
<target name="dist-lite" depends="jars">

<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.bin}"/>
<mkdir dir="${dist.lib}"/>

<copy todir="${dist.lib}">
<fileset dir="${build.lib}"/>
</copy>
<copy todir="${dist.bin}">
<fileset dir="${script.dir}/" />
</copy>
</target>

<!-- =================================================================== -->
<!-- Creates the binary structure -->
<!-- =================================================================== -->
<target name="main" depends="jars" description="Creates the binary structure">
<mkdir dir="${bin.dir}"/>
<copy todir="${bin.dir}">
<fileset dir="${src.bin.dir}"/>
</copy>
<chmod perm="+x">
<fileset dir="${bin.dir}">
<patternset refid="chmod.patterns"/>
<chmod dir="${dist.dir}" perm="go-rwx" />
<chmod perm="u+x">
<fileset dir="${dist.bin}">
<include name="**/ant" />
<include name="**/antRun" />
</fileset>
</chmod>
<fixcrlf srcdir="${bin.dir}" includes="ant,antRun" cr="remove"/>
<fixcrlf srcdir="${bin.dir}" includes="*.bat" cr="add"/>

<fixcrlf srcdir="${dist.dir}" cr="add" includes="**/*.bat" />
<fixcrlf srcdir="${dist.dir}" cr="remove" includes="**/*.sh" />
<fixcrlf srcdir="${dist.dir}" cr="remove" includes="ant" />

</target>

<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadocs" depends="prepare" description="Creates the API documentation">
<target name="javadocs" depends="prepare" description="Creates the API documentation" unless="foo">
<mkdir dir="${build.javadocs}"/>
<javadoc packagenames="${packages}"
sourcepath="${basedir}/${src.dir}"
<javadoc packagenames="org.apache.*"
sourcepath="${build.src}"
destdir="${build.javadocs}"
author="true"
version="true"
@@ -227,181 +299,120 @@
</javadoc>
</target>

<!-- =================================================================== -->
<!-- Creates the distribution -->
<!-- =================================================================== -->
<target name="dist" depends="main,jars,javadocs" description="Creates the distribution">
<mkdir dir="${ant.dist.dir}"/>
<mkdir dir="${ant.dist.dir}/bin"/>
<mkdir dir="${ant.dist.dir}/lib"/>
<mkdir dir="${ant.dist.dir}/docs"/>
<mkdir dir="${ant.dist.dir}/docs/api"/>
<mkdir dir="${ant.dist.dir}/src"/>

<copy todir="${ant.dist.dir}/src">
<fileset dir="${src.dir}"/>
</copy>
<copy todir="${ant.dist.dir}/lib">
<fileset dir="${lib.dir}"/>
</copy>

<copy file="build.xml" tofile="${ant.dist.dir}/lib/build.xml"/>
<copy todir="${ant.dist.dir}/bin">
<fileset dir="src/bin"/>
</copy>
<filter token="VERSION" value="${version}"/>
<copy todir="${ant.dist.dir}/docs" filtering="on">
<fileset dir="${docs.dir}"/>
</copy>
<copy todir="${ant.dist.dir}/docs/api">
<fileset dir="${build.javadocs}"/>
</copy>

<fixcrlf srcdir="${ant.dist.dir}/bin" includes="ant,antRun" cr="remove"/>
<fixcrlf srcdir="${ant.dist.dir}/bin" includes="*.bat" cr="add"/>
<chmod perm="+x">
<fileset dir="${ant.dist.dir}/bin">
<patternset refid="chmod.patterns"/>
</fileset>
</chmod>

<copy file="README" tofile="${ant.dist.dir}/README"/>
<copy file="WHATSNEW" tofile="${ant.dist.dir}/WHATSNEW"/>
<copy file="TODO" tofile="${ant.dist.dir}/TODO"/>
<copy file="LICENSE" tofile="${ant.dist.dir}/LICENSE"/>
</target>

<!-- =================================================================== -->
<!-- Packages the distribution with ZIP -->
<!-- =================================================================== -->
<target name="dist-zip" depends="dist">
<zip zipfile="${Name}-${version}.zip" basedir="${ant.dist.dir}" includes="**"/>
</target>

<!-- =================================================================== -->
<!-- Packages the distribution with TAR-GZIP -->
<!-- =================================================================== -->
<target name="dist-tgz" depends="dist">
<tar tarfile="${Name}-${version}.tar" basedir="${ant.dist.dir}" includes="**"/>
<gzip zipfile="${Name}-${version}.tar.gz" src="${Name}-${version}.tar"/>
</target>

<!-- =================================================================== -->
<!-- Installs the ant jars and binary files into ant.home -->
<!-- =================================================================== -->
<target name="bootstrap" depends="main" description="Installs the ant.jar library and binary files into ant.home">
<echo message="copying bootstrapped files into bin and lib"/>
<copy todir="lib">
<fileset dir="${lib.dir}"/>
</copy>
<copy todir="bin">
<fileset dir="${bin.dir}"/>
<!--
===================================================================
Create the distribution
===================================================================
-->
<target name="dist" depends="dist-lite,javadocs">
<mkdir dir="${dist.docs}"/>
<mkdir dir="${dist.javadocs}"/>

<copy todir="${dist.lib}">
<fileset dir="${lib.dir}">
<include name="*" />
</fileset>
</copy>
</target>

<target name="install" depends="dist" if="ant.install">
<echo message="installing full copy of ant into ${ant.install}"/>
<mkdir dir="${ant.install}"/>
<copy todir="${ant.install}">
<fileset dir="${ant.dist.dir}"/>
<copy todir="${dist.docs}">
<fileset dir="${docs.dir}"/>
</copy>
<chmod perm="+x">
<fileset dir="${ant.install}/bin">
<patternset refid="chmod.patterns"/>
</fileset>
</chmod>
</target>

<target name="fullinstall" depends="install"/>
<target name="mininstall" depends="main" if="ant.install">
<echo message="copying minimal ant installation into ${ant.install}"/>
<mkdir dir="${ant.install}"/>
<copy todir="${ant.install}/lib">
<fileset dir="${lib.dir}"/>
</copy>
<copy todir="${ant.install}/bin">
<fileset dir="${bin.dir}"/>
<!--
<copy todir="${dist.javadocs}">
<fileset dir="${build.javadocs}"/>
</copy>
<chmod perm="+x">
<fileset dir="${ant.install}/bin">
<patternset refid="chmod.patterns"/>
-->

<copy todir="${dist.dir}">
<fileset dir=".">
<include name="README"/>
<include name="LICENSE"/>
<include name="TODO"/>
<include name="WHATSNEW"/>
</fileset>
</chmod>
</target>

<!-- =================================================================== -->
<!-- Cleans up generated stuff -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${ant.dist.dir}"/>
<delete>
<fileset dir="." includes="**/*~" defaultexcludes="no"/>
</delete>
</target>

<!-- =================================================================== -->
<!-- Total cleanup -->
<!-- =================================================================== -->
<target name="total-clean" depends="clean">
<delete dir="${bin.dir}"/>
<delete file="${Name}-${version}.zip"/>
<delete file="${Name}-${version}.tar"/>
<delete file="${Name}-${version}.tar.gz"/>
</target>
</copy>

<!-- in progress ! (may not work) -->
<chmod dir="${dist.dir}" perm="go-rwx" />

<target name="get.snapshot">
<get src="http://jakarta.apache.org/build/tmp/ant/ant.src.zip" dest="ant-src.zip" />
<unzip src="ant-src.zip" dest="." />
<zip zipfile="${dist.name}.zip" basedir="${dist.dir}/.." includes="${dist.dir}/**"/>
<tar tarfile="${dist.name}.tar" basedir="${dist.dir}/.." includes="${dist.dir}/**"/>
<gzip zipfile="${dist.name}.tar.gz" src="${dist.name}.tar"/>
<delete file="${dist.name}.tar"/>
</target>

<target name="make.snapshot">
<cvs cvsRoot=":pserver:anoncvs@jakarta.apache.org:/home/cvspublic"
package="jakarta-ant"
dest="." />
<zip zipfile="/www/jakarta.apache.org/builds/tmp/ant/ant.src.zip" basedir="." includes="jakarta-ant/**"/>
<!--
===================================================================
Cleans up build and distribution directories
===================================================================
-->
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete>
<fileset dir="." includes="**/*~" defaultexcludes="no"/>
</delete>
</target>

<!--
===================================================================
Cleans absolutely everything up
===================================================================
-->
<target name="real-clean" depends="clean">
<delete dir="${docs.dir}" />
<delete file="${dist.name}.tar.gz" />
<delete file="${dist.name}.zip" />
</target>

<!-- =================================================================== -->
<!-- Compile testcases -->
<!-- =================================================================== -->
<target name="compiletests" depends="jars" if="junit.present">
<!--
===================================================================
Compile testcases
===================================================================
-->
<target name="compile-tests" depends="compile" if="junit.present">
<mkdir dir="${build.tests}"/>

<javac srcdir="${src.tests.dir}"
<javac srcdir="${tests.dir}"
destdir="${build.tests}"
debug="on"
deprecation="off" >
<classpath>
<pathelement location="${lib.dir}/${name}.jar" />
<path refid="classpath" />
</classpath>
<exclude name="org/apache/tools/ant/taskdefs/optional/ANTLRTest.java" unless="antlr.present" />
<exclude name="org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java" unless="jakarta.regexp.present" />
<exclude name="org/apache/tools/ant/util/regexp/JakartaOroMatcherTest.java" unless="jakarta.oro.present" />
debug="${debug}"
deprecation="${deprecation}" >
<classpath refid="tests-classpath" />

<exclude name="org/apache/tools/ant/taskdefs/optional/ANTLRTest.java"
unless="antlr.present" />
<exclude name="org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java"
unless="jakarta.regexp.present" />
<exclude name="org/apache/tools/ant/util/regexp/JakartaOroMatcherTest.java"
unless="jakarta.oro.present" />
</javac>
</target>
</target>

<!-- =================================================================== -->
<!-- Run testcase -->
<!-- =================================================================== -->
<target name="runtests" depends="compiletests" if="junit.present">
<!--
===================================================================
Run testcase
===================================================================
-->
<target name="define-junit" if="junit.present">
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
classpath="tests-classpath" />
</target>
<!--
===================================================================
Run testcase
===================================================================
-->
<target name="run-tests" depends="compile-tests, define-junit" if="junit.present">
<junit printsummary="no" haltonfailure="yes" fork="${junit.fork}">
<jvmarg value="-classic"/>
<classpath>
<pathelement location="${lib.dir}/${name}.jar" />
<pathelement location="${build.tests}" />
<path refid="classpath" />
<pathelement path="${java.class.path}" />
</classpath>
<classpath refid="tests-classpath"/>

<formatter type="plain" usefile="false" />

<batchtest>
<fileset dir="${src.tests.dir}">
<fileset dir="${tests.dir}">
<include name="**/*Test*" />
<!-- abstract class, not a testcase -->
<exclude name="org/apache/tools/ant/taskdefs/TaskdefsTest.java" />
@@ -412,10 +423,12 @@
<exclude name="org/apache/tools/ant/taskdefs/GzipTest.java" />

<!-- only run this test if ANTLR is installed -->
<exclude name="org/apache/tools/ant/taskdefs/optional/ANTLRTest.java" unless="antlr.present" />

<exclude name="org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java" unless="jakarta.regexp.present" />
<exclude name="org/apache/tools/ant/util/regexp/JakartaOroMatcherTest.java" unless="jakarta.oro.present" />
<exclude name="org/apache/tools/ant/taskdefs/optional/ANTLRTest.java"
unless="antlr.present" />
<exclude name="org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java"
unless="jakarta.regexp.present" />
<exclude name="org/apache/tools/ant/util/regexp/JakartaOroMatcherTest.java"
unless="jakarta.oro.present" />
</fileset>
</batchtest>

@@ -424,172 +437,21 @@
</junit>

<!-- clean up again -->
<delete dir="src/etc/testcases/taskdefs/optional/antlr/antlr.tmp" />
<delete dir="src/etc/testcases/taskdefs/taskdefs.tmp" />
<delete dir="src/etc/testcases/taskdefs.tmp" />
<delete file="src/etc/testcases/taskdefs/tmp.jar" />
<delete dir="${tests.dir}/taskdefs/optional/antlr/antlr.tmp" />
<delete dir="${tests.dir}/taskdefs/taskdefs.tmp" />
<delete dir="${tests.dir}/taskdefs.tmp" />
<delete file="${tests.dir}/taskdefs/tmp.jar" />
</target>

<target name="run.single.test" if="testcase" depends="compiletests">
<target name="run-single-test" if="testcase, define-junit" depends="compile-tests">

<junit printsummary="no" haltonfailure="yes" fork="${junit.fork}">
<jvmarg value="-classic"/>
<classpath>
<pathelement location="${lib.dir}/${name}.jar" />
<pathelement location="${build.tests}" />
<path refid="classpath" />
<pathelement path="${java.class.path}" />
</classpath>

<classpath refid="tests-classpath"/>
<formatter type="plain" usefile="false" />

<test name="${testcase}" />
</junit>
</target>

<!-- =================================================================== -->
<!-- Targets to build distributions, probaly not that useful for -->
<!-- anybody but the people doing Ant releases. -->
<!-- =================================================================== -->

<property name="ant.srcdist.dir" value="../dist/jakarta-ant-src"/>

<target name="srcbuild">
<mkdir dir="${ant.srcdist.dir}" />
<mkdir dir="${ant.srcdist.dir}/lib" />

<copy todir="${ant.srcdist.dir}">
<fileset dir=".">
<exclude name="bin/**" />
<exclude name="lib/*.jar" />
</fileset>
</copy>

<fixcrlf srcdir="${ant.srcdist.dir}" includes="ant,antRun,bootstrap.sh,build.sh" cr="remove"/>
<fixcrlf srcdir="${ant.srcdist.dir}" includes="*.bat" cr="add"/>
<chmod perm="+x">
<fileset dir="${ant.srcdist.dir}">
<patternset refid="chmod.patterns"/>
</fileset>
</chmod>
</target>
<target name="src.zip" depends="srcbuild">
<zip zipfile="${ant.srcdist.dir}/../jakarta-ant-src.zip"
basedir="${ant.srcdist.dir}" />
</target>

<target name="src.tgz" depends="srcbuild">
<property name="src.tar"
value="${ant.srcdist.dir}/../jakarta-ant-src.tar" />
<tar tarfile="${src.tar}" basedir="${ant.srcdist.dir}" />
<gzip src="${src.tar}" zipfile="${src.tar}.gz" />
<delete file="${src.tar}" />
</target>

<target name="srcdist" description="Creates the source distribution"
depends="src.zip,src.tgz" />

<property name="ant.bindist.dir" value="../dist/jakarta-ant-bin"/>

<target name="binbuild" depends="compile-core">

<mkdir dir="${ant.bindist.dir}"/>
<mkdir dir="${ant.bindist.dir}/bin"/>
<mkdir dir="${ant.bindist.dir}/src"/>
<mkdir dir="${ant.bindist.dir}/etc"/>
<mkdir dir="${ant.bindist.dir}/lib"/>
<mkdir dir="${ant.bindist.dir}/docs/api"/>

<jar jarfile="${ant.bindist.dir}/lib/${name}.jar"
basedir="${build.classes.core}"
includes="org/**"
manifest="${manifest}"
/>

<copy todir="${ant.bindist.dir}/lib">
<fileset dir="${srclib.dir}">
<include name="**/*.jar"/>
<exclude name="ant.jar"/>
</fileset>
</copy>

<copy todir="${ant.bindist.dir}/docs">
<fileset dir="${docs.dir}"/>
</copy>
<javadoc packagenames="${packages}"
sourcepath="${basedir}/${src.dir}"
destdir="${ant.bindist.dir}/docs/api"
author="true"
version="true"
windowtitle="${Name} API"
doctitle="${Name}"
bottom="Copyright &#169; 2000 Apache Software Foundation. All Rights Reserved.">
</javadoc>

<copy todir="${ant.bindist.dir}/src">
<fileset dir="${src.dir}"/>
</copy>

<copy todir="${ant.bindist.dir}/etc">
<fileset dir="${src.etc.dir}">
<exclude name="testcases/**" />
</fileset>
</copy>

<copy todir="${ant.bindist.dir}/bin">
<fileset dir="${src.bin.dir}"/>
</copy>
<fixcrlf srcdir="${ant.bindist.dir}/bin" includes="ant,antRun" cr="remove"/>
<fixcrlf srcdir="${ant.bindist.dir}/bin" includes="*.bat" cr="add"/>
<chmod perm="+x">
<fileset dir="${ant.bindist.dir}/bin">
<patternset refid="chmod.patterns"/>
</fileset>
</chmod>

<copy file="build.xml" tofile="${ant.bindist.dir}/lib/build.xml"/>

<copy file="README" tofile="${ant.bindist.dir}/README"/>
<copy file="WHATSNEW" tofile="${ant.bindist.dir}/WHATSNEW"/>
<copy file="TODO" tofile="${ant.bindist.dir}/TODO"/>
<copy file="LICENSE" tofile="${ant.bindist.dir}/LICENSE"/>

</target>

<target name="bin.zip" depends="binbuild">
<zip zipfile="${ant.bindist.dir}/../jakarta-ant-bin.zip"
basedir="${ant.bindist.dir}" />
</target>

<target name="bin.tgz" depends="binbuild">
<property name="bin.tar"
value="${ant.bindist.dir}/../jakarta-ant-bin.tar" />
<tar tarfile="${bin.tar}" basedir="${ant.bindist.dir}" />
<gzip src="${bin.tar}" zipfile="${bin.tar}.gz" />
<delete file="${bin.tar}" />
</target>

<target name="bindist" description="Creates the binary distribution"
depends="bin.zip,bin.tgz" />

<property name="contributed.tasks" value="../build/ant.contrib" />
<property name="optional" value="../dist/optional.jar" />

<target name="optional.jar" depends="compile-optional"
description="Creates a JAR of the optional tasks">
<mkdir dir="${contributed.tasks}" />
<copy todir="${contributed.tasks}">
<fileset dir="${build.classes.optional}">
</fileset>
</copy>
<jar jarfile="${optional}"
basedir="${contributed.tasks}"
manifest="${manifest}"
/>
</target>

<target name="release.dist" depends="srcdist,bindist,optional.jar"
description="Creates all five files for a release build" />

</project>


BIN
lib/core/junit.jar View File


lib/core/jaxp.jar → lib/jaxp.jar View File


lib/README → lib/optional/README View File


lib/core/parser.jar → lib/parser.jar View File


src/bin/ant → src/script/ant View File


src/bin/ant.bat → src/script/ant.bat View File

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

if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"


src/bin/antRun → src/script/antRun View File


src/bin/antRun.bat → src/script/antRun.bat View File


src/bin/lcp.bat → src/script/lcp.bat View File


src/bin/runant.pl → src/script/runant.pl View File


Loading…
Cancel
Save