You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by er...@locus.apache.org on 2000/11/16 21:30:04 UTC

cvs commit: xml-xerces/java/tools/bin ant ant.bat antRun antRun.bat lcp.bat

ericye      00/11/16 12:30:04

  Added:       java/tools/bin ant ant.bat antRun antRun.bat lcp.bat
  Log:
  scripts needed by ant on Unix platforms
  
  Revision  Changes    Path
  1.1                  xml-xerces/java/tools/bin/ant
  
  Index: ant
  ===================================================================
  #! /bin/sh
  
  if [ -f $HOME/.antrc ] ; then 
    . $HOME/.antrc
  fi
  
  if [ "$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
  
    ## resolve links - $0 may be a link to ant's home
    PRG=$0
    progname=`basename $0`
    
    while [ -h "$PRG" ] ; do
      ls=`ls -ld "$PRG"`
      link=`expr "$ls" : '.*-> \(.*\)$'`
      if expr "$link" : '.*/.*' > /dev/null; then
  	PRG="$link"
      else
  	PRG="`dirname $PRG`/$link"
      fi
    done
    
    ANT_HOME=`dirname "$PRG"`/..
  
  fi
  
  # Allow .antrc to specifiy flags to java cmd
  if [ "$JAVACMD" = "" ] ; then 
    JAVACMD=java
  fi
  
  LOCALCLASSPATH=`echo $ANT_HOME/lib/*.jar | tr ' ' ':'`
  
  if [ "$CLASSPATH" != "" ] ; then
    LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH
  fi
  
  if [ "$JAVA_HOME" != "" ] ; then
    if test -f $JAVA_HOME/lib/tools.jar ; then
      LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
    fi
  
    if test -f $JAVA_HOME/lib/classes.zip ; then
      LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip
    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
  
  # supply JIKESPATH to Ant as jikes.class.path
  if [ "$JIKESPATH" != "" ] ; then
    if [ "$ANT_OPTS" != "" ] ; then
      ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH"
    else
      ANT_OPTS=-Djikes.class.path=$JIKESPATH
    fi
  fi
  
  $JAVACMD -classpath $LOCALCLASSPATH -Dant.home=${ANT_HOME} $ANT_OPTS org.apache.tools.ant.Main $@
  
  
  
  
  1.1                  xml-xerces/java/tools/bin/ant.bat
  
  Index: ant.bat
  ===================================================================
  @echo off
  rem find ANT_HOME
  if not "%ANT_HOME%"=="" 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
  goto checkJava
  
  :checkSystemDrive
  rem check for ant in root directory of system drive
  if not exist "%SystemDrive%\ant" goto noAntHome
  set ANT_HOME=%SystemDrive%\ant
  goto checkJava
  
  :noAntHome
  echo ANT_HOME is not set and ant could not be located. Please set ANT_HOME.
  goto end
  
  :checkJava
  if "%JAVACMD%" == "" set JAVACMD=java
  
  set LOCALCLASSPATH=%CLASSPATH%
  for %%i in (%ANT_HOME%\lib\*.jar) do call %ANT_HOME%\bin\lcp.bat %%i
  
  if "%JAVA_HOME%" == "" goto noJavaHome
  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
  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
  set ANT_OPTS_RUN=%ANT_OPTS%
  if not "%JIKESPATH%" == "" set ANT_OPTS_RUN=%ANT_OPTS% -Djikes.class.path=%JIKESPATH%
  
  :runAnt
  %JAVACMD% -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS_RUN% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
  
  :end
  set LOCALCLASSPATH=
  
  
  
  
  1.1                  xml-xerces/java/tools/bin/antRun
  
  Index: antRun
  ===================================================================
  #! /bin/sh
  
  # Args: DIR command
  cd "$1"
  CMD="$2"
  shift
  shift
  
  exec $CMD "$@"
  
  
  
  1.1                  xml-xerces/java/tools/bin/antRun.bat
  
  Index: antRun.bat
  ===================================================================
  @echo off
  
  cd %1
  set ANT_RUN_CMD=%2
  shift
  shift
  
  set PARAMS=
  :loop
  if "%1" == "" goto runCommand
  set PARAMS=%PARAMS% %1
  shift
  goto loop
  
  :runCommand
  echo %ANT_RUN_CMD% %PARAMS%
  %ANT_RUN_CMD% %PARAMS%
  
  
  
  
  1.1                  xml-xerces/java/tools/bin/lcp.bat
  
  Index: lcp.bat
  ===================================================================
  set LOCALCLASSPATH=%LOCALCLASSPATH%;%1