From b1640d5323e0484f6f804992505429018b26c9cb Mon Sep 17 00:00:00 2001 From: metasim Date: Tue, 14 Nov 2000 17:21:22 +0000 Subject: [PATCH] Added scripts for launching Antidote, and updated the build file to make better use of the Ant build directory for libraries, etc. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268181 13f79535-47bb-0310-9956-ffa450edef68 --- src/antidote/bin/antidote | 71 ++++++++++++++++++ src/antidote/bin/antidote.bat | 68 +++++++++++++++++ src/antidote/build.xml | 137 +++++++++++++++++++++++++++------- 3 files changed, 247 insertions(+), 29 deletions(-) create mode 100755 src/antidote/bin/antidote create mode 100644 src/antidote/bin/antidote.bat diff --git a/src/antidote/bin/antidote b/src/antidote/bin/antidote new file mode 100755 index 000000000..7c79de7aa --- /dev/null +++ b/src/antidote/bin/antidote @@ -0,0 +1,71 @@ +#! /bin/sh + +if [ -f $HOME/.antrc ] ; then + . $HOME/.antrc +fi + +if [ "$ANT_HOME" = "" ] ; then + # try to find ANT + if [ -d /opt/ant ] ; then + ANT_HOME=/opt/ant + fi + + if [ -d ${HOME}/opt/ant ] ; then + ANT_HOME=${HOME}/opt/ant + fi + + ## resolve links - $0 may be a link to ant's home + PRG=$0 + progname=`basename $0` + + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '.*/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname $PRG`/$link" + fi + done + + ANT_HOME=`dirname "$PRG"`/.. + +fi + +# Allow .antrc to specifiy flags to java cmd +if [ "$JAVACMD" = "" ] ; then + JAVACMD=java +fi + +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 +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 + +# supply JIKESPATH to Ant as jikes.class.path +if [ "$JIKESPATH" != "" ] ; then + if [ "$ANT_OPTS" != "" ] ; then + ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH" + else + ANT_OPTS=-Djikes.class.path=$JIKESPATH + fi +fi + +$JAVACMD -classpath $LOCALCLASSPATH -Dant.home=${ANT_HOME} $ANT_OPTS org.apache.tools.ant.gui.Main $@ + diff --git a/src/antidote/bin/antidote.bat b/src/antidote/bin/antidote.bat new file mode 100644 index 000000000..0e6a6b2f2 --- /dev/null +++ b/src/antidote/bin/antidote.bat @@ -0,0 +1,68 @@ +@echo off + +rem Slurp the command line arguments. This loop allows for an unlimited number of +rem agruments (up to the command line limit, anyway). + +set ANT_CMD_LINE_ARGS= + +:setupArgs +if %1a==a goto doneArgs +set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 +shift +goto setupArgs + +:doneArgs +rem The doneArgs label is here just to provide a place for the argument list loop +rem to break out to. + +rem find ANT_HOME +if not "%ANT_HOME%"=="" goto checkJava + +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. 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 noJavaHome +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" +goto checkJikes + +:noJavaHome +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. + +:checkJikes +if not "%JIKESPATH%" == "" goto runAntWithJikes + +:runAnt +%JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% +goto end + +:runAntWithJikes +%JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" -Djikes.class.path=%JIKESPATH% %ANT_OPTS% org.apache.tools.ant.gui.Main %ANT_CMD_LINE_ARGS% + +:end +set LOCALCLASSPATH= +set ANT_CMD_LINE_ARGS= + diff --git a/src/antidote/build.xml b/src/antidote/build.xml index 40309f5fc..54882ef86 100644 --- a/src/antidote/build.xml +++ b/src/antidote/build.xml @@ -1,10 +1,6 @@ - - - - - + @@ -14,20 +10,23 @@ + + + - - + + + - - - + + - - + + @@ -36,6 +35,14 @@ + + + + + + + + @@ -53,8 +60,8 @@ + deprecation="off" + optimize="on" > @@ -85,41 +92,100 @@ + manifest="${manifest}" + /> + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + @@ -127,7 +193,20 @@ + + + + + + + + + + + + +