--- /dev/null
+#! /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
+\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
+# 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
+ "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Dcygwin.user.home="$CYGHOME" $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
+ "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"\r
+ fi\r
+fi\r
+\r
--- /dev/null
+rem XXX @echo off\r
+\r
+REM Copyright (c) 2001-2002 The Apache Software Foundation. All rights\r
+REM reserved.\r
+\r
+if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"\r
+\r
+if "%OS%"=="Windows_NT" @setlocal\r
+\r
+rem %~dp0 is expanded pathname of the current script under NT\r
+set DEFAULT_ANT_HOME=%~dp0..\r
+\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
+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
+rem and for NT handling to skip to.\r
+rem :doneStart\r
+\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
+\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
+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
+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
+set ANT_HOME=C:\ant\r
+goto checkJava\r
+\r
+:noAntHome\r
+echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.\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
+\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
+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
+\r
+:checkJikes\r
+if not "%JIKESPATH%"=="" goto runAntWithJikes\r
+\r
+:runAnt\r
+"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %*\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
+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
+\r
+:mainEnd\r
+if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"\r
+\r
--- /dev/null
+#! /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
--- /dev/null
+@echo off\r
+\r
+REM Copyright (c) 2001-2002 The Apache Software Foundation. All rights\r
+REM reserved.\r
+\r
+if "%OS%"=="Windows_NT" @setlocal\r
+\r
+if ""%1""=="""" goto runCommand\r
+\r
+rem Change drive and directory to %1\r
+if "%OS%"=="Windows_NT" cd /d ""%1""\r
+if not "%OS%"=="Windows_NT" cd ""%1""\r
+shift\r
+\r
+rem Slurp the command line arguments. This loop allows for an unlimited number\r
+rem of agruments (up to the command line limit, anyway).\r
+set ANT_RUN_CMD=%1\r
+if ""%1""=="""" goto runCommand\r
+shift\r
+:loop\r
+if ""%1""=="""" goto runCommand\r
+set ANT_RUN_CMD=%ANT_RUN_CMD% %1\r
+shift\r
+goto loop\r
+\r
+:runCommand\r
+rem echo %ANT_RUN_CMD%\r
+%ANT_RUN_CMD%\r
+\r
+if "%OS%"=="Windows_NT" @endlocal\r
+\r
--- /dev/null
+#!/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
--- /dev/null
+#!/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
--- /dev/null
+REM Copyright (c) 2001-2002 The Apache Software Foundation. All rights\r
+REM reserved.\r
+\r
+set _CLASSPATHCOMPONENT=%1\r
+if ""%1""=="""" goto gotAllArgs\r
+shift\r
+\r
+:argCheck\r
+if ""%1""=="""" goto gotAllArgs\r
+set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1\r
+shift\r
+goto argCheck\r
+\r
+:gotAllArgs\r
+set LOCALCLASSPATH=%_CLASSPATHCOMPONENT%;%LOCALCLASSPATH%\r
+\r
--- /dev/null
+#!/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
--- /dev/null
+#!/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