Skip to content

Commit

Permalink
Further tuning of the build scripts. The bootstrap now goes into
Browse files Browse the repository at this point in the history
the bootstrap directory to minimise interference with the CVS lib
directory.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268545 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Conor MacNeill committed Jan 31, 2001
1 parent 87ef70f commit 890a016
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .cvsignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.ant.properties
dist
build
bootstrap
distribution
prj.el
emacs-jprj.el
bootstrap.bat.pif
Expand Down
4 changes: 2 additions & 2 deletions bootstrap.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ echo CLASSPATH=%CLASSPATH%
if "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul rmdir/s/q %CLASSDIR%
if not "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul deltree/y %CLASSDIR%

mkdir %CLASSDIR%
mkdir build
if not exist %CLASSDIR% mkdir %CLASSDIR%
if not exist build mkdir build

echo.
echo ... Compiling Ant Classes
Expand Down
12 changes: 8 additions & 4 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
@echo off

set OLDCLASSPATH=%CLASSPATH%
set REAL_ANT_HOME=%ANT_HOME%
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
set ANT_HOME=bootstrap
if exist bootstrap\lib\ant.jar if exist bootstrap\bin\ant.bat if exist bootstrap\bin\lcp.bat if exist bootstrap\bin\antRun.bat goto runAnt
call bootstrap.bat

:runAnt
set CLASSPATH=%CLASSPATH%;lib\parser.jar;lib\jaxp.jar
if not "%REAL_ANT_HOME%" == "" goto install_ant
call .\bin\ant.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
call bootstrap\bin\ant.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
goto cleanup

:install_ant
call .\bin\ant.bat -Dant.install="%REAL_ANT_HOME%" %1 %2 %3 %4 %5 %6 %7 %8 %9
call bootstrap\bin\ant.bat -Dant.install="%REAL_ANT_HOME%" %1 %2 %3 %4 %5 %6 %7 %8 %9

rem clean up
:cleanup
set ANT_HOME=%REAL_ANT_HOME%
set REAL_ANT_HOME=
set CLASSPATH=%OLDCLASSPATH%
set OLDCLASSPATH=
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ 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 bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/bin/antRun ; then
/bin/sh ./bootstrap.sh
fi

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

bin/ant $ANT_INSTALL $*
bootstrap/bin/ant $ANT_INSTALL $*

67 changes: 45 additions & 22 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--
=======================================================================
Ant own build file
Ant own build file
=======================================================================
-->
<project name="Ant" default="main" basedir=".">
Expand All @@ -23,7 +23,7 @@

<!--
===================================================================
Set the properties related to the source tree
Set the properties related to the source tree
===================================================================
-->
<property name="src.dir" value="src"/>
Expand All @@ -41,10 +41,11 @@

<!--
===================================================================
Set the properties for the build area
Set the properties for the build area
===================================================================
-->
<property name="build.dir" value="build"/>
<property name="bootstrap.dir" value="bootstrap"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.lib" value="${build.dir}/lib"/>
<property name="build.javadocs" value="${build.dir}/javadocs"/>
Expand All @@ -61,7 +62,7 @@

<!--
===================================================================
Set up properties for the distribution area
Set up properties for the distribution area
===================================================================
-->
<property name="dist.name" value="jakarta-${name}-${version}"/>
Expand All @@ -83,7 +84,7 @@

<!--
===================================================================
Check to see what optional dependencies are available
Check to see what optional dependencies are available
===================================================================
-->
<target name="check_for_optional_packages">
Expand Down Expand Up @@ -142,13 +143,20 @@
classpathref="classpath"/>
</target>

<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<!--
===================================================================
Prepare the build
===================================================================
-->
<target name="prepare">
<tstamp />
</target>

<!--
===================================================================
Build the code
===================================================================
-->
<target name="build" depends="prepare, check_for_optional_packages">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
Expand Down Expand Up @@ -207,8 +215,7 @@

<!--
===================================================================
Creates the lib directory including the ant jars, ant.jar and
optional.jar
Create the ant jars: ant.jar and optional.jar
===================================================================
-->
<target name="jars" depends="build">
Expand All @@ -229,7 +236,7 @@

<!--
===================================================================
Create the essential distribution
Create the essential distribution that can run ant
===================================================================
-->
<target name="dist-lite" depends="jars, setup-distproperties">
Expand Down Expand Up @@ -261,7 +268,7 @@

<!--
===================================================================
Create the complete distribution
Create the complete distribution
===================================================================
-->
<target name="dist" depends="dist-lite,javadocs">
Expand Down Expand Up @@ -301,19 +308,19 @@

<!--
===================================================================
Target to create bootstrap libraries
Target to create bootstrap build
===================================================================
-->
<target name="bootstrap">
<antcall target="dist-lite">
<param name="dist.dir" value="." />
<param name="dist.dir" value="${bootstrap.dir}" />
</antcall>
</target>


<!--
===================================================================
Create the source distribution
Create the source distribution
===================================================================
-->
<target name="src-dist" depends="setup-distproperties">
Expand Down Expand Up @@ -363,7 +370,7 @@

<!--
===================================================================
Create the binary distribution
Create the binary distribution
===================================================================
-->
<target name="distribution">
Expand Down Expand Up @@ -406,20 +413,31 @@

<!--
===================================================================
Cleans up build and distribution directories
Cleans up build and distribution directories
===================================================================
-->
<target name="clean">
<target name="clean" depends="setup-distproperties">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${dist.base}" />
<delete>
<fileset dir="." includes="**/*~" defaultexcludes="no"/>
</delete>
</target>

<!--
===================================================================
Installs ant
Cleans everything
===================================================================
-->
<target name="allclean" depends="clean">
<delete file="${bootstrap.dir}/bin/antRun" />
<delete file="${bootstrap.dir}/bin/antRun.bat" />
</target>

<!--
===================================================================
Installs ant
===================================================================
-->
<target name="install" if="ant.install">
Expand All @@ -436,7 +454,7 @@

<!--
===================================================================
Creates the API documentation
Creates the API documentation
===================================================================
-->

Expand Down Expand Up @@ -466,7 +484,7 @@

<!--
===================================================================
Compile testcases
Compile testcases
===================================================================
-->
<target name="compile-tests" depends="build" if="junit.present">
Expand All @@ -489,7 +507,7 @@

<!--
===================================================================
Run testcase
Run testcase
===================================================================
-->
<target name="run-tests" depends="compile-tests" if="junit.present">
Expand Down Expand Up @@ -548,6 +566,11 @@
</junit>
</target>

<!--
===================================================================
Main target - runs dist-lite by default
===================================================================
-->
<target name="main" depends="dist-lite"/>

</project>
9 changes: 0 additions & 9 deletions src/script/ant
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,6 @@ do
LOCALCLASSPATH=$LOCALCLASSPATH:"$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
LOCALCLASSPATH=$LOCALCLASSPATH:"$i"
fi
done

if [ "$CLASSPATH" != "" ] ; then
LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH
Expand Down
1 change: 0 additions & 1 deletion src/script/ant.bat
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ goto end
set _JAVACMD=%JAVACMD%
set LOCALCLASSPATH="%CLASSPATH%"
for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" "%%i"
for %%i in ("%ANT_HOME%\lib\core\*.jar") do call "%ANT_HOME%\bin\lcp.bat" "%%i"

if "%JAVA_HOME%" == "" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java
Expand Down

0 comments on commit 890a016

Please sign in to comment.