forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: rev 23183 - in forrest/trunk/tools/ant: bin lib
Date Fri, 23 Jul 2004 05:58:50 GMT
Author: antonio
Date: Thu Jul 22 22:58:49 2004
New Revision: 23183

Modified:
   forrest/trunk/tools/ant/bin/ant
   forrest/trunk/tools/ant/bin/ant.bat
   forrest/trunk/tools/ant/bin/ant.cmd
   forrest/trunk/tools/ant/bin/antRun.bat
   forrest/trunk/tools/ant/bin/antenv.cmd
   forrest/trunk/tools/ant/bin/complete-ant-cmd.pl
   forrest/trunk/tools/ant/bin/envset.cmd
   forrest/trunk/tools/ant/bin/lcp.bat
   forrest/trunk/tools/ant/bin/runrc.cmd
   forrest/trunk/tools/ant/lib/ant-apache-resolver.jar
   forrest/trunk/tools/ant/lib/ant-jsch.jar
   forrest/trunk/tools/ant/lib/ant-launcher.jar
   forrest/trunk/tools/ant/lib/ant-nodeps.jar
   forrest/trunk/tools/ant/lib/ant-trax.jar
   forrest/trunk/tools/ant/lib/ant.jar
Log:
update ant to 1.6.2

Modified: forrest/trunk/tools/ant/bin/ant
==============================================================================
--- forrest/trunk/tools/ant/bin/ant	(original)
+++ forrest/trunk/tools/ant/bin/ant	Thu Jul 22 22:58:49 2004
@@ -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

Modified: forrest/trunk/tools/ant/bin/ant.bat
==============================================================================
--- forrest/trunk/tools/ant/bin/ant.bat	(original)
+++ forrest/trunk/tools/ant/bin/ant.bat	Thu Jul 22 22:58:49 2004
@@ -17,7 +17,6 @@
 if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
 
 if "%OS%"=="Windows_NT" @setlocal
-if "%OS%"=="WINNT" @setlocal
 
 rem %~dp0 is expanded pathname of the current script under NT
 set DEFAULT_ANT_HOME=%~dp0..
@@ -101,7 +100,6 @@
 set ANT_CMD_LINE_ARGS=
 
 if "%OS%"=="Windows_NT" @endlocal
-if "%OS%"=="WINNT" @endlocal
 
 :mainEnd
 if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"

Modified: forrest/trunk/tools/ant/bin/ant.cmd
==============================================================================
--- forrest/trunk/tools/ant/bin/ant.cmd	(original)
+++ forrest/trunk/tools/ant/bin/ant.cmd	Thu Jul 22 22:58:49 2004
@@ -1,10 +1,22 @@
 /* 
-    Copyright (c) 2003 The Apache Software Foundation.  All rights
-    reserved.
-
-    Run ant 
+    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
@@ -21,14 +33,7 @@
 
 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 _testenv_() = 0 then interpret 'call "' || antenv || '"' '"' || envarg || '"'
 
 if mode = '' then mode = _getenv_('ANT_MODE' '..')
 if mode \= '/' then do
@@ -39,15 +44,31 @@
   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)
-if lcp\='' then lcp = '-cp' lcp
+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
 
-java opts lcp 'org.apache.tools.ant.Main' settings args antarg
+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()
 

Modified: forrest/trunk/tools/ant/bin/antRun.bat
==============================================================================
--- forrest/trunk/tools/ant/bin/antRun.bat	(original)
+++ forrest/trunk/tools/ant/bin/antRun.bat	Thu Jul 22 22:58:49 2004
@@ -18,14 +18,12 @@
 REM
 
 if "%OS%"=="Windows_NT" @setlocal
-if "%OS%"=="WINNT" @setlocal
 
 if ""%1""=="""" goto runCommand
 
 rem Change drive and directory to %1
-if not "%OS%"=="Windows_NT" cd ""%1""
 if "%OS%"=="Windows_NT" cd /d ""%1""
-if "%OS%"=="WINNT" cd /d ""%1""
+if not "%OS%"=="Windows_NT" cd ""%1""
 shift
 
 rem Slurp the command line arguments. This loop allows for an unlimited number
@@ -44,5 +42,4 @@
 %ANT_RUN_CMD%
 
 if "%OS%"=="Windows_NT" @endlocal
-if "%OS%"=="WINNT" @endlocal
 

Modified: forrest/trunk/tools/ant/bin/antenv.cmd
==============================================================================
--- forrest/trunk/tools/ant/bin/antenv.cmd	(original)
+++ forrest/trunk/tools/ant/bin/antenv.cmd	Thu Jul 22 22:58:49 2004
@@ -1,10 +1,22 @@
 /* 
-    Copyright (c) 2003 The Apache Software Foundation.  All rights
-    reserved.
+    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 
+    Ant environment
 */
 
+'@echo off'
 call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
 call SysLoadFuncs
 
@@ -47,20 +59,7 @@
 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
-
+classpath = prepend(classpath ANT_HOME || '\lib\ant-launcher.jar')
 'SET CLASSPATH=' || classpath
 
 /* Setting classpathes, options and arguments */

Modified: forrest/trunk/tools/ant/bin/complete-ant-cmd.pl
==============================================================================
--- forrest/trunk/tools/ant/bin/complete-ant-cmd.pl	(original)
+++ forrest/trunk/tools/ant/bin/complete-ant-cmd.pl	Thu Jul 22 22:58:49 2004
@@ -30,6 +30,7 @@
 #     }
 #     compctl -K ant_complete ant build.sh
 #     
+# @author Mike Williams <mikew@cortexebusiness.com.au>
 
 my $cmdLine = $ENV{'COMP_LINE'};
 my $antCmd = $ARGV[0];

Modified: forrest/trunk/tools/ant/bin/envset.cmd
==============================================================================
--- forrest/trunk/tools/ant/bin/envset.cmd	(original)
+++ forrest/trunk/tools/ant/bin/envset.cmd	Thu Jul 22 22:58:49 2004
@@ -1,7 +1,18 @@
 /*
 
-    Copyright (c) 2003 The Apache Software Foundation.  All rights
-    reserved.
+    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:

Modified: forrest/trunk/tools/ant/bin/lcp.bat
==============================================================================
--- forrest/trunk/tools/ant/bin/lcp.bat	(original)
+++ forrest/trunk/tools/ant/bin/lcp.bat	Thu Jul 22 22:58:49 2004
@@ -1,4 +1,3 @@
-@echo off
 REM
 REM Copyright  2001-2004 The Apache Software Foundation
 REM

Modified: forrest/trunk/tools/ant/bin/runrc.cmd
==============================================================================
--- forrest/trunk/tools/ant/bin/runrc.cmd	(original)
+++ forrest/trunk/tools/ant/bin/runrc.cmd	Thu Jul 22 22:58:49 2004
@@ -1,6 +1,17 @@
 /* 
-    Copyright (c) 2003 The Apache Software Foundation.  All rights
-    reserved.
+    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 

Modified: forrest/trunk/tools/ant/lib/ant-apache-resolver.jar
==============================================================================
Binary files /tmp/tmpmWisiS and /tmp/tmpaJ3EU3 differ

Modified: forrest/trunk/tools/ant/lib/ant-jsch.jar
==============================================================================
Binary files. No diff available.

Modified: forrest/trunk/tools/ant/lib/ant-launcher.jar
==============================================================================
Binary files /tmp/tmpT0Kfia and /tmp/tmpRFoP8p differ

Modified: forrest/trunk/tools/ant/lib/ant-nodeps.jar
==============================================================================
Binary files /tmp/tmpkqSYe2 and /tmp/tmpJLyRZK differ

Modified: forrest/trunk/tools/ant/lib/ant-trax.jar
==============================================================================
Binary files /tmp/tmp1fSkmZ and /tmp/tmpUV2aek differ

Modified: forrest/trunk/tools/ant/lib/ant.jar
==============================================================================
Binary files /tmp/tmpGBtiez and /tmp/tmpz2uCoU differ

Mime
View raw message