diff --git a/.cvsignore b/.cvsignore index de118105c..6801f000a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,5 +1,6 @@ .ant.properties -bin +dist +build prj.el emacs-jprj.el bootstrap.bat.pif diff --git a/bootstrap.bat b/bootstrap.bat index 6b58ed2ad..1a40629a7 100755 --- a/bootstrap.bat +++ b/bootstrap.bat @@ -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= diff --git a/bootstrap.sh b/bootstrap.sh index b4614abdb..c4b27bbde 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -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 diff --git a/build.bat b/build.bat index 659fb2462..52018c702 100755 --- a/build.bat +++ b/build.bat @@ -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= diff --git a/build.sh b/build.sh index fc1828b6d..d151c1686 100755 --- a/build.sh +++ b/build.sh @@ -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 $* + diff --git a/build.xml b/build.xml index 09db41466..e57b25397 100644 --- a/build.xml +++ b/build.xml @@ -1,60 +1,100 @@ - - - - + - + - - - - - - - - - - - - + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + - - - - - - - - - - - + + @@ -62,159 +102,191 @@ - - + + + classname="com.kvisco.xsl.XSLProcessor" + classpathref="classpath" /> + classname="javax.xml.transform.Transformer" + classpathref="classpath" /> - - - - - - - - - - - - + classname="org.apache.xalan.xslt.XSLTProcessorFactory" + classpathref="classpath" /> + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - + + - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + - + - - - + + + + - - - + + + + + + + + + + + + + + - - - - + + - - - - - - - - + debug="${debug}" + deprecation="${deprecation}" > + + + + + - + - - - - + + + + + + + - - - - - - + - + @@ -412,10 +423,12 @@ - - - - + + + @@ -424,172 +437,21 @@ - - - - + + + + - + + - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/core/junit.jar b/lib/core/junit.jar deleted file mode 100644 index 019387737..000000000 Binary files a/lib/core/junit.jar and /dev/null differ diff --git a/lib/core/jaxp.jar b/lib/jaxp.jar similarity index 100% rename from lib/core/jaxp.jar rename to lib/jaxp.jar diff --git a/lib/README b/lib/optional/README similarity index 100% rename from lib/README rename to lib/optional/README diff --git a/lib/core/parser.jar b/lib/parser.jar similarity index 100% rename from lib/core/parser.jar rename to lib/parser.jar diff --git a/src/bin/ant b/src/script/ant similarity index 100% rename from src/bin/ant rename to src/script/ant diff --git a/src/bin/ant.bat b/src/script/ant.bat similarity index 99% rename from src/bin/ant.bat rename to src/script/ant.bat index aa8de1193..0edd3d954 100755 --- a/src/bin/ant.bat +++ b/src/script/ant.bat @@ -1,4 +1,4 @@ -@echo off +rem @echo off if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat" diff --git a/src/bin/antRun b/src/script/antRun similarity index 100% rename from src/bin/antRun rename to src/script/antRun diff --git a/src/bin/antRun.bat b/src/script/antRun.bat similarity index 100% rename from src/bin/antRun.bat rename to src/script/antRun.bat diff --git a/src/bin/lcp.bat b/src/script/lcp.bat similarity index 100% rename from src/bin/lcp.bat rename to src/script/lcp.bat diff --git a/src/bin/runant.pl b/src/script/runant.pl similarity index 100% rename from src/bin/runant.pl rename to src/script/runant.pl