You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by co...@locus.apache.org on 2000/07/12 17:54:21 UTC
cvs commit: jakarta-ant/src/bin lcp.bat ant.bat
conor 00/07/12 08:54:19
Modified: . bootstrap.bat build.bat build.xml
src/bin ant.bat
Added: src/bin lcp.bat
Removed: . lcp.bat
Log:
Rework the ant build process for NT/Windows
Change so that
build.bat is used just to build ant itself.
ant.bat should be used to run ant for other projects.
Revision Changes Path
1.13 +5 -4 jakarta-ant/bootstrap.bat
Index: bootstrap.bat
===================================================================
RCS file: /home/cvs/jakarta-ant/bootstrap.bat,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- bootstrap.bat 2000/07/08 02:54:30 1.12
+++ bootstrap.bat 2000/07/12 15:54:07 1.13
@@ -5,8 +5,9 @@
set OLDJAVA=%JAVA%
set OLDJAVAC=%JAVAC%
set OLDCLASSPATH=%CLASSPATH%
+set OLDANTHOME=%ANT_HOME%
-if exist ..\antrc.bat call ..\antrc.bat
+set ANT_HOME=.
if "" == "%JAVA%" if "" == "%JAVA_HOME%" set JAVA=java
if "" == "%JAVA%" set JAVA=%JAVA_HOME%\bin\java
@@ -48,13 +49,11 @@
echo.
echo ... Building Ant Distribution
-%JAVA% org.apache.tools.ant.Main clean main install %1 %2 %3 %4 %5
+%JAVA% org.apache.tools.ant.Main clean main bootstrap %1 %2 %3 %4 %5
echo.
echo ... Cleaning Up Build Directories
-%JAVA% org.apache.tools.ant.Main clean %1 %2 %3 %4 %5
-
if "%OS%" == "Windows_NT" if exist classes\nul rmdir/s/q classes
if not "%OS%" == "Windows_NT" if exist classes\nul deltree/y classes
@@ -64,9 +63,11 @@
set JAVA=%OLDJAVA%
set JAVAC=%OLDJAVAC%
set CLASSPATH=%OLDCLASSPATH%
+set ANT_HOME=%OLDANTHOME%
set OLDJAVA=
set OLDJAVAC=
set OLDCLASSPATH=
set LOCALCLASSPATH=
+set OLDANTHOME=
set TOOLS=
1.9 +9 -15 jakarta-ant/build.bat
Index: build.bat
===================================================================
RCS file: /home/cvs/jakarta-ant/build.bat,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- build.bat 2000/07/01 23:33:54 1.8
+++ build.bat 2000/07/12 15:54:10 1.9
@@ -1,20 +1,14 @@
@echo off
-set _ANTHOME=%ANT_HOME%
-if "%ANT_HOME%" == "" set ANT_HOME=.
+set REALANTHOME=%ANT_HOME%
+set ANT_HOME=.
+if not exist lib\ant.jar call bootstrap.bat
-set LOCALCLASSPATH=%CLASSPATH%
-for %%i in (%ANT_HOME%\lib\*.jar) do call lcp.bat %%i
-if exist %JAVA_HOME%\lib\tools.jar call lcp.bat %JAVA_HOME%\lib\tools.jar
-if exist %JAVA_HOME%\lib\classes.zip call lcp.bat %JAVA_HOME%\lib\classes.zip
+set ANT_INSTALL=
+if not "%REALANTHOME%" == "" set ANT_INSTALL=-Dant.install %REALANTHOME%
+call .\bin\ant %ANT_INSTALL% %1 %2 %3 %4 %5 %6 %7 %8 %9
-echo.
-echo Building with classpath: %LOCALCLASSPATH%
-echo.
-
-java -Dant.home="%ANT_HOME%" -classpath "%LOCALCLASSPATH%" %ANT_OPTS% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
-
rem clean up
-set LOCALCLASSPATH=
-set ANT_HOME=%_ANTHOME%
-set _ANTHOME=
+set ANT_HOME=%REALANTHOME%
+set REALANTHOME=
+set ANT_INSTALL=
1.35 +17 -4 jakarta-ant/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/build.xml,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- build.xml 2000/07/12 15:24:24 1.34
+++ build.xml 2000/07/12 15:54:10 1.35
@@ -182,10 +182,23 @@
<!-- =================================================================== -->
<!-- Installs the ant.jar library and binary files into ant.home -->
<!-- =================================================================== -->
- <target name="install" depends="main">
- <echo message="installing into ${ant.home}"/>
- <copydir src="${lib.dir}" dest="${ant.home}/lib"/>
- <copydir src="${bin.dir}" dest="${ant.home}/bin"/>
+ <target name="bootstrap" depends="main">
+ <echo message="copying bootstrapped files into bin and lib"/>
+ <copydir src="${lib.dir}" dest="lib"/>
+ <copydir src="${bin.dir}" dest="bin"/>
+ </target>
+
+ <target name="fullinstall" depends="dist" if="ant.install">
+ <echo message="installing full copy of ant into ${ant.install}"/>
+ <mkdir dir="${ant.install}"/>
+ <copydir src="${ant.dist.dir}" dest="${ant.install}"/>
+ </target>
+
+ <target name="install" depends="main" if="ant.install">
+ <echo message="copy minimal ant installtion into ${ant.install}"/>
+ <mkdir dir="${ant.install}"/>
+ <copydir src="${lib.dir}" dest="${ant.install}/lib"/>
+ <copydir src="${bin.dir}" dest="${ant.install}/bin"/>
</target>
<!-- =================================================================== -->
1.3 +13 -11 jakarta-ant/src/bin/ant.bat
Index: ant.bat
===================================================================
RCS file: /home/cvs/jakarta-ant/src/bin/ant.bat,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ant.bat 2000/06/25 15:18:39 1.2
+++ ant.bat 2000/07/12 15:54:16 1.3
@@ -1,33 +1,35 @@
@echo off
-@setlocal
-if "%ANT_HOME%"=="" goto checkProgFiles
-goto checkJava
+rem find ANT_HOME
+if not "%ANT_HOME%"=="" goto checkJava
-:checkProgFiles
-rem check for ant on system drive
+rem check for ant in Program Files on system drive
if not exist "%SystemDrive%\Program Files\ant" goto checkSystemDrive
-
set ANT_HOME=%SystemDrive%\Program Files\ant
goto checkJava
:checkSystemDrive
+rem check for ant in root directory of system drive
if not exist "%SystemDrive%\ant" goto noAntHome
set ANT_HOME=%SystemDrive%\ant
goto checkJava
:noAntHome
-echo ANT_HOME is not set and ant could not be located
+echo ANT_HOME is not set and ant could not be located. Please set ANT_HOME.
goto end
:checkJava
if "%JAVACMD%" == "" set JAVACMD=java
+set LOCALCLASSPATH=%CLASSPATH%
+for %%i in (%ANT_HOME%\lib\*.jar) do call %ANT_HOME%\bin\lcp.bat %%i
+
if "%JAVA_HOME%" == "" goto runAnt
-set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%CLASSPATH%
+if exist %JAVA_HOME%\lib\tools.jar call %ANT_HOME%\bin\lcp.bat %JAVA_HOME%\lib\tools.jar
+if exist %JAVA_HOME%\lib\classes.zip call %ANT_HOME%\bin\lcp.bat %JAVA_HOME%\lib\classes.zip
:runAnt
-set CLASSPATH=%ANT_HOME%\lib\ant.jar;%ANT_HOME%\lib\xml.jar;%CLASSPATH%
-%JAVACMD% -Dant.home="%ANT_HOME%" org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
+%JAVACMD% -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
:end
-@endlocal
+set LOCALCLASSPATH=
+
1.1 jakarta-ant/src/bin/lcp.bat
Index: lcp.bat
===================================================================
set LOCALCLASSPATH=%LOCALCLASSPATH%;%1
Re: cvs commit: jakarta-ant/src/bin lcp.bat ant.bat
Posted by Christopher Elkins <ce...@scardini.com>.
> > conor 00/07/12 08:54:19
> >
> > Modified: . bootstrap.bat build.bat build.xml
> > src/bin ant.bat
> > Added: src/bin lcp.bat
> > Removed: . lcp.bat
> > Log:
>
> This had the net effect of removing lcp.bat altogether. Was that the intended
> action? ;-)
>
Oops! What I really meant to say was that if you're going to move lcp.bat,
bootstrap.bat needs to be updated accordingly. (See patch below.)
--
Christopher Elkins
--
Index: bootstrap.bat
===================================================================
RCS file: /home/cvspublic/jakarta-ant/bootstrap.bat,v
retrieving revision 1.13
diff -u -r1.13 bootstrap.bat
--- bootstrap.bat 2000/07/12 15:54:07 1.13
+++ bootstrap.bat 2000/07/12 21:14:09
@@ -20,9 +20,9 @@
SET LOCALCLASSPATH=classes;src\main
if exist lib\ant.jar erase lib\ant.jar
-for %%i in (lib\*.jar) do call lcp.bat %%i
-if exist %JAVA_HOME%\lib\tools.jar call lcp.bat %JAVA_HOME%\lib\tools.jar
-if exist %JAVA_HOME%\lib\classes.zip call lcp.bat %JAVA_HOME%\lib\classes.zip
+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%
echo JAVA_HOME=%JAVA_HOME%
Re: cvs commit: jakarta-ant/src/bin lcp.bat ant.bat
Posted by Christopher Elkins <ce...@scardini.com>.
> conor 00/07/12 08:54:19
>
> Modified: . bootstrap.bat build.bat build.xml
> src/bin ant.bat
> Added: src/bin lcp.bat
> Removed: . lcp.bat
> Log:
This had the net effect of removing lcp.bat altogether. Was that the intended
action? ;-)
--
Christopher Elkins
Re: cvs commit: jakarta-ant/src/bin lcp.bat ant.bat
Posted by Christopher Elkins <ce...@scardini.com>.
> Just to expand on this patch a little.
>
> I have changed bootstrap so that doesn't delete the build classes from the
> build it has done. It also sets ANT_HOME explicitly to "." and uses a new
> "bootstrap" target. This target copies the lib and bin directories into the
> ant project root.
>
<snip>
>
> I have tested this on NT4 and Win98. Please let me have any feedback if this
> new process causes you problems with builds.
>
> That's it for now. I'll make the changes to the Unix scripts tomorrow along
> similar lines.
>
> Conor
>
I just wanted to sing the praises of these changes - they're grrrrreat! Updating
my system-level ant from CVS couldn't be much easier. Thanks!
--
Christopher Elkins
RE: cvs commit: jakarta-ant/src/bin lcp.bat ant.bat
Posted by Conor MacNeill <co...@m64.com>.
Just to expand on this patch a little.
I have changed bootstrap so that doesn't delete the build classes from the
build it has done. It also sets ANT_HOME explicitly to "." and uses a new
"bootstrap" target. This target copies the lib and bin directories into the
ant project root.
I have changed the build.bat so that it forces ANT_HOME to ".". It will also
bootstrap automatically if lib\ant.jar is not present. I have also changed
it so that is calls ant.bat in the bin directory, created as part of the
bootstrap.
There are two new install targets. One, "fullinstall", installs the full ant
distribution into ANT_HOME. The other, "install", installs just the runtime
bits (no doco etc) into ANT_HOME. These targets are only executed if the
property ant.install is set. The build script sets this to the real value of
ANT_HOME before it sets ANT_HOME to ".". This means these targets should
only work if you use "build fullinstall" and not "ant fullinstall". My
intention here is to prevent you overwriting the jars and scripts that are
being executed by ant.
I have reworked ant.bat to take out the NT specific things (@setlocal). It
also uses the lcp.bat file, which I have moved, to set the classpath to
contain all jars in the ant lib directory.
If you want jars to be added to the classpath during bootstrap, create a lib
directory, if necessary, in the project root directory and place the jars in
there. The bootstrap will add them to the classpath as will the build
script.
Similarly if you add jars to %ANT_HOME%\lib, they will be added to the ant
classpath by ant.bat.
I have tested this on NT4 and Win98. Please let me have any feedback if this
new process causes you problems with builds.
That's it for now. I'll make the changes to the Unix scripts tomorrow along
similar lines.
Conor
--
Conor MacNeill
Home: conor@m64.com
Work: conor@cortexebusiness.com.au
Web: www.cortexebusiness.com.au
> -----Original Message-----
> From: conor@locus.apache.org [mailto:conor@locus.apache.org]
> Sent: Thursday, 13 July 2000 1:54
> To: jakarta-ant-cvs@apache.org
> Subject: cvs commit: jakarta-ant/src/bin lcp.bat ant.bat
>
>
> conor 00/07/12 08:54:19
>
> Modified: . bootstrap.bat build.bat build.xml
> src/bin ant.bat
> Added: src/bin lcp.bat
> Removed: . lcp.bat
> Log:
> Rework the ant build process for NT/Windows
>
> Change so that
> build.bat is used just to build ant itself.
> ant.bat should be used to run ant for other projects.
>