-The AspectJ tree builds using a variant of Ant 1.5.1.
+The AspectJ tree builds using Ant 1.6.3.
+(No longer is a special version of Ant required.)
-lib/ contains Ant 1.5.1 core and optional taskdef classes,
-as well as xalan.jar which is used for the junitreport task.
+To run tests using the junit task, junit.jar is added to lib/.
-To run tests with the junit task, junit.jar must be added
-to the system classpath with optional.jar; the script in
-aspectj/build/bin/ant.[bat|sh] does this.
+This directory contains:
-To run junit tests and junitreport (and other optional tasks) requires
-declaring the taskdef explicitly. See build-modules.xml.
+o The contents of the binary distribution of Ant 1.6.3,
+ not including the docs directory.
-For ant scripts, use build/bin/ant.[bat|sh], which adds junit.jar.
+o ant-src.zip, .java extracted from the source distribution of Ant 1.6.3.
+
+For Ant, see http://ant.apache.org.
-#! /bin/sh\r
-\r
-# Copyright (c) 2001-2002 The Apache Software Foundation. All rights\r
-# reserved.\r
-\r
-# load system-wide ant configuration\r
-if [ -f "/etc/ant.conf" ] ; then \r
- . /etc/ant.conf\r
-fi\r
-\r
-# provide default values for people who don't use RPMs\r
-if [ -z "$rpm_mode" ] ; then\r
- rpm_mode=false;\r
-fi\r
-if [ -z "$usejikes" ] ; then\r
- usejikes=false;\r
-fi\r
-\r
-# load user ant configuration\r
-if [ -f "$HOME/.antrc" ] ; then \r
- . "$HOME/.antrc"\r
-fi\r
-\r
-# OS specific support. $var _must_ be set to either true or false.\r
-cygwin=false;\r
-darwin=false;\r
-case "`uname`" in\r
- CYGWIN*) cygwin=true ;;\r
- Darwin*) darwin=true\r
- if [ -z "$JAVA_HOME" ] ; then\r
- JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home \r
- fi\r
- ;;\r
-esac\r
-\r
-if [ -z "$ANT_HOME" ] ; then\r
- # try to find ANT\r
- if [ -d /opt/ant ] ; then \r
- ANT_HOME=/opt/ant\r
- fi\r
-\r
- if [ -d "${HOME}/opt/ant" ] ; then \r
- ANT_HOME="${HOME}/opt/ant"\r
- fi\r
-\r
- ## resolve links - $0 may be a link to ant's home\r
- PRG="$0"\r
- progname=`basename "$0"`\r
- saveddir=`pwd`\r
-\r
- # need this for relative symlinks\r
- cd `dirname "$PRG"`\r
- \r
- while [ -h "$PRG" ] ; do\r
- ls=`ls -ld "$PRG"`\r
- link=`expr "$ls" : '.*-> \(.*\)$'`\r
- if expr "$link" : '.*/.*' > /dev/null; then\r
- PRG="$link"\r
- else\r
- PRG=`dirname "$PRG"`"/$link"\r
- fi\r
- done\r
- \r
- ANT_HOME=`dirname "$PRG"`/..\r
-\r
- cd "$saveddir"\r
-\r
- # make it fully qualified\r
- ANT_HOME=`cd "$ANT_HOME" && pwd`\r
-fi\r
-\r
-# For Cygwin, ensure paths are in UNIX format before anything is touched\r
-if $cygwin ; then\r
- [ -n "$ANT_HOME" ] &&\r
- ANT_HOME=`cygpath --unix "$ANT_HOME"`\r
- [ -n "$JAVA_HOME" ] &&\r
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`\r
- [ -n "$CLASSPATH" ] &&\r
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`\r
-fi\r
-\r
-# set ANT_LIB location\r
-ANT_LIB="${ANT_HOME}/lib"\r
-\r
-if [ -z "$JAVACMD" ] ; then \r
- if [ -n "$JAVA_HOME" ] ; then\r
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then \r
- # IBM's JDK on AIX uses strange locations for the executables\r
- JAVACMD="$JAVA_HOME/jre/sh/java"\r
- else\r
- JAVACMD="$JAVA_HOME/bin/java"\r
- fi\r
- else\r
- JAVACMD=java\r
- fi\r
-fi\r
- \r
-if [ ! -x "$JAVACMD" ] ; then\r
- echo "Error: JAVA_HOME is not defined correctly."\r
- echo " We cannot execute $JAVACMD"\r
- exit 1\r
-fi\r
-\r
-if [ -n "$CLASSPATH" ] ; then\r
- LOCALCLASSPATH="$CLASSPATH"\r
-fi\r
-\r
-# in rpm_mode get ant/optional/xml parser&api from JAVALIBDIR \r
-if $rpm_mode; then\r
- JAVALIBDIR=/usr/share/java\r
- for i in ant ant-optional jaxp_parser xml_apis \r
- do\r
- if [ -z "$LOCALCLASSPATH" ] ; then\r
- LOCALCLASSPATH="$JAVALIBDIR/$i.jar"\r
- else\r
- LOCALCLASSPATH="$JAVALIBDIR/$i.jar":"$LOCALCLASSPATH"\r
- fi\r
- done\r
-\r
- # in rpm mode ant/lib is in /usr/share/java/ant\r
- ANT_LIB="${JAVALIBDIR}/ant"\r
-fi\r
-\r
-# add in the dependency .jar files in non-RPM mode (the default)\r
-for i in "${ANT_LIB}"/*.jar\r
-do\r
- # if the directory is empty, then it will return the input string\r
- # this is stupid, so case for it\r
- if [ -f "$i" ] ; then\r
- if [ -z "$LOCALCLASSPATH" ] ; then\r
- LOCALCLASSPATH="$i"\r
- else\r
- LOCALCLASSPATH="$i":"$LOCALCLASSPATH"\r
- fi\r
- fi\r
-done\r
-## AspectJ change: add in junit\r
-if [ -f "${ANT_HOME}"/../junit/junit.jar ] ; then\r
- LOCALCLASSPATH="${ANT_HOME}/../junit/junit.jar":"$LOCALCLASSPATH"\r
-fi\r
-\r
-if [ -n "$JAVA_HOME" ] ; then\r
- if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then\r
- LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar"\r
- fi\r
-\r
- if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then\r
- LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip"\r
- fi\r
-\r
- # OSX hack to make Ant work with jikes\r
- if $darwin ; then\r
- OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"\r
- if [ -d ${OSXHACK} ] ; then\r
- for i in ${OSXHACK}/*.jar\r
- do\r
- JIKESPATH="$JIKESPATH:$i"\r
- done\r
- fi\r
- fi\r
-else\r
- echo "Warning: JAVA_HOME environment variable is not set."\r
- echo " If build fails because sun.* classes could not be found"\r
- echo " you will need to set the JAVA_HOME environment variable"\r
- echo " to the installation directory of java."\r
-fi\r
-\r
-# Allow Jikes support (off by default)\r
-if $usejikes; then\r
- ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"\r
-fi\r
-\r
-# defined to be able to test taskdefs immediately\r
-if [ -n "$USE_TASKDEFS" ] ; then\r
- LOCALCLASSPATH="$ANT_HOME/../../taskdefs/bin;$LOCALCLASSPATH"\r
-fi\r
-\r
-# For Cygwin, switch paths to Windows format before running java\r
-if $cygwin; then\r
- ANT_HOME=`cygpath --path --windows "$ANT_HOME"`\r
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`\r
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`\r
- LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`\r
- CYGHOME=`cygpath --path --windows "$HOME"`\r
-fi\r
-\r
-if [ -n "$CYGHOME" ]; then\r
- if [ -n "$JIKESPATH" ]; then\r
- JIKESPATH=`cygpath --path --windows "$JIKESPATH"`\r
- "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Djikes.class.path="$JIKESPATH" -Dcygwin.user.home="$CYGHOME" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"\r
- else\r
- # AspectJ change: increase max heap size\r
- "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Dcygwin.user.home="$CYGHOME" -Xmx1024M $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"\r
- fi\r
-else\r
- if [ -n "$JIKESPATH" ]; then\r
- "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Djikes.class.path="$JIKESPATH" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"\r
- else\r
- # AspectJ change: increase max heap size\r
- "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Xmx1024M $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"\r
- fi\r
-fi\r
-\r
+#! /bin/sh
+
+# Copyright 2001-2005 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Extract launch and ant arguments, (see details below).
+ant_exec_args=
+no_config=false
+use_jikes_default=false
+ant_exec_debug=false
+show_help=false
+for arg in "$@" ; do
+ if [ "$arg" = "--noconfig" ] ; then
+ no_config=true
+ elif [ "$arg" = "--usejikes" ] ; then
+ use_jikes_default=true
+ elif [ "$arg" = "--execdebug" ] ; then
+ ant_exec_debug=true
+ elif [ my"$arg" = my"--h" -o my"$arg" = my"--help" ] ; then
+ show_help=true
+ ant_exec_args="$ant_exec_args -h"
+ else
+ if [ my"$arg" = my"-h" -o my"$arg" = my"-help" ] ; then
+ show_help=true
+ fi
+ ant_exec_args="$ant_exec_args \"$arg\""
+ fi
+done
+
+# Source/default ant configuration
+if $no_config ; then
+ rpm_mode=false
+ usejikes=$use_jikes_default
+else
+ # load system-wide ant configuration
+ if [ -f "/etc/ant.conf" ] ; then
+ . /etc/ant.conf
+ fi
+
+ # load user ant configuration
+ if [ -f "$HOME/.ant/ant.conf" ] ; then
+ . $HOME/.ant/ant.conf
+ fi
+ if [ -f "$HOME/.antrc" ] ; then
+ . "$HOME/.antrc"
+ fi
+
+ # provide default configuration values
+ if [ -z "$rpm_mode" ] ; then
+ rpm_mode=false
+ fi
+ if [ -z "$usejikes" ] ; then
+ usejikes=$use_jikes_default
+ fi
+fi
+
+# Setup Java environment in rpm mode
+if $rpm_mode ; then
+ if [ -f /usr/share/java-utils/java-functions ] ; then
+ . /usr/share/java-utils/java-functions
+ set_jvm
+ set_javacmd
+ fi
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ Darwin*) darwin=true
+ if [ -z "$JAVA_HOME" ] ; then
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+ fi
+ ;;
+esac
+
+if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then
+ ## resolve links - $0 may be a link to ant's home
+ PRG="$0"
+ progname=`basename "$0"`
+
+ # need this for relative symlinks
+ 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"`/..
+
+ # make it fully qualified
+ ANT_HOME=`cd "$ANT_HOME" && pwd`
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$ANT_HOME" ] &&
+ ANT_HOME=`cygpath --unix "$ANT_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# set ANT_LIB location
+ANT_LIB="${ANT_HOME}/lib"
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD=`which java 2> /dev/null `
+ if [ -z "$JAVACMD" ] ; then
+ JAVACMD=java
+ fi
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+# Build local classpath using just the launcher in non-rpm mode or
+# use the Jpackage helper in rpm mode with basic and default jars
+# specified in the ant.conf configuration. Because the launcher is
+# used, libraries linked in ANT_HOME will also be include, but this
+# is discouraged as it is not java-version safe. A user should
+# request optional jars and their dependencies via the OPT_JAR_LIST
+# variable
+if $rpm_mode && [ -f /usr/bin/build-classpath ] ; then
+ LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher jaxp_parser_impl xml-commons-apis)"
+ # If the user requested to try to add some other jars to the classpath
+ if [ -n "$OPT_JAR_LIST" ] ; then
+ _OPTCLASSPATH="$(/usr/bin/build-classpath $OPT_JAR_LIST 2> /dev/null)"
+ if [ -n "$_OPTCLASSPATH" ] ; then
+ LOCALCLASSPATH="$LOCALCLASSPATH:$_OPTCLASSPATH"
+ fi
+ fi
+
+ # Explicitly add javac path to classpath, assume JAVA_HOME set
+ # properly in rpm mode
+ if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
+ LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar"
+ fi
+ if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
+ LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip"
+ fi
+
+ # if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be
+ # user CLASSPATH first and ant-found jars after.
+ # In that case, the user CLASSPATH will override ant-found jars
+ #
+ # if CLASSPATH_OVERRIDE is not set, we'll have the normal behaviour
+ # with ant-found jars first and user CLASSPATH after
+ if [ -n "$CLASSPATH" ] ; then
+ # merge local and specified classpath
+ if [ -z "$LOCALCLASSPATH" ] ; then
+ LOCALCLASSPATH="$CLASSPATH"
+ elif [ -n "$CLASSPATH_OVERRIDE" ] ; then
+ LOCALCLASSPATH="$CLASSPATH:$LOCALCLASSPATH"
+ else
+ LOCALCLASSPATH="$LOCALCLASSPATH:$CLASSPATH"
+ fi
+
+ # remove class path from launcher -cp option
+ CLASSPATH=""
+ fi
+else
+ # not using rpm_mode; use launcher to determine classpaths
+ if [ -z "$LOCALCLASSPATH" ] ; then
+ LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar
+ else
+ LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH
+ fi
+fi
+
+if [ -n "$JAVA_HOME" ] ; then
+ # OSX hack to make Ant work with jikes
+ if $darwin ; then
+ OSXHACK="${JAVA_HOME}/../Classes"
+ if [ -d "${OSXHACK}" ] ; then
+ for i in "${OSXHACK}"/*.jar
+ do
+ JIKESPATH="$JIKESPATH:$i"
+ done
+ fi
+ fi
+fi
+
+# Allow Jikes support (off by default)
+if $usejikes; then
+ ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
+fi
+
+# For Cygwin, switch paths to appropriate format before running java
+# For PATHs convert to unix format first, then to windows format to ensure
+# both formats are supported. Probably this will fail on directories with ;
+# in the name in the path. Let's assume that paths containing ; are more
+# rare than windows style paths on cygwin.
+if $cygwin; then
+ if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
+ format=mixed
+ else
+ format=windows
+ fi
+ ANT_HOME=`cygpath --$format "$ANT_HOME"`
+ ANT_LIB=`cygpath --$format "$ANT_LIB"`
+ JAVA_HOME=`cygpath --$format "$JAVA_HOME"`
+ LCP_TEMP=`cygpath --path --unix "$LOCALCLASSPATH"`
+ LOCALCLASSPATH=`cygpath --path --$format "$LCP_TEMP"`
+ if [ -n "$CLASSPATH" ] ; then
+ CP_TEMP=`cygpath --path --unix "$CLASSPATH"`
+ CLASSPATH=`cygpath --path --$format "$CP_TEMP"`
+ fi
+ CYGHOME=`cygpath --$format "$HOME"`
+fi
+
+# Show script help if requested
+if $show_help ; then
+ echo $0 '[script options] [options] [target [target2 [target3] ..]]'
+ echo 'Script Options:'
+ echo ' --help, --h print this message and ant help'
+ echo ' --noconfig suppress sourcing of /etc/ant.conf,'
+ echo ' $HOME/.ant/ant.conf, and $HOME/.antrc'
+ echo ' configuration files'
+ echo ' --usejikes enable use of jikes by default, unless'
+ echo ' set explicitly in configuration files'
+ echo ' --execdebug print ant exec line generated by this'
+ echo ' launch script'
+ echo ' '
+fi
+# add a second backslash to variables terminated by a backslash under cygwin
+if $cygwin; then
+ case "$ANT_HOME" in
+ *\\ )
+ ANT_HOME="$ANT_HOME\\"
+ ;;
+ esac
+ case "$CYGHOME" in
+ *\\ )
+ CYGHOME="$CYGHOME\\"
+ ;;
+ esac
+ case "$JIKESPATH" in
+ *\\ )
+ JIKESPATH="$JIKESPATH\\"
+ ;;
+ esac
+ case "$LOCALCLASSPATH" in
+ *\\ )
+ LOCALCLASSPATH="$LOCALCLASSPATH\\"
+ ;;
+ esac
+ case "$CLASSPATH" in
+ *\\ )
+ CLASSPATH="$CLASSPATH\\"
+ ;;
+ esac
+fi
+# Execute ant using eval/exec to preserve spaces in paths,
+# java options, and ant args
+ant_sys_opts=
+if [ -n "$CYGHOME" ]; then
+ if [ -n "$JIKESPATH" ]; then
+ ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\""
+ else
+ ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\""
+ fi
+else
+ if [ -n "$JIKESPATH" ]; then
+ ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\""
+ fi
+fi
+ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args"
+if $ant_exec_debug ; then
+ echo $ant_exec_command
+fi
+eval $ant_exec_command
@echo off\r
\r
-REM Copyright (c) 2001-2002 The Apache Software Foundation. All rights\r
-REM reserved.\r
+REM Copyright 2001,2004-2005 The Apache Software Foundation\r
+REM\r
+REM Licensed under the Apache License, Version 2.0 (the "License");\r
+REM you may not use this file except in compliance with the License.\r
+REM You may obtain a copy of the License at\r
+REM\r
+REM http://www.apache.org/licenses/LICENSE-2.0\r
+REM\r
+REM Unless required by applicable law or agreed to in writing, software\r
+REM distributed under the License is distributed on an "AS IS" BASIS,\r
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+REM See the License for the specific language governing permissions and\r
+REM limitations under the License.\r
\r
if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"\r
\r
if "%OS%"=="Windows_NT" @setlocal\r
+if "%OS%"=="WINNT" @setlocal\r
\r
rem %~dp0 is expanded pathname of the current script under NT\r
set DEFAULT_ANT_HOME=%~dp0..\r
if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%\r
set DEFAULT_ANT_HOME=\r
\r
-REM aspectJ disabled - separates -Dfoo=bar into -Dfoo bar\r
+set _USE_CLASSPATH=yes\r
+\r
rem Slurp the command line arguments. This loop allows for an unlimited number\r
rem of arguments (up to the command line limit, anyway).\r
-rem set ANT_CMD_LINE_ARGS=%1\r
-rem if ""%1""=="""" goto doneStart\r
-rem shift\r
-rem :setupArgs\r
-rem if ""%1""=="""" goto doneStart\r
-rem set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1\r
-rem shift\r
-rem goto setupArgs\r
-rem This label provides a place for the argument list loop to break out \r
+set ANT_CMD_LINE_ARGS=%1\r
+if ""%1""=="""" goto doneStart\r
+shift\r
+:setupArgs\r
+if ""%1""=="""" goto doneStart\r
+if ""%1""==""-noclasspath"" goto clearclasspath\r
+set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1\r
+shift\r
+goto setupArgs\r
+\r
+rem here is there is a -noclasspath in the options\r
+:clearclasspath\r
+set _USE_CLASSPATH=no\r
+shift\r
+goto setupArgs\r
+\r
+rem This label provides a place for the argument list loop to break out\r
rem and for NT handling to skip to.\r
-rem :doneStart\r
\r
+:doneStart\r
rem find ANT_HOME if it does not exist due to either an invalid value passed\r
rem by the user or the %0 problem on Windows 9x\r
-if exist "%ANT_HOME%" goto checkJava\r
+if exist "%ANT_HOME%\lib\ant.jar" goto checkJava\r
\r
-rem check for ant in Program Files on system drive\r
-if not exist "%SystemDrive%\Program Files\ant" goto checkSystemDrive\r
-set ANT_HOME=%SystemDrive%\Program Files\ant\r
+rem check for ant in Program Files\r
+if not exist "%ProgramFiles%\ant" goto checkSystemDrive\r
+set ANT_HOME=%ProgramFiles%\ant\r
goto checkJava\r
\r
:checkSystemDrive\r
rem check for ant in root directory of system drive\r
-if not exist %SystemDrive%\ant\nul goto checkCDrive\r
+if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive\r
set ANT_HOME=%SystemDrive%\ant\r
goto checkJava\r
\r
:checkCDrive\r
rem check for ant in C:\ant for Win9X users\r
-if not exist C:\ant\nul goto noAntHome\r
+if not exist C:\ant\lib\ant.jar goto noAntHome\r
set ANT_HOME=C:\ant\r
goto checkJava\r
\r
goto end\r
\r
:checkJava\r
-set LOCALCLASSPATH=%CLASSPATH%\r
-for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" %%i\r
-rem aspectj adding junit to everything...\r
-call "%ANT_HOME%\bin\lcp.bat" %ANT_HOME%\..\junit\junit.jar\r
+set _JAVACMD=%JAVACMD%\r
\r
if "%JAVA_HOME%" == "" goto noJavaHome\r
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome\r
-set _JAVACMD=%JAVA_HOME%\bin\java.exe\r
-if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat" %JAVA_HOME%\lib\tools.jar\r
-if exist "%JAVA_HOME%\lib\classes.zip" call "%ANT_HOME%\bin\lcp.bat" %JAVA_HOME%\lib\classes.zip\r
+if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe\r
goto checkJikes\r
\r
:noJavaHome\r
-set _JAVACMD=java.exe\r
-echo.\r
-echo Warning: JAVA_HOME environment variable is not set.\r
-echo If build fails because sun.* classes could not be found\r
-echo you will need to set the JAVA_HOME environment variable\r
-echo to the installation directory of java.\r
-echo.\r
+if "%_JAVACMD%" == "" set _JAVACMD=java.exe\r
\r
:checkJikes\r
if not "%JIKESPATH%"=="" goto runAntWithJikes\r
\r
:runAnt\r
-REM aspectJ increased max heap size for test purposes.\r
-"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" -Xmx1024M %ANT_OPTS% org.apache.tools.ant.Main %*\r
+if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath\r
+if not "%CLASSPATH%"=="" goto runAntWithClasspath\r
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%\r
+goto end\r
+\r
+:runAntNoClasspath\r
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%\r
+goto end\r
+\r
+:runAntWithClasspath\r
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%\r
goto end\r
\r
:runAntWithJikes\r
-"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %*\r
+if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath\r
+if not "%CLASSPATH%"=="" goto runAntWithJikesAndClasspath\r
+\r
+:runAntWithJikesNoClasspath\r
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%\r
+goto end\r
+\r
+:runAntWithJikesAndClasspath\r
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%\r
goto end\r
\r
:end\r
-set LOCALCLASSPATH=\r
set _JAVACMD=\r
set ANT_CMD_LINE_ARGS=\r
\r
if "%OS%"=="Windows_NT" @endlocal\r
+if "%OS%"=="WINNT" @endlocal\r
\r
:mainEnd\r
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"\r
-#! /bin/sh\r
-\r
-# Copyright (c) 2001-2002 The Apache Software Foundation. All rights\r
-# reserved.\r
-\r
-# Args: DIR command\r
-cd "$1"\r
-CMD="$2"\r
-shift\r
-shift\r
-\r
-exec "$CMD" "$@"\r
+#!/bin/sh
+
+#
+# Copyright 2001-2002,2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+# Args: DIR command
+cd "$1"
+CMD="$2"
+shift
+shift
+
+exec "$CMD" "$@"
@echo off\r
\r
-REM Copyright (c) 2001-2002 The Apache Software Foundation. All rights\r
-REM reserved.\r
+REM\r
+REM Copyright 2001-2002,2004-2005 The Apache Software Foundation\r
+REM\r
+REM Licensed under the Apache License, Version 2.0 (the "License");\r
+REM you may not use this file except in compliance with the License.\r
+REM You may obtain a copy of the License at\r
+REM\r
+REM http://www.apache.org/licenses/LICENSE-2.0\r
+REM\r
+REM Unless required by applicable law or agreed to in writing, software\r
+REM distributed under the License is distributed on an "AS IS" BASIS,\r
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+REM See the License for the specific language governing permissions and\r
+REM limitations under the License.\r
+REM\r
+REM\r
\r
if "%OS%"=="Windows_NT" @setlocal\r
+if "%OS%"=="WINNT" @setlocal\r
\r
if ""%1""=="""" goto runCommand\r
\r
%ANT_RUN_CMD%\r
\r
if "%OS%"=="Windows_NT" @endlocal\r
+if "%OS%"=="WINNT" @endlocal\r
\r
-#!/usr/bin/perl\r
-#######################################################################\r
-#\r
-# antRun.pl\r
-#\r
-# wrapper script for invoking commands on a platform with Perl installed\r
-# this is akin to antRun.bat, and antRun the SH script \r
-#\r
-# created: 2001-10-18\r
-# last modified: 2001-11-13\r
-# author: Jeff Tulley jtulley@novell.com \r
-#######################################################################\r
-#be fussy about variables\r
-use strict;\r
-\r
-#turn warnings on during dev; generates a few spurious uninitialised var access warnings\r
-#use warnings;\r
-\r
-#and set $debug to 1 to turn on trace info (currently unused)\r
-my $debug=1;\r
-\r
-#######################################################################\r
-# change drive and directory to "%1"\r
-my $ANT_RUN_CMD = @ARGV[0];\r
-\r
-# assign current run command to "%2"\r
-chdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";\r
-if ($^O eq "NetWare") {\r
- # There is a bug in Perl 5 on NetWare, where chdir does not\r
- # do anything. On NetWare, the following path-prefixed form should \r
- # always work. (afaict)\r
- $ANT_RUN_CMD .= "/".@ARGV[1];\r
-}\r
-else {\r
- $ANT_RUN_CMD = @ARGV[1];\r
-}\r
-\r
-# dispose of the first two arguments, leaving only the command's args.\r
-shift;\r
-shift;\r
-\r
-# run the command\r
-my $returnValue = system $ANT_RUN_CMD, @ARGV;\r
-if ($returnValue eq 0) {\r
- exit 0;\r
-}\r
-else {\r
- # only 0 and 1 are widely recognized as exit values\r
- # so change the exit value to 1\r
- exit 1;\r
-}\r
+#!/usr/bin/perl
+#
+# Copyright 2001,2003-2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#######################################################################
+#
+# antRun.pl
+#
+# wrapper script for invoking commands on a platform with Perl installed
+# this is akin to antRun.bat, and antRun the SH script
+#
+# created: 2001-10-18
+# author: Jeff Tulley jtulley@novell.com
+#######################################################################
+#be fussy about variables
+use strict;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info (currently unused)
+my $debug=1;
+
+#######################################################################
+# change drive and directory to "%1"
+my $ANT_RUN_CMD = @ARGV[0];
+
+# assign current run command to "%2"
+chdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";
+if ($^O eq "NetWare") {
+ # There is a bug in Perl 5 on NetWare, where chdir does not
+ # do anything. On NetWare, the following path-prefixed form should
+ # always work. (afaict)
+ $ANT_RUN_CMD .= "/".@ARGV[1];
+}
+else {
+ $ANT_RUN_CMD = @ARGV[1];
+}
+
+# dispose of the first two arguments, leaving only the command's args.
+shift;
+shift;
+
+# run the command
+my $returnValue = system $ANT_RUN_CMD, @ARGV;
+if ($returnValue eq 0) {
+ exit 0;
+}
+else {
+ # only 0 and 1 are widely recognized as exit values
+ # so change the exit value to 1
+ exit 1;
+}
-#!/usr/bin/perl\r
-#\r
-# Copyright (c) 2001 The Apache Software Foundation. All rights\r
-# reserved.\r
-#\r
-# A script to allow Bash or Z-Shell to complete an Ant command-line. \r
-#\r
-# To install for Bash 2.0 or better, add the following to ~/.bashrc:\r
-# \r
-# $ complete -C complete-ant-cmd ant build.sh\r
-#\r
-# To install for Z-Shell 2.5 or better, add the following to ~/.zshrc:\r
-#\r
-# function ant_complete () {\r
-# local args_line args\r
-# read -l args_line\r
-# set -A args $args_line\r
-# set -A reply $(COMP_LINE=$args_line complete-ant-cmd ${args[1]} $1)\r
-# }\r
-# compctl -K ant_complete ant build.sh\r
-# \r
-# @author Mike Williams <mikew@cortexebusiness.com.au>\r
-\r
-my $cmdLine = $ENV{'COMP_LINE'};\r
-my $antCmd = $ARGV[0];\r
-my $word = $ARGV[1];\r
-\r
-my @completions;\r
-if ($word =~ /^-/) {\r
- list( restrict( $word, getArguments() ));\r
-} elsif ($cmdLine =~ /-(f|buildfile)\s+\S*$/) {\r
- list( getBuildFiles($word) );\r
-} else {\r
- list( restrict( $word, getTargets() ));\r
-}\r
-\r
-exit(0);\r
-\r
-sub list {\r
- for (@_) {\r
- print "$_\n";\r
- }\r
-}\r
-\r
-sub restrict {\r
- my ($word, @completions) = @_;\r
- grep( /^\Q$word\E/, @completions );\r
-}\r
-\r
-sub getArguments {\r
- qw(-buildfile -debug -emacs -f -find -help -listener -logfile \r
- -logger -projecthelp -quiet -verbose -version); \r
-}\r
-\r
-\r
-sub getBuildFiles {\r
- my ($word) = @_;\r
- grep( /\.xml$/, glob( "$word*" ));\r
-}\r
-\r
-sub getTargets {\r
-\r
- # Look for build-file\r
- my $buildFile = 'build.xml';\r
- if ($cmdLine =~ /-(f|buildfile)\s+(\S+)/) {\r
- $buildFile = $2;\r
- }\r
- return () unless (-f $buildFile);\r
-\r
- # Run "ant -projecthelp" to list targets. Keep a cache of results in a\r
- # cache-file.\r
- my $cacheFile = $buildFile;\r
- $cacheFile =~ s|(.*/)?(.*)|${1}.ant-targets-${2}|;\r
- if ((!-e $cacheFile) || (-M $buildFile) < (-M $cacheFile)) {\r
- open( CACHE, '>'.$cacheFile ) || die "can\'t write $cacheFile: $!\n";\r
- open( HELP, "$antCmd -projecthelp -f '$buildFile'|" ) || return(); \r
- my %targets;\r
- while( <HELP> ) {\r
- if (/^\s+(\S+)/) {\r
- $targets{$1}++;\r
- }\r
- }\r
- my @targets = sort keys %targets;\r
- for (@targets) { print CACHE "$_\n"; }\r
- return @targets;\r
- }\r
- \r
- # Read the target-cache\r
- open( CACHE, $cacheFile ) || die "can\'t read $cacheFile: $!\n";\r
- my @targets;\r
- while (<CACHE>) {\r
- chop;\r
- s/\r$//; # for Cygwin\r
- push( @targets, $_ );\r
- }\r
- close( CACHE );\r
- @targets;\r
-\r
-}\r
-\r
-\r
-\r
+#!/usr/bin/perl
+#
+# Copyright 2001,2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# A script to allow Bash or Z-Shell to complete an Ant command-line.
+#
+# To install for Bash 2.0 or better, add the following to ~/.bashrc:
+#
+# $ complete -C complete-ant-cmd ant build.sh
+#
+# To install for Z-Shell 2.5 or better, add the following to ~/.zshrc:
+#
+# function ant_complete () {
+# local args_line args
+# read -l args_line
+# set -A args $args_line
+# set -A reply $(COMP_LINE=$args_line complete-ant-cmd ${args[1]} $1)
+# }
+# compctl -K ant_complete ant build.sh
+#
+# @author Mike Williams <mikew@cortexebusiness.com.au>
+
+my $cmdLine = $ENV{'COMP_LINE'};
+my $antCmd = $ARGV[0];
+my $word = $ARGV[1];
+
+my @completions;
+if ($word =~ /^-/) {
+ list( restrict( $word, getArguments() ));
+} elsif ($cmdLine =~ /-(f|buildfile)\s+\S*$/) {
+ list( getBuildFiles($word) );
+} else {
+ list( restrict( $word, getTargets() ));
+}
+
+exit(0);
+
+sub list {
+ for (@_) {
+ print "$_\n";
+ }
+}
+
+sub restrict {
+ my ($word, @completions) = @_;
+ grep( /^\Q$word\E/, @completions );
+}
+
+sub getArguments {
+ qw(-buildfile -debug -emacs -f -find -help -listener -logfile
+ -logger -projecthelp -quiet -verbose -version);
+}
+
+
+sub getBuildFiles {
+ my ($word) = @_;
+ grep( /\.xml$/, glob( "$word*" ));
+}
+
+sub getTargets {
+
+ # Look for build-file
+ my $buildFile = 'build.xml';
+ if ($cmdLine =~ /-(f|buildfile)\s+(\S+)/) {
+ $buildFile = $2;
+ }
+ return () unless (-f $buildFile);
+
+ # Run "ant -projecthelp" to list targets. Keep a cache of results in a
+ # cache-file.
+ my $cacheFile = $buildFile;
+ $cacheFile =~ s|(.*/)?(.*)|${1}.ant-targets-${2}|;
+ if ((!-e $cacheFile) || (-M $buildFile) < (-M $cacheFile)) {
+ open( CACHE, '>'.$cacheFile ) || die "can\'t write $cacheFile: $!\n";
+ open( HELP, "$antCmd -projecthelp -f '$buildFile'|" ) || return();
+ my %targets;
+ while( <HELP> ) {
+ if (/^\s+(\S+)/) {
+ $targets{$1}++;
+ }
+ }
+ my @targets = sort keys %targets;
+ for (@targets) { print CACHE "$_\n"; }
+ return @targets;
+ }
+
+ # Read the target-cache
+ open( CACHE, $cacheFile ) || die "can\'t read $cacheFile: $!\n";
+ my @targets;
+ while (<CACHE>) {
+ chop;
+ s/\r$//; # for Cygwin
+ push( @targets, $_ );
+ }
+ close( CACHE );
+ @targets;
+
+}
+
+
+
-REM Copyright (c) 2001-2002 The Apache Software Foundation. All rights\r
-REM reserved.\r
+REM\r
+REM Copyright 2001-2004 The Apache Software Foundation\r
+REM\r
+REM Licensed under the Apache License, Version 2.0 (the "License");\r
+REM you may not use this file except in compliance with the License.\r
+REM You may obtain a copy of the License at\r
+REM\r
+REM http://www.apache.org/licenses/LICENSE-2.0\r
+REM\r
+REM Unless required by applicable law or agreed to in writing, software\r
+REM distributed under the License is distributed on an "AS IS" BASIS,\r
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+REM See the License for the specific language governing permissions and\r
+REM limitations under the License.\r
+REM\r
+REM\r
\r
set _CLASSPATHCOMPONENT=%1\r
if ""%1""=="""" goto gotAllArgs\r
-#!/usr/bin/perl\r
-#\r
-# Copyright (c) 2001-2002 The Apache Software Foundation. All rights\r
-# reserved.\r
-#\r
-#######################################################################\r
-#\r
-# runant.pl\r
-#\r
-# wrapper script for invoking ant in a platform with Perl installed\r
-# this may include cgi-bin invocation, which is considered somewhat daft.\r
-# (slo: that should be a separate file which can be derived from this\r
-# and returns the XML formatted output)\r
-#\r
-# the code is not totally portable due to classpath and directory splitting\r
-# issues. oops. (NB, use File::Spec::Functions will help and the code is\r
-# structured for the catfile() call, but because of perl version funnies\r
-# the code is not included. \r
-#\r
-# created: 2000-8-24\r
-# last modified: 2000-8-24\r
-# author: Steve Loughran steve_l@sourceforge.net\r
-#######################################################################\r
-#\r
-# Assumptions:\r
-#\r
-# - the "java" executable/script is on the command path\r
-# - ANT_HOME has been set\r
-# - target platform uses ":" as classpath separator or perl indicates it is dos/win32\r
-# - target platform uses "/" as directory separator.\r
-\r
-#be fussy about variables\r
-use strict;\r
-\r
-#platform specifics (disabled)\r
-#use File::Spec::Functions;\r
-\r
-#turn warnings on during dev; generates a few spurious uninitialised var access warnings\r
-#use warnings;\r
-\r
-#and set $debug to 1 to turn on trace info\r
-my $debug=0;\r
-\r
-#######################################################################\r
-#\r
-# check to make sure environment is setup\r
-#\r
-\r
-my $HOME = $ENV{ANT_HOME};\r
-if ($HOME eq "")\r
- {\r
- die "\n\nANT_HOME *MUST* be set!\n\n";\r
- }\r
-\r
-my $JAVACMD = $ENV{JAVACMD};\r
-$JAVACMD = "java" if $JAVACMD eq "";\r
-\r
-my $onnetware = 0;\r
-if ($^O eq "NetWare")\r
-{\r
- $onnetware = 1;\r
-}\r
-\r
-#ISSUE: what java wants to split up classpath varies from platform to platform \r
-#and perl is not too hot at hinting which box it is on.\r
-#here I assume ":" 'cept on win32, dos, and netware. Add extra tests here as needed.\r
-my $s=":";\r
-if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin") ||\r
- ($onnetware == 1))\r
- {\r
- $s=";";\r
- }\r
-\r
-#build up standard classpath\r
-my $localpath=$ENV{CLASSPATH};\r
-if ($localpath eq "")\r
- {\r
- print "warning: no initial classpath\n" if ($debug);\r
- $localpath="";\r
- }\r
-if ($onnetware == 1)\r
-{\r
-# avoid building a command line bigger than 512 characters - make localpath\r
-# only include the "extra" stuff, and add in the system classpath as an expanded\r
-# variable. \r
- $localpath="";\r
-} \r
-\r
-#add jar files. I am sure there is a perl one liner to do this.\r
-my $jarpattern="$HOME/lib/*.jar";\r
-my @jarfiles =glob($jarpattern);\r
-print "jarfiles=@jarfiles\n" if ($debug);\r
-my $jar;\r
-foreach $jar (@jarfiles )\r
- {\r
- $localpath.="$s$jar";\r
- }\r
-\r
-#if Java home is defined, look for tools.jar & classes.zip and add to classpath\r
-my $JAVA_HOME = $ENV{JAVA_HOME};\r
-if ($JAVA_HOME ne "")\r
- {\r
- my $tools="$JAVA_HOME/lib/tools.jar";\r
- if (-e "$tools")\r
- {\r
- $localpath .= "$s$tools";\r
- }\r
- my $classes="$JAVA_HOME/lib/classes.zip";\r
- if (-e $classes)\r
- {\r
- $localpath .= "$s$classes";\r
- }\r
- }\r
-else\r
- {\r
- print "\n\nWarning: JAVA_HOME environment variable is not set.\n".\r
- "If the build fails because sun.* classes could not be found\n".\r
- "you will need to set the JAVA_HOME environment variable\n".\r
- "to the installation directory of java\n";\r
- }\r
-\r
-#set JVM options and Ant arguments, if any\r
-my @ANT_OPTS=split(" ", $ENV{ANT_OPTS});\r
-my @ANT_ARGS=split(" ", $ENV{ANT_ARGS});\r
-\r
-#jikes\r
-if($ENV{JIKESPATH} ne "")\r
- {\r
- push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";\r
- }\r
-\r
-#construct arguments to java\r
-my @ARGS;\r
-if ($onnetware == 1)\r
-{\r
-# make classpath literally $CLASSPATH; and then the contents of $localpath\r
-# this is to avoid pushing us over the 512 character limit\r
-# even skip the ; - that is already in $localpath\r
- push @ARGS, "-classpath", "\$CLASSPATH$localpath";\r
-}\r
-else\r
-{\r
- push @ARGS, "-classpath", "$localpath";\r
-}\r
-push @ARGS, "-Dant.home=$HOME";\r
-push @ARGS, @ANT_OPTS;\r
-push @ARGS, "org.apache.tools.ant.Main", @ANT_ARGS;\r
-push @ARGS, @ARGV;\r
-\r
-print "\n $JAVACMD @ARGS\n\n" if ($debug);\r
-\r
-my $returnValue = system $JAVACMD, @ARGS;\r
-if ($returnValue eq 0)\r
- {\r
- exit 0;\r
- }\r
-else\r
- {\r
- # only 0 and 1 are widely recognized as exit values\r
- # so change the exit value to 1\r
- exit 1;\r
- }\r
+#!/usr/bin/perl
+#
+# Copyright 2000-2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#######################################################################
+#
+# runant.pl
+#
+# wrapper script for invoking ant in a platform with Perl installed
+# this may include cgi-bin invocation, which is considered somewhat daft.
+# (slo: that should be a separate file which can be derived from this
+# and returns the XML formatted output)
+#
+# the code is not totally portable due to classpath and directory splitting
+# issues. oops. (NB, use File::Spec::Functions will help and the code is
+# structured for the catfile() call, but because of perl version funnies
+# the code is not included.
+#
+# created: 2000-8-24
+# author: Steve Loughran steve_l@sourceforge.net
+#######################################################################
+#
+# Assumptions:
+#
+# - the "java" executable/script is on the command path
+# - ANT_HOME has been set
+# - target platform uses ":" as classpath separator or perl indicates it is dos/win32
+# - target platform uses "/" as directory separator.
+
+#be fussy about variables
+use strict;
+
+#platform specifics (disabled)
+#use File::Spec::Functions;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info
+my $debug=1;
+
+#######################################################################
+#
+# check to make sure environment is setup
+#
+
+my $HOME = $ENV{ANT_HOME};
+if ($HOME eq "")
+ {
+ die "\n\nANT_HOME *MUST* be set!\n\n";
+ }
+
+my $JAVACMD = $ENV{JAVACMD};
+$JAVACMD = "java" if $JAVACMD eq "";
+
+my $onnetware = 0;
+if ($^O eq "NetWare")
+{
+ $onnetware = 1;
+}
+
+my $oncygwin = ($^O eq "cygwin");
+
+#ISSUE: what java wants to split up classpath varies from platform to platform
+#and perl is not too hot at hinting which box it is on.
+#here I assume ":" 'cept on win32, dos, and netware. Add extra tests here as needed.
+my $s=":";
+if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin") ||
+ ($onnetware == 1))
+ {
+ $s=";";
+ }
+
+#build up standard classpath
+my $localpath = "$HOME/lib/ant-launcher.jar";
+#set JVM options and Ant arguments, if any
+my @ANT_OPTS=split(" ", $ENV{ANT_OPTS});
+my @ANT_ARGS=split(" ", $ENV{ANT_ARGS});
+
+#jikes
+if($ENV{JIKESPATH} ne "")
+ {
+ push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";
+ }
+
+#construct arguments to java
+my @ARGS;
+push @ARGS, @ANT_OPTS;
+
+my $CYGHOME = "";
+
+my $classpath=$ENV{CLASSPATH};
+if ($oncygwin == 1) {
+ $localpath = `cygpath --path --windows $localpath`;
+ chomp ($localpath);
+ if (! $classpath eq "")
+ {
+ $classpath = `cygpath --path --windows "$classpath"`;
+ chomp ($classpath);
+ }
+ $HOME = `cygpath --path --windows $HOME`;
+ chomp ($HOME);
+ $CYGHOME = `cygpath --path --windows $ENV{HOME}`;
+ chomp ($CYGHOME);
+}
+push @ARGS, "-classpath", "$localpath";
+push @ARGS, "-Dant.home=$HOME";
+if ( ! $CYGHOME eq "" )
+{
+ push @ARGS, "-Dcygwin.user.home=\"$CYGHOME\""
+}
+push @ARGS, "org.apache.tools.ant.launch.Launcher", @ANT_ARGS;
+push @ARGS, @ARGV;
+if (! $classpath eq "")
+{
+ if ($onnetware == 1)
+ {
+ # make classpath literally $CLASSPATH
+ # this is to avoid pushing us over the 512 character limit
+ # even skip the ; - that is already in $localpath
+ push @ARGS, "-lib", "\$CLASSPATH";
+ }
+ else
+ {
+ push @ARGS, "-lib", "$classpath";
+ }
+}
+print "\n $JAVACMD @ARGS\n\n" if ($debug);
+
+my $returnValue = system $JAVACMD, @ARGS;
+if ($returnValue eq 0)
+ {
+ exit 0;
+ }
+else
+ {
+ # only 0 and 1 are widely recognized as exit values
+ # so change the exit value to 1
+ exit 1;
+ }
-#!/usr/bin/python\r
-"""\r
-\r
- runant.py\r
-\r
- This script is a translation of the runant.pl written by Steve Loughran.\r
- It runs ant with/out arguments, it should be quite portable (thanks to\r
- the python os library)\r
- This script has been tested with Python2.0/Win2K\r
-\r
- Copyright (c) 2001 The Apache Software Foundation. All rights\r
- reserved.\r
-\r
- created: 2001-04-11\r
- author: Pierre Dittgen pierre.dittgen@criltelecom.com\r
-\r
- Assumptions:\r
-\r
- - the "java" executable/script is on the command path\r
- - ANT_HOME has been set\r
-"""\r
-import os, os.path, string, sys\r
-\r
-# Change it to 1 to get extra debug information\r
-debug = 0\r
-\r
-#######################################################################\r
-#\r
-# check to make sure environment is setup\r
-#\r
-if not os.environ.has_key('ANT_HOME'):\r
- print '\n\nANT_HOME *MUST* be set!\n\n'\r
- sys.exit(1)\r
-else:\r
- ANT_HOME = os.environ['ANT_HOME']\r
-\r
-if not os.environ.has_key('JAVACMD'):\r
- JAVACMD = 'java'\r
-else:\r
- JAVACMD = os.environ['JAVACMD']\r
-\r
-# Sets the separator char for CLASSPATH\r
-SEPARATOR = ':'\r
-if os.name == 'dos' or os.name == 'nt':\r
- SEPARATOR = ';'\r
-\r
-# Build up standard classpath\r
-localpath = ''\r
-if os.environ.has_key('CLASSPATH'):\r
- localpath = os.environ['CLASSPATH']\r
-else:\r
- if debug:\r
- print 'Warning: no initial classpath\n'\r
-\r
-# Add jar files\r
-LIBDIR = os.path.join(ANT_HOME, 'lib')\r
-jarfiles = []\r
-for file in os.listdir(LIBDIR):\r
- if file[-4:] == '.jar':\r
- jarfiles.append(os.path.join(LIBDIR,file))\r
-if debug:\r
- print 'Jar files:'\r
- for jar in jarfiles:\r
- print jar\r
-localpath = localpath + SEPARATOR + string.join(jarfiles, SEPARATOR)\r
-\r
-# If JAVA_HOME is defined, look for tools.jar & classes.zip\r
-# and add to classpath\r
-if os.environ.has_key('JAVA_HOME') and os.environ['JAVA_HOME'] != '':\r
- JAVA_HOME = os.environ['JAVA_HOME']\r
- TOOLS = os.path.join(JAVA_HOME, os.path.join('lib', 'tools.jar'))\r
- if os.path.exists(TOOLS):\r
- localpath = localpath + SEPARATOR + TOOLS\r
- CLASSES = os.path.join(JAVA_HOME, os.path.join('lib', 'classes.zip'))\r
- if os.path.exists(CLASSES):\r
- localpath = localpath + SEPARATOR + CLASSES\r
-else:\r
- print '\n\nWarning: JAVA_HOME environment variable is not set.\n', \\r
- 'If the build fails because sun.* classes could not be found\n', \\r
- 'you will need to set the JAVA_HOME environment variable\n', \\r
- 'to the installation directory of java\n'\r
-\r
-# Jikes\r
-ANT_OPTS = []\r
-if os.environ.has_key('ANT_OPTS'):\r
- ANT_OPTS = string.split(os.environ['ANT_OPTS'])\r
-if os.environ.has_key('JIKESPATH'):\r
- ANT_OPTS.append('-Djikes.class.path=' + os.environ['JIKESPATH'])\r
-\r
-# Builds the commandline\r
-cmdline = '%s -classpath %s -Dant.home=%s %s org.apache.tools.ant.Main %s' \\r
- % (JAVACMD, localpath, ANT_HOME, string.join(ANT_OPTS,' '), \\r
- string.join(sys.argv[1:], ' '))\r
-\r
-if debug:\r
- print '\n%s\n\n' % (cmdline)\r
-\r
-# Run the biniou!\r
-os.system(cmdline)\r
+#!/usr/bin/python
+# Copyright 2001,2003-2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""
+
+ runant.py
+
+ This script is a translation of the runant.pl written by Steve Loughran.
+ It runs ant with/out arguments, it should be quite portable (thanks to
+ the python os library)
+ This script has been tested with Python2.0/Win2K
+
+ created: 2001-04-11
+ author: Pierre Dittgen pierre.dittgen@criltelecom.com
+
+ Assumptions:
+
+ - the "java" executable/script is on the command path
+"""
+import os, os.path, string, sys
+
+# Change it to 1 to get extra debug information
+debug = 0
+
+#######################################################################
+
+# If ANT_HOME is not set default to script's parent directory
+if os.environ.has_key('ANT_HOME'):
+ ANT_HOME = os.environ['ANT_HOME']
+else:
+ ANT_HOME = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
+
+# set ANT_LIB location
+ANT_LIB = os.path.join(ANT_HOME, 'lib')
+
+# set JAVACMD (check variables JAVACMD and JAVA_HOME)
+JAVACMD = None
+if not os.environ.has_key('JAVACMD'):
+ if os.environ.has_key('JAVA_HOME'):
+ if not os.path.exists(os.environ['JAVA_HOME']):
+ print "Warning: JAVA_HOME is not defined correctly."
+ else:
+ JAVACMD = os.path.join(os.environ['JAVA_HOME'], 'bin', 'java')
+ else:
+ print "Warning: JAVA_HOME not set."
+else:
+ JAVACMD = os.environ['JAVACMD']
+if not JAVACMD:
+ JAVACMD = 'java'
+
+launcher_jar = os.path.join(ANT_LIB, 'ant-launcher.jar')
+if not os.path.exists(launcher_jar):
+ print 'Unable to locate ant-launcher.jar. Expected to find it in %s' % \
+ ANT_LIB
+
+# Build up standard classpath (LOCALCLASSPATH)
+LOCALCLASSPATH = launcher_jar
+if os.environ.has_key('LOCALCLASSPATH'):
+ LOCALCLASSPATH += os.pathsep + os.environ['LOCALCLASSPATH']
+
+ANT_OPTS = ""
+if os.environ.has_key('ANT_OPTS'):
+ ANT_OPTS = os.environ['ANT_OPTS']
+
+OPTS = ""
+if os.environ.has_key('JIKESPATH'):
+ OPTS = '-Djikes.class.path=\"%s\"' % os.environ['JIKESPATH']
+
+ANT_ARGS = ""
+if os.environ.has_key('ANT_ARGS'):
+ ANT_ARGS = os.environ['ANT_ARGS']
+
+CLASSPATH = ""
+if os.environ.has_key('CLASSPATH'):
+ CLASSPATH = os.environ['CLASSPATH']
+
+# Builds the commandline
+cmdline = ('%s %s -classpath %s -Dant.home=%s %s ' + \
+ 'org.apache.tools.ant.launch.Launcher %s -lib %s %s') \
+ % (JAVACMD, ANT_OPTS, LOCALCLASSPATH, ANT_HOME, OPTS, ANT_ARGS, \
+ CLASSPATH, string.join(sys.argv[1:], ' '))
+
+if debug:
+ print '\n%s\n\n' % (cmdline)
+
+# Run the biniou!
+os.system(cmdline)