Author: vgritsenko Date: Sat Nov 11 20:20:02 2006 New Revision: 473869 URL: http://svn.apache.org/viewvc?view=rev&rev=473869 Log: update ant to 1.6.5
Added: xml/xindice/trunk/tools/bin/ant.cmd (with props) xml/xindice/trunk/tools/bin/antenv.cmd (with props) xml/xindice/trunk/tools/bin/envset.cmd (with props) xml/xindice/trunk/tools/bin/runrc.cmd (with props) xml/xindice/trunk/tools/lib/ant-1.6.5-junit.jar (with props) xml/xindice/trunk/tools/lib/ant-1.6.5-trax.jar (with props) xml/xindice/trunk/tools/lib/ant-1.6.5.jar (with props) xml/xindice/trunk/tools/lib/ant-launcher.jar (with props) Removed: xml/xindice/trunk/tools/lib/ant-1.5.3-optional.jar xml/xindice/trunk/tools/lib/ant-1.5.3.jar Modified: xml/xindice/trunk/status.xml xml/xindice/trunk/tools/bin/ant xml/xindice/trunk/tools/bin/ant.bat (contents, props changed) xml/xindice/trunk/tools/bin/antRun xml/xindice/trunk/tools/bin/antRun.bat (contents, props changed) xml/xindice/trunk/tools/bin/antRun.pl xml/xindice/trunk/tools/bin/complete-ant-cmd.pl xml/xindice/trunk/tools/bin/lcp.bat (contents, props changed) xml/xindice/trunk/tools/bin/runant.pl xml/xindice/trunk/tools/bin/runant.py Modified: xml/xindice/trunk/status.xml URL: http://svn.apache.org/viewvc/xml/xindice/trunk/status.xml?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/status.xml (original) +++ xml/xindice/trunk/status.xml Sat Nov 11 20:20:02 2006 @@ -75,10 +75,13 @@ <changes> <release version="1.1b5-dev" date="Oct 27 2006"> + <action dev="VG" type="update"> + Update Ant to 1.6.5 version. + </action> <action dev="TB" type="fix" fixes-bug="40931"> - Fixed XMLTools to only print out the help menu when - needed. Also added the ability to set pagecount from - the command line. + Fixed XMLTools to only print out the help menu when + needed. Also added the ability to set pagecount from + the command line. </action> <action dev="VG" type="fix" fixes-bug="31974"> Fix exception executing xpath query in collections with Modified: xml/xindice/trunk/tools/bin/ant URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/ant?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/ant (original) +++ xml/xindice/trunk/tools/bin/ant Sat Nov 11 20:20:02 2006 @@ -1,24 +1,77 @@ #! /bin/sh -# Copyright (c) 2001-2003 The Apache Software Foundation. All rights -# reserved. +# 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 -# load system-wide ant configuration -if [ -f "/etc/ant.conf" ] ; then - . /etc/ant.conf -fi +# 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 -# provide default values for people who don't use RPMs -if [ -z "$rpm_mode" ] ; then - rpm_mode=false; -fi -if [ -z "$usejikes" ] ; then - usejikes=false; + # 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 -# load user ant configuration -if [ -f "$HOME/.antrc" ] ; then - . $HOME/.antrc +# 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. @@ -28,146 +81,131 @@ CYGWIN*) cygwin=true ;; Darwin*) darwin=true if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home + JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home fi ;; esac -if [ -z "$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 - +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` - saveddir=`pwd` + PRG="$0" + progname=`basename "$0"` # need this for relative symlinks - cd `dirname $PRG` - while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" else - PRG="`dirname $PRG`/$link" + PRG=`dirname "$PRG"`"/$link" fi done - + ANT_HOME=`dirname "$PRG"`/.. # make it fully qualified ANT_HOME=`cd "$ANT_HOME" && pwd` - - cd $saveddir fi -# set ANT_LIB location -ANT_LIB=${ANT_HOME}/lib - # 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"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` fi -if [ -z "$JAVACMD" ] ; then +# 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 + 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=java + 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 -if [ -n "$CLASSPATH" ] ; then - LOCALCLASSPATH="$CLASSPATH" -fi - -# in rpm_mode get ant/optional/xml parser&api from JAVALIBDIR -if $rpm_mode; then - JAVALIBDIR=/usr/share/java - for i in ant ant-optional jaxp_parser xml_apis - do - if [ -z "$LOCALCLASSPATH" ] ; then - LOCALCLASSPATH=$JAVALIBDIR/$i.jar - else - LOCALCLASSPATH="$JAVALIBDIR/$i.jar":"$LOCALCLASSPATH" - fi - done - -# in rpm mode ant/lib is in /usr/share/java/ant -ANT_LIB=${JAVALIBDIR}/ant - -fi - -# add in the dependency .jar files in non-RPM mode (the default) -for i in "${ANT_LIB}"/*.jar -do - # if the directory is empty, then it will return the input string - # this is stupid, so case for it - if [ "$i" != "${ANT_LIB}/*.jar" ] ; then - if [ -z "$LOCALCLASSPATH" ] ; then - LOCALCLASSPATH=$i - else - LOCALCLASSPATH="$i":"$LOCALCLASSPATH" +# 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 -done -if [ -n "$JAVA_HOME" ] ; then + # 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 - # OSX hack to make Ant work with jikes - if $darwin ; then - OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes" - if [ -d ${OSXHACK} ] ; then - for i in ${OSXHACK}/*.jar - do - JIKESPATH=$JIKESPATH:$i - done + # 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 - 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." + # 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 -# supply JIKESPATH to Ant as jikes.class.path -if [ -n "$JIKESPATH" ] ; then - if $cygwin ; then - JIKESPATH=`cygpath --path --windows "$JIKESPATH"` +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 - ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH" fi # Allow Jikes support (off by default) @@ -175,13 +213,87 @@ ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes" fi -# For Cygwin, switch paths to Windows format before running java +# 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 - ANT_HOME=`cygpath --path --windows "$ANT_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` - ANT_OPTS="$ANT_OPTS -Dcygwin.user.home="`cygpath --path --windows "$HOME"` + 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 -"$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@" +# 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 Modified: xml/xindice/trunk/tools/bin/ant.bat URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/ant.bat?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/ant.bat (original) +++ xml/xindice/trunk/tools/bin/ant.bat Sat Nov 11 20:20:02 2006 @@ -1,113 +1,125 @@ @echo off -REM Copyright (c) 2001-2003 The Apache Software Foundation. All rights -REM reserved. +REM Copyright 2001,2004-2005 The Apache Software Foundation +REM +REM Licensed under the Apache License, Version 2.0 (the "License"); +REM you may not use this file except in compliance with the License. +REM You may obtain a copy of the License at +REM +REM http://www.apache.org/licenses/LICENSE-2.0 +REM +REM Unless required by applicable law or agreed to in writing, software +REM distributed under the License is distributed on an "AS IS" BASIS, +REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +REM See the License for the specific language governing permissions and +REM limitations under the License. if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat" -if not "%OS%"=="Windows_NT" goto win9xStart -:winNTStart [EMAIL PROTECTED] +if "%OS%"=="Windows_NT" @setlocal +if "%OS%"=="WINNT" @setlocal -rem %~dp0 is name of current script under NT -set DEFAULT_ANT_HOME=%~dp0 - -rem : operator works similar to make : operator -set DEFAULT_ANT_HOME=%DEFAULT_ANT_HOME%\.. +rem %~dp0 is expanded pathname of the current script under NT +set DEFAULT_ANT_HOME=%~dp0.. if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME% set DEFAULT_ANT_HOME= -rem Need to check if we are using the 4NT shell... -if "[EMAIL PROTECTED]" == "4" goto setup4NT - -rem On NT/2K grab all arguments at once -set ANT_CMD_LINE_ARGS=%* -goto doneStart - -:setup4NT -set ANT_CMD_LINE_ARGS=%$ -goto doneStart - -:win9xStart -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= +set _USE_CLASSPATH=yes +rem Slurp the command line arguments. This loop allows for an unlimited number +rem of arguments (up to the command line limit, anyway). +set ANT_CMD_LINE_ARGS=%1 +if ""%1""=="""" goto doneStart +shift :setupArgs -if %1a==a goto doneStart +if ""%1""=="""" goto doneStart +if ""%1""==""-noclasspath"" goto clearclasspath set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 shift goto setupArgs -:doneStart -rem This label provides a place for the argument list loop to break out -rem and for NT handling to skip to. +rem here is there is a -noclasspath in the options +:clearclasspath +set _USE_CLASSPATH=no +shift +goto setupArgs -rem find ANT_HOME -if not "%ANT_HOME%"=="" goto checkJava +rem This label provides a place for the argument list loop to break out +rem and for NT handling to skip to. -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 +:doneStart +rem find ANT_HOME if it does not exist due to either an invalid value passed +rem by the user or the %0 problem on Windows 9x +if exist "%ANT_HOME%\lib\ant.jar" goto checkJava + +rem check for ant in Program Files +if not exist "%ProgramFiles%\ant" goto checkSystemDrive +set ANT_HOME=%ProgramFiles%\ant goto checkJava :checkSystemDrive rem check for ant in root directory of system drive -if not exist %SystemDrive%\ant\nul goto checkCDrive +if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive set ANT_HOME=%SystemDrive%\ant goto checkJava :checkCDrive rem check for ant in C:\ant for Win9X users -if not exist C:\ant\nul goto noAntHome +if not exist C:\ant\lib\ant.jar goto noAntHome set ANT_HOME=C:\ant goto checkJava :noAntHome -echo ANT_HOME is not set and ant could not be located. Please set ANT_HOME. +echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME. goto end :checkJava set _JAVACMD=%JAVACMD% -set LOCALCLASSPATH=%CLASSPATH% -for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" %%i if "%JAVA_HOME%" == "" goto noJavaHome -if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java -if not exist "%_JAVACMD%.exe" echo Error: "%_JAVACMD%.exe" not found - check JAVA_HOME && goto end -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 +if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome +if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe goto checkJikes :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. +if "%_JAVACMD%" == "" set _JAVACMD=java.exe :checkJikes -if not "%JIKESPATH%" == "" goto runAntWithJikes +if not "%JIKESPATH%"=="" goto runAntWithJikes :runAnt -"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS% +if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath +if not "%CLASSPATH%"=="" goto runAntWithClasspath +"%_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% +goto end + +:runAntNoClasspath +"%_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% +goto end + +:runAntWithClasspath +"%_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% goto end :runAntWithJikes -"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" -Djikes.class.path="%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS% +if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath +if not "%CLASSPATH%"=="" goto runAntWithJikesAndClasspath + +:runAntWithJikesNoClasspath +"%_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% +goto end + +:runAntWithJikesAndClasspath +"%_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% +goto end :end -set LOCALCLASSPATH= set _JAVACMD= set ANT_CMD_LINE_ARGS= -if not "%OS%"=="Windows_NT" goto mainEnd -:winNTend [EMAIL PROTECTED] +if "%OS%"=="Windows_NT" @endlocal +if "%OS%"=="WINNT" @endlocal :mainEnd if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat" Propchange: xml/xindice/trunk/tools/bin/ant.bat ('svn:executable' removed) Added: xml/xindice/trunk/tools/bin/ant.cmd URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/ant.cmd?view=auto&rev=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/ant.cmd (added) +++ xml/xindice/trunk/tools/bin/ant.cmd Sat Nov 11 20:20:02 2006 @@ -0,0 +1,92 @@ +/* + Copyright 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. + + Run ant +*/ + +'@echo off' +parse arg mode envarg '::' antarg + +if mode\='.' & mode\='..' & mode\='/' then do + envarg = mode envarg + mode = '' +end + +if antarg = '' then do + antarg = envarg + envarg = '' +end + +x = setlocal() + +env="OS2ENVIRONMENT" +antenv = _getenv_('antenv') +if _testenv_() = 0 then interpret 'call "' || antenv || '"' '"' || envarg || '"' + +if mode = '' then mode = _getenv_('ANT_MODE' '..') +if mode \= '/' then do + runrc = _getenv_('runrc') + antrc = _getenv_('antrc' 'antrc.cmd') + if mode = '..' then mode = '-r' + else mode = '' + interpret 'call "' || runrc || '"' antrc '"' || mode || '"' +end + +if _testenv_() = 0 then do + say 'Ant environment is not set properly' + x = endlocal() + exit 16 +end + +settings = '-Dant.home=' || ANT_HOME '-Djava.home=' || JAVA_HOME + +java = _getenv_('javacmd' 'java') +opts = value('ANT_OPTS',,env) +args = value('ANT_ARGS',,env) +lcp = value('LOCALCLASSPATH',,env) +cp = value('CLASSPATH',,env) +if value('ANT_USE_CP',,env) \= '' then do + if lcp \= '' & right(lcp, 1) \= ';' then lcp = lcp || ';' + lcp = lcp || cp + 'SET CLASSPATH=' +end +if lcp\='' then lcp = '-classpath' lcp + +cmd = java opts lcp '-jar' ANT_HOME ||'\lib\ant-launcher.jar' settings args antarg +launcher = stream(ANT_HOME ||'\lib\ant-launcher.jar', 'C', 'query exists') +if launcher = '' then entry = 'org.apache.tools.ant.Main' +else entry = 'org.apache.tools.ant.launch.Launcher' +java opts lcp entry settings args antarg + +x = endlocal() + +return rc + +_testenv_: procedure expose env ANT_HOME JAVA_HOME +ANT_HOME = value('ANT_HOME',,env) +if ANT_HOME = '' then return 0 +JAVA_HOME = value('JAVA_HOME',,env) +if JAVA_HOME = '' then return 0 +cp = translate(value('CLASSPATH',,env)) +if pos(translate(ANT_HOME), cp) = 0 then return 0 +if pos(translate(JAVA_HOME), cp) = 0 then return 0 +return 1 + +_getenv_: procedure expose env +parse arg envar default +if default = '' then default = envar +var = value(translate(envar),,env) +if var = '' then var = default +return var Propchange: xml/xindice/trunk/tools/bin/ant.cmd ------------------------------------------------------------------------------ svn:eol-style = native Modified: xml/xindice/trunk/tools/bin/antRun URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/antRun?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/antRun (original) +++ xml/xindice/trunk/tools/bin/antRun Sat Nov 11 20:20:02 2006 @@ -1,7 +1,21 @@ -#! /bin/sh +#!/bin/sh -# Copyright (c) 2001 The Apache Software Foundation. All rights -# reserved. +# +# 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" @@ -9,4 +23,4 @@ shift shift -exec $CMD "$@" +exec "$CMD" "$@" Modified: xml/xindice/trunk/tools/bin/antRun.bat URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/antRun.bat?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/antRun.bat (original) +++ xml/xindice/trunk/tools/bin/antRun.bat Sat Nov 11 20:20:02 2006 @@ -1,23 +1,47 @@ @echo off -REM Copyright (c) 2001 The Apache Software Foundation. All rights -REM reserved. +REM +REM Copyright 2001-2002,2004-2005 The Apache Software Foundation +REM +REM Licensed under the Apache License, Version 2.0 (the "License"); +REM you may not use this file except in compliance with the License. +REM You may obtain a copy of the License at +REM +REM http://www.apache.org/licenses/LICENSE-2.0 +REM +REM Unless required by applicable law or agreed to in writing, software +REM distributed under the License is distributed on an "AS IS" BASIS, +REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +REM See the License for the specific language governing permissions and +REM limitations under the License. +REM +REM -rem Change drive and directory to %1 (Win9X only for NT/2K use "cd /d") -cd %1 -%1\ -set ANT_RUN_CMD=%2 -shift +if "%OS%"=="Windows_NT" @setlocal +if "%OS%"=="WINNT" @setlocal + +if ""%1""=="""" goto runCommand + +rem Change drive and directory to %1 +if "%OS%"=="Windows_NT" cd /d ""%1"" +if not "%OS%"=="Windows_NT" cd ""%1"" shift -set PARAMS= +rem Slurp the command line arguments. This loop allows for an unlimited number +rem of agruments (up to the command line limit, anyway). +set ANT_RUN_CMD=%1 +if ""%1""=="""" goto runCommand +shift :loop -if ""%1 == "" goto runCommand -set PARAMS=%PARAMS% %1 +if ""%1""=="""" goto runCommand +set ANT_RUN_CMD=%ANT_RUN_CMD% %1 shift goto loop :runCommand -rem echo %ANT_RUN_CMD% %PARAMS% -%ANT_RUN_CMD% %PARAMS% +rem echo %ANT_RUN_CMD% +%ANT_RUN_CMD% + +if "%OS%"=="Windows_NT" @endlocal +if "%OS%"=="WINNT" @endlocal Propchange: xml/xindice/trunk/tools/bin/antRun.bat ('svn:executable' removed) Modified: xml/xindice/trunk/tools/bin/antRun.pl URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/antRun.pl?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/antRun.pl (original) +++ xml/xindice/trunk/tools/bin/antRun.pl Sat Nov 11 20:20:02 2006 @@ -1,4 +1,19 @@ #!/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 @@ -7,7 +22,6 @@ # this is akin to antRun.bat, and antRun the SH script # # created: 2001-10-18 -# last modified: 2001-11-13 # author: Jeff Tulley [EMAIL PROTECTED] ####################################################################### #be fussy about variables Added: xml/xindice/trunk/tools/bin/antenv.cmd URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/antenv.cmd?view=auto&rev=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/antenv.cmd (added) +++ xml/xindice/trunk/tools/bin/antenv.cmd Sat Nov 11 20:20:02 2006 @@ -0,0 +1,99 @@ +/* + Copyright 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. + + Ant environment +*/ + +'@echo off' +call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs" +call SysLoadFuncs + +/* Prepare the parameters for later use */ +parse arg argv +mode = '' +args = '' +opts = '' +cp = '' +lcp = '' + +do i = 1 to words(argv) + param = word(argv, i) + select + when param='-lcp' then mode = 'l' + when param='-cp' | param='-classpath' then mode = 'c' + when abbrev('-opts', param, 4) then mode = 'o' + when abbrev('-args', param, 4) then mode = 'a' + otherwise + select + when mode = 'a' then args = space(args param, 1) + when mode = 'c' then cp = space(cp param, 1) + when mode = 'l' then lcp = space(lcp param, 1) + when mode = 'o' then opts = space(opts param, 1) + otherwise + say 'Option' param 'ignored' + end + end +end + +env="OS2ENVIRONMENT" +antconf = _getenv_('antconf' 'antconf.cmd') +runrc = _getenv_('runrc') +interpret 'call "' || runrc || '"' '"' || antconf || '"' 'ETC' +ANT_HOME = value('ANT_HOME',,env) +JAVA_HOME = value('JAVA_HOME',,env) +classpath = value('CLASSPATH',,env) +classes = stream(JAVA_HOME || "\lib\classes.zip", "C", "QUERY EXISTS") +if classes \= '' then classpath = prepend(classpath classes) +classes = stream(JAVA_HOME || "\lib\tools.jar", "C", "QUERY EXISTS") +if classes \= '' then classpath = prepend(classpath classes) + +classpath = prepend(classpath ANT_HOME || '\lib\ant-launcher.jar') +'SET CLASSPATH=' || classpath + +/* Setting classpathes, options and arguments */ +envset = _getenv_('envset') +if cp\='' then interpret 'call "' || envset || '"' '"; CLASSPATH"' '"' || cp || '"' +if lcp\='' then interpret 'call "' || envset || '"' '"; LOCALCLASSPATH"' '"' || lcp || '"' +if opts\='' then interpret 'call "' || envset || '"' '"-D ANT_OPTS"' '"' || opts || '"' +if args\='' then interpret 'call "' || envset || '"' '"ANT_ARGS"' '"' || args || '"' + +exit 0 + +addpath: procedure +parse arg path elem +if elem = '' then do + if path\='' & right(path, 1)\=';' then path = path || ';' + return path +end +if substr(path, length(path)) = ';' then glue = '' +else glue = ';' +if pos(translate(elem), translate(path)) = 0 then path = path || glue || elem || ';' +return path + +prepend: procedure +parse arg path elem +if elem = '' then do + if path\='' & right(path, 1)\=';' then path = path || ';' + return path +end +if pos(translate(elem), translate(path)) = 0 then path = elem || ';' || path +return path + +_getenv_: procedure expose env +parse arg envar default +if default = '' then default = envar +var = value(translate(envar),,env) +if var = '' then var = default +return var Propchange: xml/xindice/trunk/tools/bin/antenv.cmd ------------------------------------------------------------------------------ svn:eol-style = native Modified: xml/xindice/trunk/tools/bin/complete-ant-cmd.pl URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/complete-ant-cmd.pl?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/complete-ant-cmd.pl (original) +++ xml/xindice/trunk/tools/bin/complete-ant-cmd.pl Sat Nov 11 20:20:02 2006 @@ -1,7 +1,18 @@ #!/usr/bin/perl # -# Copyright (c) 2001 The Apache Software Foundation. All rights -# reserved. +# 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. # Added: xml/xindice/trunk/tools/bin/envset.cmd URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/envset.cmd?view=auto&rev=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/envset.cmd (added) +++ xml/xindice/trunk/tools/bin/envset.cmd Sat Nov 11 20:20:02 2006 @@ -0,0 +1,130 @@ +/* + + Copyright 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. + +SET environment variables +First optional parameter: + ; parameters are considered parts of a path variable, semicolons are + appended to each element if not already present + -D parameters are properties for Java or Makefile etc., -D will be + prepended and the parameters will be separated by a space + =D the same as above but equal sign is not required + , parameters should be comma separated in the environment variable + - parameters should be separated by the next parameter + Other values mean that the first parameter is missing and the environment + variable will be set to the space separated parameters + +Second parameter: name of the environment variable + +Next parameters: values +; implies that the equal sign is considered a part of the parameter and is +not interpreted + +-D requires parameters in the form name=value. If the equal sign is not found, +the parameters are changed to name=expanded_name + +Other options have optional equal sign. If it is found, only the part after +the equal sign will be oprionally expanded. + +If the parameter is the minus sign, the next parameter will not be expanded. +If the parameter is a single dot, it will be replaced with the value of the +environment variable as it existed before envset was invoked. + +For other parameters the batch looks for the environment variable with the +same name (in uppercase). If it is found, it forms the expanded_name. If +the environment variable with such a name does not exist, the expanded_name +will hold the parameter name without case conversion. +*/ + +parse arg mode envar args + +equal = 0 +sep = ' ' + +/* Parse command line parameters */ +select + when mode='-' then do + sep = envar + parse var args envar args + end + when mode=';' then do + sep = '' + equal = -1 + end + when mode='-D' then equal = 1 + when mode='=D' then mode = '-D' + when mode=',' then sep = ',' +otherwise + args = envar args + envar = mode + mode = '' +end + +env = 'OS2ENVIRONMENT' +envar = translate(envar) +orig = value(envar,,env) +newval = '' +expand = 1 + +/* for each parameter... */ +do i = 1 to words(args) + if expand > 0 & word(args, i) = '-' then expand = 0 + else call addval word(args, i) +end + +/* Optionally enclose path variable by quotes */ +if mode = ';' & pos(' ', newval) > 0 then newval = '"' || newval || '"' + +/* Set the new value, 'SET' cannot be used since it does not allow '=' */ +x = value(envar, newval, env) +exit 0 + +addval: procedure expose sep equal orig expand newval mode env +parse arg var + +if var = '.' then expvar = orig +else do + if equal >= 0 then do + parse var var name '=' val + if val = '' then var = name + else var = val + end + if expand = 0 then expvar = var + else expvar = value(translate(var),,env) + if expvar = '' then expvar = var + if equal >= 0 then do + if val = '' then do + parse var expvar key '=' val + if val <> '' then name = key + else do + if equal > 0 then val = key + else name = key + end + end + else val = expvar + if pos(' ', val) > 0 | pos('=', val) > 0 then val = '"' || val || '"' + if val = '' then expvar = name + else expvar = name || '=' || val + end + if mode = '-D' then expvar = '-D' || expvar + if mode = ';' then do + if right(expvar, 1) <> ';' then expvar = expvar || ';' + end +end + +if newval = '' then newval = expvar +else newval = newval || sep || expvar +expand = 1 +return Propchange: xml/xindice/trunk/tools/bin/envset.cmd ------------------------------------------------------------------------------ svn:eol-style = native Modified: xml/xindice/trunk/tools/bin/lcp.bat URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/lcp.bat?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/lcp.bat (original) +++ xml/xindice/trunk/tools/bin/lcp.bat Sat Nov 11 20:20:02 2006 @@ -1,12 +1,30 @@ -REM Copyright (c) 2001 The Apache Software Foundation. All rights -REM reserved. +REM +REM Copyright 2001-2004 The Apache Software Foundation +REM +REM Licensed under the Apache License, Version 2.0 (the "License"); +REM you may not use this file except in compliance with the License. +REM You may obtain a copy of the License at +REM +REM http://www.apache.org/licenses/LICENSE-2.0 +REM +REM Unless required by applicable law or agreed to in writing, software +REM distributed under the License is distributed on an "AS IS" BASIS, +REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +REM See the License for the specific language governing permissions and +REM limitations under the License. +REM +REM set _CLASSPATHCOMPONENT=%1 -:argCheck -if %2a==a goto gotAllArgs +if ""%1""=="""" goto gotAllArgs shift + +:argCheck +if ""%1""=="""" goto gotAllArgs set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1 +shift goto argCheck + :gotAllArgs set LOCALCLASSPATH=%_CLASSPATHCOMPONENT%;%LOCALCLASSPATH% Propchange: xml/xindice/trunk/tools/bin/lcp.bat ('svn:executable' removed) Modified: xml/xindice/trunk/tools/bin/runant.pl URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/runant.pl?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/runant.pl (original) +++ xml/xindice/trunk/tools/bin/runant.pl Sat Nov 11 20:20:02 2006 @@ -1,7 +1,18 @@ #!/usr/bin/perl # -# Copyright (c) 2001-2003 The Apache Software Foundation. All rights -# reserved. +# 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. # ####################################################################### # @@ -18,7 +29,6 @@ # the code is not included. # # created: 2000-8-24 -# last modified: 2000-8-24 # author: Steve Loughran [EMAIL PROTECTED] ####################################################################### # @@ -39,7 +49,7 @@ #use warnings; #and set $debug to 1 to turn on trace info -my $debug=0; +my $debug=1; ####################################################################### # @@ -61,6 +71,8 @@ $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. @@ -72,53 +84,7 @@ } #build up standard classpath -my $localpath=$ENV{CLASSPATH}; -if ($localpath eq "") - { - print "warning: no initial classpath\n" if ($debug); - $localpath=""; - } -if ($onnetware == 1) -{ -# avoid building a command line bigger than 512 characters - make localpath -# only include the "extra" stuff, and add in the system classpath as an expanded -# variable. - $localpath=""; -} - -#add jar files. I am sure there is a perl one liner to do this. -my $jarpattern="$HOME/lib/*.jar"; -my @jarfiles =glob($jarpattern); -print "[EMAIL PROTECTED]" if ($debug); -my $jar; -foreach $jar (@jarfiles ) - { - $localpath.="$s$jar"; - } - -#if Java home is defined, look for tools.jar & classes.zip and add to classpath -my $JAVA_HOME = $ENV{JAVA_HOME}; -if ($JAVA_HOME ne "") - { - my $tools="$JAVA_HOME/lib/tools.jar"; - if (-e "$tools") - { - $localpath .= "$s$tools"; - } - my $classes="$JAVA_HOME/lib/classes.zip"; - if (-e $classes) - { - $localpath .= "$s$classes"; - } - } -else - { - print "\n\nWarning: JAVA_HOME environment variable is not set.\n". - "If the build fails because sun.* classes could not be found\n". - "you will need to set the JAVA_HOME environment variable\n". - "to the installation directory of java\n"; - } - +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}); @@ -131,22 +97,46 @@ #construct arguments to java my @ARGS; -if ($onnetware == 1) -{ -# make classpath literally $CLASSPATH; and then the contents of $localpath -# this is to avoid pushing us over the 512 character limit -# even skip the ; - that is already in $localpath - push @ARGS, "-classpath", "\$CLASSPATH$localpath"; +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); } -else +push @ARGS, "-classpath", "$localpath"; +push @ARGS, "-Dant.home=$HOME"; +if ( ! $CYGHOME eq "" ) { - push @ARGS, "-classpath", "$localpath"; + push @ARGS, "-Dcygwin.user.home=\"$CYGHOME\"" } -push @ARGS, "-Dant.home=$HOME"; -push @ARGS, @ANT_OPTS; -push @ARGS, "org.apache.tools.ant.Main", @ANT_ARGS; +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; Modified: xml/xindice/trunk/tools/bin/runant.py URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/runant.py?view=diff&rev=473869&r1=473868&r2=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/runant.py (original) +++ xml/xindice/trunk/tools/bin/runant.py Sat Nov 11 20:20:02 2006 @@ -1,15 +1,27 @@ #!/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 - - Copyright (c) 2001 The Apache Software Foundation. All rights - reserved. + 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 [EMAIL PROTECTED] @@ -17,7 +29,6 @@ Assumptions: - the "java" executable/script is on the command path - - ANT_HOME has been set """ import os, os.path, string, sys @@ -25,75 +36,65 @@ debug = 0 ####################################################################### -# -# check to make sure environment is setup -# -if not os.environ.has_key('ANT_HOME'): - print '\n\nANT_HOME *MUST* be set!\n\n' - sys.exit(1) -else: - ANT_HOME = os.environ['ANT_HOME'] -if not os.environ.has_key('JAVACMD'): - JAVACMD = 'java' +# 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: - JAVACMD = os.environ['JAVACMD'] + ANT_HOME = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))) -# Sets the separator char for CLASSPATH -SEPARATOR = ':' -if os.name == 'dos' or os.name == 'nt': - SEPARATOR = ';' +# set ANT_LIB location +ANT_LIB = os.path.join(ANT_HOME, 'lib') -# Build up standard classpath -localpath = '' -if os.environ.has_key('CLASSPATH'): - localpath = os.environ['CLASSPATH'] -else: - if debug: - print 'Warning: no initial classpath\n' - -# Add jar files -LIBDIR = os.path.join(ANT_HOME, 'lib') -jarfiles = [] -for file in os.listdir(LIBDIR): - if file[-4:] == '.jar': - jarfiles.append(os.path.join(LIBDIR,file)) -if debug: - print 'Jar files:' - for jar in jarfiles: - print jar -localpath = localpath + SEPARATOR + string.join(jarfiles, SEPARATOR) - -# If JAVA_HOME is defined, look for tools.jar & classes.zip -# and add to classpath -if os.environ.has_key('JAVA_HOME') and os.environ['JAVA_HOME'] != '': - JAVA_HOME = os.environ['JAVA_HOME'] - TOOLS = os.path.join(JAVA_HOME, os.path.join('lib', 'tools.jar')) - if os.path.exists(TOOLS): - localpath = localpath + SEPARATOR + TOOLS - CLASSES = os.path.join(JAVA_HOME, os.path.join('lib', 'classes.zip')) - if os.path.exists(CLASSES): - localpath = localpath + SEPARATOR + CLASSES +# 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: - print '\n\nWarning: JAVA_HOME environment variable is not set.\n', \ - 'If the build fails because sun.* classes could not be found\n', \ - 'you will need to set the JAVA_HOME environment variable\n', \ - 'to the installation directory of java\n' + 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'] -# Jikes -ANT_OPTS = [] +ANT_OPTS = "" if os.environ.has_key('ANT_OPTS'): - ANT_OPTS = string.split(os.environ['ANT_OPTS']) + ANT_OPTS = os.environ['ANT_OPTS'] + +OPTS = "" if os.environ.has_key('JIKESPATH'): - ANT_OPTS.append('-Djikes.class.path=' + os.environ['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 -classpath %s -Dant.home=%s %s org.apache.tools.ant.Main %s' \ - % (JAVACMD, localpath, ANT_HOME, string.join(ANT_OPTS,' '), \ - string.join(sys.argv[1:], ' ')) +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) + print '\n%s\n\n' % (cmdline) # Run the biniou! os.system(cmdline) Added: xml/xindice/trunk/tools/bin/runrc.cmd URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/bin/runrc.cmd?view=auto&rev=473869 ============================================================================== --- xml/xindice/trunk/tools/bin/runrc.cmd (added) +++ xml/xindice/trunk/tools/bin/runrc.cmd Sat Nov 11 20:20:02 2006 @@ -0,0 +1,59 @@ +/* + Copyright 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. + + Run RC file, name is in the first arg, second arg is either PATH + ENV or -r or nothing +*/ + +parse arg name path rest + +if name = '' then do + say 'RC file name is missing' + exit 1 +end + +if rest \= '' then do + say 'Too many parameters' + exit 1 +end + +call runit name path +exit 0 + +runit: procedure +parse arg name path dir + +if path \= '' & path \= '-r' then do + dir = value(translate(path),,'OS2ENVIRONMENT') + if dir = '' then return + dir = translate(dir, '\', '/') /* change UNIX-like path to OS/2 */ +end + +if dir = '' then dir = directory() + +if path = '-r' then do /* recursive call */ + subdir = filespec('path', dir) + if subdir \= '\' then do + subdir = left(subdir, length(subdir)-1) + call runit name path filespec('drive', dir) || subdir + end +end + +/* Look for the file and run it */ +if right(dir, 1) \= '\' then dir = dir || '\' +rcfile = stream(dir || name, 'c', 'query exists') +if rcfile \= '' then interpret 'call "' || rcfile || '"' + +return Propchange: xml/xindice/trunk/tools/bin/runrc.cmd ------------------------------------------------------------------------------ svn:eol-style = native Added: xml/xindice/trunk/tools/lib/ant-1.6.5-junit.jar URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/lib/ant-1.6.5-junit.jar?view=auto&rev=473869 ============================================================================== Binary file - no diff available. Propchange: xml/xindice/trunk/tools/lib/ant-1.6.5-junit.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: xml/xindice/trunk/tools/lib/ant-1.6.5-trax.jar URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/lib/ant-1.6.5-trax.jar?view=auto&rev=473869 ============================================================================== Binary file - no diff available. Propchange: xml/xindice/trunk/tools/lib/ant-1.6.5-trax.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: xml/xindice/trunk/tools/lib/ant-1.6.5.jar URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/lib/ant-1.6.5.jar?view=auto&rev=473869 ============================================================================== Binary file - no diff available. Propchange: xml/xindice/trunk/tools/lib/ant-1.6.5.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: xml/xindice/trunk/tools/lib/ant-launcher.jar URL: http://svn.apache.org/viewvc/xml/xindice/trunk/tools/lib/ant-launcher.jar?view=auto&rev=473869 ============================================================================== Binary file - no diff available. Propchange: xml/xindice/trunk/tools/lib/ant-launcher.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream