summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbootstrap.bat25
-rwxr-xr-xbootstrap.sh39
-rwxr-xr-xbuild.sh28
-rw-r--r--build.xml4
-rw-r--r--src/bin/ant22
5 files changed, 60 insertions, 58 deletions
diff --git a/bootstrap.bat b/bootstrap.bat
index 915dbc7b1..c435657d3 100755
--- a/bootstrap.bat
+++ b/bootstrap.bat
@@ -18,33 +18,38 @@ if "" == "%JAVAC%" set JAVAC=%JAVA_HOME%\bin\javac
echo.
echo ... Bootstrapping Ant Distribution
-SET LOCALCLASSPATH=classes;src\main
if exist lib\ant.jar erase lib\ant.jar
+
+SET LOCALCLASSPATH=
for %%i in (lib\*.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 CLASSPATH=%CLASSPATH%;%LOCALCLASSPATH%
+
+set TOOLS=src\main\org\apache\tools
+set CLASSDIR=classes
+
+SET CLASSPATH=%CLASSPATH%;%LOCALCLASSPATH%;%CLASSDIR%;src\main
echo JAVA_HOME=%JAVA_HOME%
echo JAVA=%JAVA%
echo JAVAC=%JAVAC%
echo CLASSPATH=%CLASSPATH%
-if "%OS%" == "Windows_NT" if exist classes\nul rmdir/s/q classes
-if not "%OS%" == "Windows_NT" if exist classes\nul deltree/y classes
-mkdir classes
+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 TOOLS=src\main\org\apache\tools
+mkdir %CLASSDIR%
echo.
echo ... Compiling Ant Classes
-%JAVAC% -d classes %TOOLS%\tar\*.java %TOOLS%\ant\*.java %TOOLS%\ant\taskdefs\*.java
+%JAVAC% -d %CLASSDIR% %TOOLS%\tar\*.java %TOOLS%\ant\*.java %TOOLS%\ant\taskdefs\*.java
echo.
echo ... Copying Required Files
-copy %TOOLS%\ant\taskdefs\*.properties classes\org\apache\tools\ant\taskdefs
+copy %TOOLS%\ant\taskdefs\*.properties %CLASSDIR%\org\apache\tools\ant\taskdefs
echo.
echo ... Building Ant Distribution
@@ -54,8 +59,8 @@ echo ... Building Ant Distribution
echo.
echo ... Cleaning Up Build Directories
-if "%OS%" == "Windows_NT" if exist classes\nul rmdir/s/q classes
-if not "%OS%" == "Windows_NT" if exist classes\nul deltree/y classes
+if "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul rmdir/s/q %CLASSDIR%
+if not "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul deltree/y %CLASSDIR%
echo.
echo ... Done Bootstrapping Ant Distribution
diff --git a/bootstrap.sh b/bootstrap.sh
index ef2131280..360890347 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,16 +1,9 @@
#!/bin/sh
-if [ -f $HOME/.antrc ] ; then
- . $HOME/.antrc
-fi
+ANT_HOME=.
+export ANT_HOME
-if [ "$ANT_HOME" = "" ] ; then
- ANT_HOME=`pwd`
- export ANT_HOME
-fi
-
-SRCDIR=src/main/org/apache/tools
-CLASSDIR=classes
+echo ... Bootstrapping Ant Distribution
if test -f lib/ant.jar ; then
rm lib/ant.jar
@@ -32,28 +25,32 @@ if test -f $JAVA_HOME/lib/classes.zip ; then
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip
fi
+TOOLS=src/main/org/apache/tools
+CLASSDIR=classes
+
CLASSPATH=${CLASSPATH}:${CLASSDIR}:src/main
+export CLASSPATH
mkdir -p ${CLASSDIR}
-export CLASSPATH
+echo ... Compiling Ant Classes
-echo
-echo Building with classpath: $CLASSPATH
-echo
+javac -d ${CLASSDIR} ${TOOLS}/tar/*.java
+javac -d ${CLASSDIR} ${TOOLS}/ant/*.java
+javac -d ${CLASSDIR} ${TOOLS}/ant/taskdefs/*.java
-javac -d ${CLASSDIR} ${SRCDIR}/tar/*.java
-javac -d ${CLASSDIR} ${SRCDIR}/ant/*.java
-javac -d ${CLASSDIR} ${SRCDIR}/ant/taskdefs/*.java
+echo ... Copying Required Files
cp src/main/org/apache/tools/ant/taskdefs/defaults.properties ${CLASSDIR}/org/apache/tools/ant/taskdefs
+echo ... Building Ant Distribution
+
java org.apache.tools.ant.Main clean main bootstrap
-java org.apache.tools.ant.Main clean
-if test ! -d bin; then mkdir bin; fi
-cp src/bin/antRun bin
-chmod +x bin/antRun
+echo ... Cleaning Up Build Directories
+
+chmod +x bin/ant bin/antRun
rm -rf ${CLASSDIR}
+echo ... Done Bootstrapping Ant Distribution
diff --git a/build.sh b/build.sh
index 0217bb413..fc1828b6d 100755
--- a/build.sh
+++ b/build.sh
@@ -1,28 +1,16 @@
#!/bin/sh
-if [ "$ANT_HOME" = "" ] ; then
- ANT_HOME=`pwd`
-fi
+REALANTHOME=$ANT_HOME
+ANT_HOME=.
export ANT_HOME
-LOCALCLASSPATH=`echo $ANT_HOME/lib/*.jar | tr ' ' ':'`
-
-if [ "$CLASSPATH" != "" ] ; then
- LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH
-fi
-
-if test -f $JAVA_HOME/lib/tools.jar ; then
- LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
-fi
+if test ! -f lib/ant.jar -o ! -x bin/ant -o ! -x bin/antRun ; then
+ ./bootstrap.sh
+fi
-if test -f $JAVA_HOME/lib/classes.zip ; then
- LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip
+if [ "$REALANTHOME" != "" ] ; then
+ ANT_INSTALL="-Dant.install $REALANTHOME"
fi
-echo
-echo Building with classpath: $LOCALCLASSPATH
-echo
-
-chmod 0755 $ANT_HOME/bin/antRun
+bin/ant $ANT_INSTALL $*
-java -Dant.home=$ANT_HOME -classpath $LOCALCLASSPATH $ANT_OPTS org.apache.tools.ant.Main $*
diff --git a/build.xml b/build.xml
index 7c35ac233..9c25c987c 100644
--- a/build.xml
+++ b/build.xml
@@ -192,6 +192,8 @@
<echo message="installing full copy of ant into ${ant.install}"/>
<mkdir dir="${ant.install}"/>
<copydir src="${ant.dist.dir}" dest="${ant.install}"/>
+ <chmod perm="+x" file="${ant.install}/bin/ant"/>
+ <chmod perm="+x" file="${ant.install}/bin/antRun"/>
</target>
<target name="install" depends="main" if="ant.install">
@@ -199,6 +201,8 @@
<mkdir dir="${ant.install}"/>
<copydir src="${lib.dir}" dest="${ant.install}/lib"/>
<copydir src="${bin.dir}" dest="${ant.install}/bin"/>
+ <chmod perm="+x" file="${ant.install}/bin/ant"/>
+ <chmod perm="+x" file="${ant.install}/bin/antRun"/>
</target>
<!-- =================================================================== -->
diff --git a/src/bin/ant b/src/bin/ant
index 8c67ed34b..5c173016e 100644
--- a/src/bin/ant
+++ b/src/bin/ant
@@ -37,13 +37,21 @@ if [ "$JAVACMD" = "" ] ; then
JAVACMD=java
fi
-# Use the original tools.jar if available
-if [ ! "$JAVA_HOME" = "" ] ; then
- CLASSPATH=${JAVA_HOME}/lib/tools.jar:$CLASSPATH
- CLASSPATH=${JAVA_HOME}/lib/classes.zip:$CLASSPATH
+LOCALCLASSPATH=`echo $ANT_HOME/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
fi
-CLASSPATH=${ANT_HOME}/lib/ant.jar:$CLASSPATH
-export CLASSPATH
+$JAVACMD -classpath $LOCALCLASSPATH -Dant.home=${ANT_HOME} $ANT_OPTS org.apache.tools.ant.Main $@
-$JAVACMD -Dant.home=${ANT_HOME} org.apache.tools.ant.Main $@