patrickl 2002/08/01 10:55:51 Modified: jasper2/src/bin jspc.bat jspc.sh Removed: jasper2/src/bin jasper.bat jasper.sh Log: Convert jspc.* scripts to use commons-launcher and remove jasper.* scripts since it was hard coded to be a support script for the jspc.* scripts only. Revision Changes Path 1.2 +21 -22 jakarta-tomcat-jasper/jasper2/src/bin/jspc.bat Index: jspc.bat =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/bin/jspc.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jspc.bat 28 Mar 2002 18:46:15 -0000 1.1 +++ jspc.bat 1 Aug 2002 17:55:51 -0000 1.2 @@ -1,33 +1,31 @@ @echo off if "%OS%" == "Windows_NT" setlocal + rem --------------------------------------------------------------------------- -rem Script to run the Jasper "offline JSP compiler" rem -rem $Id$ +rem Script for running JSPC compiler using the Launcher +rem rem --------------------------------------------------------------------------- -rem Guess JASPER_HOME if not defined -if not "%JASPER_HOME%" == "" goto gotHome -set JASPER_HOME=. -if exist "%JASPER_HOME%\bin\jspc.bat" goto okHome -set JASPER_HOME=.. -:gotHome -if exist "%JASPER_HOME%\bin\jspc.bat" goto okHome -echo The JASPER_HOME environment variable is not defined correctly -echo This environment variable is needed to run this program -goto end -:okHome - -set EXECUTABLE=%JASPER_HOME%\bin\jasper.bat +rem Get standard environment variables +set PRG=%0 +if exist %PRG%\..\setenv.bat goto gotCmdPath +rem %0 must have been found by DOS using the %PATH% so we assume that +rem setenv.bat will also be found in the %PATH% +call setenv.bat +goto doneSetenv +:gotCmdPath +call %PRG%\..\setenv.bat +:doneSetenv -rem Check that target executable exists -if exist "%EXECUTABLE%" goto okExec -echo Cannot find %EXECUTABLE% -echo This file is needed to run this program +rem Make sure prerequisite environment variables are set +if not "%JAVA_HOME%" == "" goto gotJavaHome +echo The JAVA_HOME environment variable is not defined +echo This environment variable is needed to run this program goto end -:okExec +:gotJavaHome -rem Get remaining unshifted command line arguments and save them in the +rem Get command line arguments and save them with the proper quoting set CMD_LINE_ARGS= :setArgs if ""%1""=="""" goto doneSetArgs @@ -36,6 +34,7 @@ goto setArgs :doneSetArgs -call "%EXECUTABLE%" jspc %CMD_LINE_ARGS% +rem Execute the Launcher using the "jspc" target +"%JAVA_HOME%\bin\java.exe" -classpath %PRG%\..;"%PATH%" LauncherBootstrap -launchfile jasper.xml -verbose jspc %CMD_LINE_ARGS% :end 1.2 +11 -13 jakarta-tomcat-jasper/jasper2/src/bin/jspc.sh Index: jspc.sh =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/bin/jspc.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jspc.sh 28 Mar 2002 18:46:15 -0000 1.1 +++ jspc.sh 1 Aug 2002 17:55:51 -0000 1.2 @@ -1,14 +1,15 @@ #!/bin/sh + # ----------------------------------------------------------------------------- -# Script to run the Jasper "offline JSP compiler" # -# $Id$ +# Script for running JSPC compiler using the Launcher +# # ----------------------------------------------------------------------------- -# resolve links - $0 may be a softlink +# Resolve links - $0 may be a softlink PRG="$0" -while [ -h "$PRG" ] ; do +while [ -h "$PRG" ]; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '.*/.*' > /dev/null; then @@ -17,15 +18,12 @@ PRG=`dirname "$PRG"`/"$link" fi done - -PRGDIR=`dirname "$PRG"` -EXECUTABLE=jasper.sh -# Check that target executable exists -if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then - echo "Cannot find $PRGDIR/$EXECUTABLE" - echo "This file is needed to run this program" - exit 1 +# Get standard environment variables +PRGDIR=`dirname "$PRG"` +if [ -r "$PRGDIR"/setenv.sh ]; then + . "$PRGDIR"/setenv.sh fi -exec "$PRGDIR"/"$EXECUTABLE" jspc "$@" +# Execute the Launcher using the "jspc" target +exec "$JAVA_HOME"/bin/java -classpath "$PRGDIR" LauncherBootstrap -launchfile jasper.xml -verbose jspc "$@"
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>