From: Simon Pepping Date: Tue, 6 Dec 2011 11:13:00 +0000 (+0000) Subject: Rename fop.cmd to fop.bat and let fop.cmd call fop.bat X-Git-Tag: fop-1_1rc1old~154 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5086f073c094c7f4d1956700084998efff1a2a8a;p=xmlgraphics-fop.git Rename fop.cmd to fop.bat and let fop.cmd call fop.bat git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1210863 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/fop.bat b/fop.bat new file mode 100644 index 000000000..3a0538d5e --- /dev/null +++ b/fop.bat @@ -0,0 +1,75 @@ +@ECHO OFF +REM Licensed to the Apache Software Foundation (ASF) under one or more +REM contributor license agreements. See the NOTICE file distributed with +REM this work for additional information regarding copyright ownership. +REM The ASF licenses this file to You under the Apache License, Version 2.0 +REM (the "License"); you may not use this file except in compliance with +REM the License. You may obtain a copy of the License at +REM +REM http://www.apache.org/licenses/LICENSE-2.0 +REM +REM Unless required by applicable law or agreed to in writing, software +REM distributed under the License is distributed on an "AS IS" BASIS, +REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +REM See the License for the specific language governing permissions and +REM limitations under the License. +REM $Id$ + +SETLOCAL ENABLEDELAYEDEXPANSION + +rem %~dp0 is the expanded pathname of the current script under NT +set LOCAL_FOP_HOME= +if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME="%~dp0" + +rem Code from Apache Ant project +rem Slurp the command line arguments. This loop allows for an unlimited number +rem of arguments (up to the command line limit, anyway). +rem Could also do a "shift" and "%*" for all params, but apparently doesn't work +rem with Win9x. +set FOP_CMD_LINE_ARGS=%1 +if ""%1""=="""" goto doneStart +shift +:setupArgs +if ""%1""=="""" goto doneStart +set FOP_CMD_LINE_ARGS=%FOP_CMD_LINE_ARGS% %1 +shift +goto setupArgs +rem This label provides a place for the argument list loop to break out +rem and for NT handling to skip to. +:doneStart + +set LOGCHOICE= +rem The default commons logger for JDK1.4 is JDK1.4Logger. +rem To use a different logger, uncomment the one desired below +rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog +rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog +rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger + +set LOGLEVEL= +rem Logging levels +rem Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger. +rem To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%\JRE\LIB\logging.properties +rem file instead. +rem Possible SimpleLog values: "trace", "debug", "info" (default), "warn", "error", or "fatal". +rem set LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO + +set LIBDIR=%LOCAL_FOP_HOME%lib + +set LOCALCLASSPATH=%FOP_HYPHENATION_PATH% +for %%l in (%LOCAL_FOP_HOME%build\*.jar %LIBDIR%\*.jar) do set LOCALCLASSPATH=!LOCALCLASSPATH!;%%l + +set JAVAOPTS=-Denv.windir=%WINDIR% + +if "%JAVA_HOME%" == "" goto noJavaHome +if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome +if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java +goto runFop + +:noJavaHome +if "%JAVACMD%" == "" set JAVACMD=java + +:runFop +rem echo "%JAVACMD%" %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS% +"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" %FOP_OPTS% org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS% + +ENDLOCAL diff --git a/fop.cmd b/fop.cmd index 3a0538d5e..33f164c53 100644 --- a/fop.cmd +++ b/fop.cmd @@ -15,17 +15,7 @@ REM See the License for the specific language governing permissions and REM limitations under the License. REM $Id$ -SETLOCAL ENABLEDELAYEDEXPANSION - -rem %~dp0 is the expanded pathname of the current script under NT -set LOCAL_FOP_HOME= -if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME="%~dp0" - -rem Code from Apache Ant project -rem Slurp the command line arguments. This loop allows for an unlimited number -rem of arguments (up to the command line limit, anyway). -rem Could also do a "shift" and "%*" for all params, but apparently doesn't work -rem with Win9x. +set LOCAL_FOP_HOME=%~dp0 set FOP_CMD_LINE_ARGS=%1 if ""%1""=="""" goto doneStart shift @@ -35,41 +25,7 @@ set FOP_CMD_LINE_ARGS=%FOP_CMD_LINE_ARGS% %1 shift goto setupArgs rem This label provides a place for the argument list loop to break out -rem and for NT handling to skip to. :doneStart -set LOGCHOICE= -rem The default commons logger for JDK1.4 is JDK1.4Logger. -rem To use a different logger, uncomment the one desired below -rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog -rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger - -set LOGLEVEL= -rem Logging levels -rem Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger. -rem To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%\JRE\LIB\logging.properties -rem file instead. -rem Possible SimpleLog values: "trace", "debug", "info" (default), "warn", "error", or "fatal". -rem set LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO - -set LIBDIR=%LOCAL_FOP_HOME%lib - -set LOCALCLASSPATH=%FOP_HYPHENATION_PATH% -for %%l in (%LOCAL_FOP_HOME%build\*.jar %LIBDIR%\*.jar) do set LOCALCLASSPATH=!LOCALCLASSPATH!;%%l - -set JAVAOPTS=-Denv.windir=%WINDIR% - -if "%JAVA_HOME%" == "" goto noJavaHome -if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome -if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java -goto runFop - -:noJavaHome -if "%JAVACMD%" == "" set JAVACMD=java - -:runFop -rem echo "%JAVACMD%" %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS% -"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" %FOP_OPTS% org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS% +call %LOCAL_FOP_HOME%\fop.bat %FOP_CMD_LINE_ARGS% -ENDLOCAL