You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2004/07/23 07:20:31 UTC
cvs commit: cocoon-2.1/tools/bin antenv.cmd ant ant.cmd runrc.cmd envset.cmd
antonio 2004/07/22 22:20:31
Modified: tools/bin antenv.cmd ant ant.cmd runrc.cmd envset.cmd
Log:
Update to ant 1.6.2
Revision Changes Path
1.3 +99 -100 cocoon-2.1/tools/bin/antenv.cmd
Index: antenv.cmd
===================================================================
RCS file: /home/cvs/cocoon-2.1/tools/bin/antenv.cmd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- antenv.cmd 16 Feb 2004 23:38:49 -0000 1.2
+++ antenv.cmd 23 Jul 2004 05:20:31 -0000 1.3
@@ -1,100 +1,99 @@
-/*
- Copyright (c) 2003 The Apache Software Foundation. All rights
- reserved.
-
- Ant environment
-*/
-
-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)
-
-mincp = classpath
-call SysFileTree ANT_HOME || '\lib\*.jar', 'jar', 'FO'
-do i = 1 to jar.0
- nm = filespec('name', jar.i)
- if pos('ant-', nm) == 0 then classpath = prepend(classpath jar.i)
-end
-if length(classpath) > 512 then do
- say 'Classpath is too long, switching to the minimal version...'
- say '... some tasks will not work'
- classpath = mincp
- classpath = prepend(classpath ANT_HOME || '\lib\ant.jar')
- classpath = prepend(classpath ANT_HOME || '\lib\optional.jar')
-end
-
-'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
+/*
+ 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
1.4 +169 -40 cocoon-2.1/tools/bin/ant
Index: ant
===================================================================
RCS file: /home/cvs/cocoon-2.1/tools/bin/ant,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ant 15 Feb 2004 10:15:55 -0000 1.3
+++ ant 23 Jul 2004 05:20:31 -0000 1.4
@@ -14,23 +14,64 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# load system-wide ant configuration
-if [ -f "/etc/ant.conf" ] ; then
- . /etc/ant.conf
-fi
+# 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
-# provide default values for people who don't use RPMs
-if [ -z "$rpm_mode" ] ; then
- rpm_mode=false;
-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
-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.
@@ -109,29 +150,60 @@
exit 1
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"
+# 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
- done
+ fi
- # in rpm mode ant/lib is in /usr/share/java/ant
- ANT_LIB="${JAVALIBDIR}/ant"
-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
-if [ -z "$LOCALCLASSPATH" ] ; then
- LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar
+ # remove class path from launcher -lib option
+ CLASSPATH=""
+ fi
else
- LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH
+ # 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
@@ -150,24 +222,81 @@
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
if $cygwin; then
- ANT_HOME=`cygpath --windows "$ANT_HOME"`
- JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
- LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
- CYGHOME=`cygpath --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"`
+ LOCALCLASSPATH=`cygpath --path --$format "$LOCALCLASSPATH"`
+ if [ -n "$CLASSPATH" ] ; then
+ CLASSPATH=`cygpath --path --$format "$CLASSPATH"`
+ 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
- exec "$JAVACMD" $ANT_OPTS -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Djikes.class.path="$JIKESPATH" -Dcygwin.user.home="$CYGHOME" org.apache.tools.ant.launch.Launcher $ANT_ARGS -lib "$CLASSPATH" "$@"
+ ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\""
else
- exec "$JAVACMD" $ANT_OPTS -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Dcygwin.user.home="$CYGHOME" org.apache.tools.ant.launch.Launcher $ANT_ARGS -lib "$CLASSPATH" "$@"
+ ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\""
fi
else
if [ -n "$JIKESPATH" ]; then
- exec "$JAVACMD" $ANT_OPTS -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Djikes.class.path="$JIKESPATH" org.apache.tools.ant.launch.Launcher $ANT_ARGS -lib "$CLASSPATH" "$@"
- else
- exec "$JAVACMD" $ANT_OPTS -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" org.apache.tools.ant.launch.Launcher $ANT_ARGS -lib "$CLASSPATH" "$@"
+ 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 -lib \"$CLASSPATH\" $ant_exec_args"
+if $ant_exec_debug ; then
+ echo $ant_exec_command
+fi
+eval $ant_exec_command
1.3 +92 -71 cocoon-2.1/tools/bin/ant.cmd
Index: ant.cmd
===================================================================
RCS file: /home/cvs/cocoon-2.1/tools/bin/ant.cmd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ant.cmd 16 Feb 2004 23:38:49 -0000 1.2
+++ ant.cmd 23 Jul 2004 05:20:31 -0000 1.3
@@ -1,71 +1,92 @@
-/*
- Copyright (c) 2003 The Apache Software Foundation. All rights
- reserved.
-
- Run ant
-*/
-
-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 do
- interpret 'call "' || antenv || '"' '"' || envarg || '"'
- if _testenv_() = 0 then do
- say 'Ant environment is not set properly'
- x = endlocal()
- exit 16
- end
-end
-
-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
-
-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)
-if lcp\='' then lcp = '-cp' lcp
-
-java opts lcp 'org.apache.tools.ant.Main' 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
+/*
+ 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
1.3 +59 -48 cocoon-2.1/tools/bin/runrc.cmd
Index: runrc.cmd
===================================================================
RCS file: /home/cvs/cocoon-2.1/tools/bin/runrc.cmd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- runrc.cmd 16 Feb 2004 23:38:49 -0000 1.2
+++ runrc.cmd 23 Jul 2004 05:20:31 -0000 1.3
@@ -1,48 +1,59 @@
-/*
- Copyright (c) 2003 The Apache Software Foundation. All rights
- reserved.
-
- 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
+/*
+ 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
1.3 +130 -119 cocoon-2.1/tools/bin/envset.cmd
Index: envset.cmd
===================================================================
RCS file: /home/cvs/cocoon-2.1/tools/bin/envset.cmd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- envset.cmd 16 Feb 2004 23:38:49 -0000 1.2
+++ envset.cmd 23 Jul 2004 05:20:31 -0000 1.3
@@ -1,119 +1,130 @@
-/*
-
- Copyright (c) 2003 The Apache Software Foundation. All rights
- reserved.
-
-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
+/*
+
+ 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