forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/tools/ant/lib ant-apache-resolver.jar ant-trax.jar ant-xalan2.jar ant.jar nodeps.jar
Date Sat, 04 Oct 2003 04:55:22 GMT
jefft       2003/10/03 21:55:22

  Modified:    tools/ant/bin ant ant.bat antRun.pl lcp.bat runant.pl
                        runant.py
               tools/ant/lib ant-apache-resolver.jar ant-trax.jar
                        ant-xalan2.jar ant.jar nodeps.jar
  Log:
  Update to the official Ant 1.6 beta, needed for the new forrestbot
  
  Revision  Changes    Path
  1.5       +32 -57    xml-forrest/tools/ant/bin/ant
  
  Index: ant
  ===================================================================
  RCS file: /home/cvs/xml-forrest/tools/ant/bin/ant,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ant	17 Sep 2003 10:02:39 -0000	1.4
  +++ ant	4 Oct 2003 04:55:21 -0000	1.5
  @@ -1,6 +1,6 @@
   #! /bin/sh
   
  -#   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
  +#   Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   #   reserved.
   
   # load system-wide ant configuration
  @@ -12,6 +12,7 @@
   if [ -z "$rpm_mode" ] ; then
     rpm_mode=false;
   fi
  +
   if [ -z "$usejikes" ] ; then
     usejikes=false;
   fi
  @@ -28,18 +29,18 @@
     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 
  +  if [ -d /opt/ant ] ; then
       ANT_HOME=/opt/ant
     fi
   
  -  if [ -d "${HOME}/opt/ant" ] ; then 
  +  if [ -d "${HOME}/opt/ant" ] ; then
       ANT_HOME="${HOME}/opt/ant"
     fi
   
  @@ -51,18 +52,17 @@
     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`
  -
   fi
   
   # For Cygwin, ensure paths are in UNIX format before anything is touched
  @@ -71,40 +71,37 @@
       ANT_HOME=`cygpath --unix "$ANT_HOME"`
     [ -n "$JAVA_HOME" ] &&
       JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  -  [ -n "$CLASSPATH" ] &&
  -    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
   fi
   
   # set ANT_LIB location
   ANT_LIB="${ANT_HOME}/lib"
   
  -if [ -z "$JAVACMD" ] ; then 
  +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 
  +# 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 
  +  for i in ant ant-optional jaxp_parser xml_apis
     do
       if [ -z "$LOCALCLASSPATH" ] ; then
         LOCALCLASSPATH="$JAVALIBDIR/$i.jar"
  @@ -117,32 +114,17 @@
     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 [ -f "$i" ] ; then
  -    if [ -z "$LOCALCLASSPATH" ] ; then
  -      LOCALCLASSPATH="$i"
  -    else
  -      LOCALCLASSPATH="$i:$LOCALCLASSPATH"
  -    fi
  -  fi
  -done
  -
  -if [ -n "$JAVA_HOME" ] ; then
  -  if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
  -    LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar"
  -  fi
  +if [ -z "$LOCALCLASSPATH" ] ; then
  +    LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar
  +else
  +    LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH
  +fi
   
  -  if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
  -    LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip"
  -  fi
   
  +if [ -n "$JAVA_HOME" ] ; then
     # OSX hack to make Ant work with jikes
     if $darwin ; then
  -    OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
  +    OSXHACK="${JAVA_HOME}/../Classes"
       if [ -d "${OSXHACK}" ] ; then
         for i in "${OSXHACK}"/*.jar
         do
  @@ -150,11 +132,6 @@
         done
       fi
     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."
   fi
   
   # Allow Jikes support (off by default)
  @@ -164,24 +141,22 @@
   
   # For Cygwin, switch paths to Windows format before running java
   if $cygwin; then
  -  ANT_HOME=`cygpath --path --windows "$ANT_HOME"`
  -  JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  -  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
  +  ANT_HOME=`cygpath --windows "$ANT_HOME"`
  +  JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
     LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
  -  CYGHOME=`cygpath --path --windows "$HOME"`
  +  CYGHOME=`cygpath --windows "$HOME"`
   fi
   
   if [ -n "$CYGHOME" ]; then
     if [ -n "$JIKESPATH" ]; then
  -    JIKESPATH=`cygpath --path --windows "$JIKESPATH"`
  -    exec "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Djikes.class.path="$JIKESPATH"
-Dcygwin.user.home="$CYGHOME" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"
  +    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"
"$@"
     else
  -    exec "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Dcygwin.user.home="$CYGHOME"
$ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"
  +    exec "$JAVACMD" $ANT_OPTS -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Dcygwin.user.home="$CYGHOME"
org.apache.tools.ant.launch.Launcher $ANT_ARGS -lib "$CLASSPATH" "$@"
     fi
   else
     if [ -n "$JIKESPATH" ]; then
  -    exec "$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Djikes.class.path="$JIKESPATH"
$ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"
  +    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" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main
$ANT_ARGS "$@"
  +    exec "$JAVACMD" $ANT_OPTS -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" org.apache.tools.ant.launch.Launcher
$ANT_ARGS -lib "$CLASSPATH" "$@"
     fi
   fi
  
  
  
  1.5       +21 -22    xml-forrest/tools/ant/bin/ant.bat
  
  Index: ant.bat
  ===================================================================
  RCS file: /home/cvs/xml-forrest/tools/ant/bin/ant.bat,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ant.bat	17 Sep 2003 10:02:39 -0000	1.4
  +++ ant.bat	4 Oct 2003 04:55:21 -0000	1.5
  @@ -1,6 +1,6 @@
   @echo off
   
  -REM   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
  +REM   Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   REM   reserved.
   
   if exist "%HOME%\forrestrc_pre.bat" call "%HOME%\forrestrc_pre.bat"
  @@ -23,28 +23,28 @@
   set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
   shift
   goto setupArgs
  -rem This label provides a place for the argument list loop to break out 
  +rem This label provides a place for the argument list loop to break out
   rem and for NT handling to skip to.
  -:doneStart
   
  +: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%" goto checkJava
  +if exist "%ANT_HOME%\lib\ant.jar" goto checkJava
   
  -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
  +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
   
  @@ -54,38 +54,37 @@
   
   :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 not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
   if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
  -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"
   goto checkJikes
   
   :noJavaHome
   if "%_JAVACMD%" == "" set _JAVACMD=java.exe
  -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.
   
   :checkJikes
   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 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
  +
  +:runAntWithClasspath
  +"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%"
org.apache.tools.ant.launch.Launcher %ANT_ARGS% -lib "%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 not "%CLASSPATH%"=="" goto 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% %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%  -lib "%CLASSPATH%"
%ANT_CMD_LINE_ARGS%
   goto end
   
   :end
  -set LOCALCLASSPATH=
   set _JAVACMD=
   set ANT_CMD_LINE_ARGS=
   
  
  
  
  1.2       +5 -1      xml-forrest/tools/ant/bin/antRun.pl
  
  Index: antRun.pl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/tools/ant/bin/antRun.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- antRun.pl	30 Oct 2002 09:08:27 -0000	1.1
  +++ antRun.pl	4 Oct 2003 04:55:21 -0000	1.2
  @@ -1,4 +1,8 @@
   #!/usr/bin/perl
  +#
  +#   Copyright (c) 2001,2003 The Apache Software Foundation.  All rights
  +#   reserved.
  +#
   #######################################################################
   #
   # antRun.pl
  @@ -7,7 +11,7 @@
   # this is akin to antRun.bat, and antRun the SH script 
   #
   # created:         2001-10-18
  -# last modified:   2001-11-13
  +# last modified:   $Date$
   # author:          Jeff Tulley jtulley@novell.com 
   #######################################################################
   #be fussy about variables
  
  
  
  1.4       +2 -2      xml-forrest/tools/ant/bin/lcp.bat
  
  Index: lcp.bat
  ===================================================================
  RCS file: /home/cvs/xml-forrest/tools/ant/bin/lcp.bat,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- lcp.bat	30 Oct 2002 09:08:27 -0000	1.3
  +++ lcp.bat	4 Oct 2003 04:55:21 -0000	1.4
  @@ -1,4 +1,4 @@
  -REM   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
  +REM   Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   REM   reserved.
   
   set _CLASSPATHCOMPONENT=%1
  @@ -7,7 +7,7 @@
   
   :argCheck
   if ""%1""=="""" goto gotAllArgs
  -set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT%;%1
  +set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
   shift
   goto argCheck
   
  
  
  
  1.4       +42 -62    xml-forrest/tools/ant/bin/runant.pl
  
  Index: runant.pl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/tools/ant/bin/runant.pl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- runant.pl	30 Oct 2002 09:08:27 -0000	1.3
  +++ runant.pl	4 Oct 2003 04:55:21 -0000	1.4
  @@ -1,6 +1,6 @@
   #!/usr/bin/perl
   #
  -#   Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
  +#   Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
   #   reserved.
   #
   #######################################################################
  @@ -18,7 +18,7 @@
   # the code is not included. 
   #
   # created:         2000-8-24
  -# last modified:   2000-8-24
  +# last modified:   $Date$
   # author:          Steve Loughran steve_l@sourceforge.net
   #######################################################################
   #
  @@ -39,7 +39,7 @@
   #use warnings;
   
   #and set $debug to 1 to turn on trace info
  -my $debug=0;
  +my $debug=1;
   
   #######################################################################
   #
  @@ -61,6 +61,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 +74,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 "jarfiles=@jarfiles\n" 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 +87,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;
  
  
  
  1.2       +52 -63    xml-forrest/tools/ant/bin/runant.py
  
  Index: runant.py
  ===================================================================
  RCS file: /home/cvs/xml-forrest/tools/ant/bin/runant.py,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- runant.py	30 Oct 2002 09:08:27 -0000	1.1
  +++ runant.py	4 Oct 2003 04:55:21 -0000	1.2
  @@ -3,12 +3,12 @@
   
    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
  +    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
  +        Copyright (c) 2001,2003 The Apache Software Foundation.  All rights
           reserved.
   
    created:         2001-04-11
  @@ -17,7 +17,6 @@
    Assumptions:
   
    - the "java" executable/script is on the command path
  - - ANT_HOME has been set
   """
   import os, os.path, string, sys
   
  @@ -25,75 +24,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']
  -
  -# Sets the separator char for CLASSPATH
  -SEPARATOR = ':'
  -if os.name == 'dos' or os.name == 'nt':
  -	SEPARATOR = ';'
  +    ANT_HOME = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
   
  -# Build up standard classpath
  -localpath = ''
  -if os.environ.has_key('CLASSPATH'):
  -	localpath = os.environ['CLASSPATH']
  -else:
  -	if debug:
  -		print 'Warning: no initial classpath\n'
  +# set ANT_LIB location
  +ANT_LIB = os.path.join(ANT_HOME, 'lib')
   
  -# 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)
  
  
  
  1.4       +41 -30    xml-forrest/tools/ant/lib/ant-apache-resolver.jar
  
  	<<Binary file>>
  
  
  1.4       +312 -268  xml-forrest/tools/ant/lib/ant-trax.jar
  
  	<<Binary file>>
  
  
  1.4       +3 -1      xml-forrest/tools/ant/lib/ant-xalan2.jar
  
  	<<Binary file>>
  
  
  1.5       +4511 -3139xml-forrest/tools/ant/lib/ant.jar
  
  	<<Binary file>>
  
  
  1.4       +1854 -1292xml-forrest/tools/ant/lib/nodeps.jar
  
  	<<Binary file>>
  
  

Mime
View raw message