]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.core/src/main/config/bin/slc.bat
Rename into Core
[gpl/argeo-slc.git] / org.argeo.slc.core / src / main / config / bin / slc.bat
diff --git a/org.argeo.slc.core/src/main/config/bin/slc.bat b/org.argeo.slc.core/src/main/config/bin/slc.bat
new file mode 100644 (file)
index 0000000..f8fb7d5
--- /dev/null
@@ -0,0 +1,226 @@
+@echo off\r
+\r
+REM  Licensed to the Apache Software Foundation (ASF) under one or more\r
+REM  contributor license agreements.  See the NOTICE file distributed with\r
+REM  this work for additional information regarding copyright ownership.\r
+REM  The ASF licenses this file to You under the Apache License, Version 2.0\r
+REM  (the "License"); you may not use this file except in compliance with\r
+REM  the License.  You may obtain a copy of the License at\r
+REM \r
+REM      http://www.apache.org/licenses/LICENSE-2.0\r
+REM \r
+REM  Unless required by applicable law or agreed to in writing, software\r
+REM  distributed under the License is distributed on an "AS IS" BASIS,\r
+REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+REM  See the License for the specific language governing permissions and\r
+REM  limitations under the License.\r
+\r
+REM This is an inordinately troublesome piece of code, particularly because it\r
+REM tries to work on both Win9x and WinNT-based systems. If we could abandon '9x\r
+REM support, things would be much easier, but sadly, it is not yet time.\r
+REM Be cautious about editing this, and only add WinNT specific stuff in code that\r
+REM only runs on WinNT.\r
+\r
+if "%HOME%"=="" goto homeDrivePathPre\r
+if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"\r
+\r
+:homeDrivePathPre\r
+if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre\r
+if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre\r
+if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat"\r
+\r
+:userProfilePre\r
+if "%USERPROFILE%"=="" goto alpha\r
+if "%USERPROFILE%"=="%HOME%" goto alpha\r
+if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha\r
+if exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat"\r
+\r
+:alpha\r
+\r
+if "%OS%"=="Windows_NT" @setlocal\r
+if "%OS%"=="WINNT" @setlocal\r
+\r
+if "%ANT_HOME%"=="" goto setDefaultAntHome\r
+\r
+:stripAntHome\r
+if not _%ANT_HOME:~-1%==_\ goto checkClasspath\r
+set ANT_HOME=%ANT_HOME:~0,-1%\r
+goto stripAntHome\r
+\r
+:setDefaultAntHome\r
+rem %~dp0 is expanded pathname of the current script under NT\r
+set ANT_HOME=%~dp0..\r
+\r
+:checkClasspath\r
+set _USE_CLASSPATH=yes\r
+rem CLASSPATH must not be used if it is equal to ""\r
+if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no\r
+if "%CLASSPATH%"=="" set _USE_CLASSPATH=no\r
+\r
+rem Slurp the command line arguments. This loop allows for an unlimited number\r
+rem of arguments (up to the command line limit, anyway).\r
+set ANT_CMD_LINE_ARGS=%1\r
+if ""%1""=="""" goto doneStart\r
+shift\r
+:setupArgs\r
+if ""%1""=="""" goto doneStart\r
+if ""%1""==""-noclasspath"" goto clearclasspath\r
+set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1\r
+shift\r
+goto setupArgs\r
+\r
+rem here is there is a -noclasspath in the options\r
+:clearclasspath\r
+set _USE_CLASSPATH=no\r
+shift\r
+goto setupArgs\r
+\r
+rem This label provides a place for the argument list loop to break out\r
+rem and for NT handling to skip to.\r
+\r
+:doneStart\r
+\r
+if _USE_CLASSPATH==no goto findAntHome\r
+\r
+:stripClasspath\r
+if not _%CLASSPATH:~-1%==_\ goto findAntHome\r
+set CLASSPATH=%CLASSPATH:~0,-1%\r
+goto stripClasspath\r
+\r
+:findAntHome\r
+rem find ANT_HOME if it does not exist due to either an invalid value passed\r
+rem by the user or the %0 problem on Windows 9x\r
+if exist "%ANT_HOME%\lib\ant.jar" goto checkJava\r
+\r
+rem check for ant in Program Files\r
+if not exist "%ProgramFiles%\ant" goto checkSystemDrive\r
+set ANT_HOME=%ProgramFiles%\ant\r
+goto checkJava\r
+\r
+:checkSystemDrive\r
+rem check for ant in root directory of system drive\r
+if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive\r
+set ANT_HOME=%SystemDrive%\ant\r
+goto checkJava\r
+\r
+:checkCDrive\r
+rem check for ant in C:\ant for Win9X users\r
+if not exist C:\ant\lib\ant.jar goto noAntHome\r
+set ANT_HOME=C:\ant\r
+goto checkJava\r
+\r
+:noAntHome\r
+echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.\r
+goto end\r
+\r
+:checkJava\r
+set _JAVACMD=%JAVACMD%\r
+\r
+if "%JAVA_HOME%" == "" goto noJavaHome\r
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome\r
+if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe\r
+goto checkJikes\r
+\r
+:noJavaHome\r
+if "%_JAVACMD%" == "" set _JAVACMD=java.exe\r
+\r
+:checkJikes\r
+if not "%JIKESPATH%"=="" goto runAntWithJikes\r
+\r
+:runAnt\r
+if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath\r
+:runAntWithClasspath\r
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%\r
+rem Check the error code of the Ant build\r
+if not "%OS%"=="Windows_NT" goto onError\r
+set ANT_ERROR=%ERRORLEVEL%\r
+goto end\r
+\r
+:runAntNoClasspath\r
+"%_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%\r
+rem Check the error code of the Ant build\r
+if not "%OS%"=="Windows_NT" goto onError\r
+set ANT_ERROR=%ERRORLEVEL%\r
+goto end\r
+\r
+:runAntWithJikes\r
+\r
+if not _%JIKESPATH:~-1%==_\ goto checkJikesAndClasspath\r
+set JIKESPATH=%JIKESPATH:~0,-1%\r
+goto runAntWithJikes\r
+\r
+:checkJikesAndClasspath\r
+\r
+if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath\r
+\r
+:runAntWithJikesAndClasspath\r
+"%_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%  -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%\r
+rem Check the error code of the Ant build\r
+if not "%OS%"=="Windows_NT" goto onError\r
+set ANT_ERROR=%ERRORLEVEL%\r
+goto end\r
+\r
+:runAntWithJikesNoClasspath\r
+"%_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%\r
+rem Check the error code of the Ant build\r
+if not "%OS%"=="Windows_NT" goto onError\r
+set ANT_ERROR=%ERRORLEVEL%\r
+goto end\r
+\r
+:onError\r
+rem Windows 9x way of checking the error code.  It matches via brute force.\r
+for %%i in (1 10 100) do set err%%i=\r
+for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i\r
+if %err100%==2 goto onError200\r
+if %err100%==0 set err100=\r
+for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i\r
+if "%err100%"=="" if %err10%==0 set err10=\r
+:onError1\r
+for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i\r
+goto onErrorEnd\r
+:onError200\r
+for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i\r
+if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i\r
+if not err10==5 goto onError1\r
+:onErrorEnd\r
+set ANT_ERROR=%err100%%err10%%err1%\r
+for %%i in (1 10 100) do set err%%i=\r
+\r
+:end\r
+rem bug ID 32069: resetting an undefined env variable changes the errorlevel.\r
+if not "%_JAVACMD%"=="" set _JAVACMD=\r
+if not "%_ANT_CMD_LINE_ARGS%"=="" set ANT_CMD_LINE_ARGS=\r
+\r
+if "%ANT_ERROR%"=="0" goto mainEnd\r
+\r
+rem Set the return code if we are not in NT.  We can only set\r
+rem a value of 1, but it's better than nothing.\r
+if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1\r
+\r
+rem Set the ERRORLEVEL if we are running NT.\r
+if "%OS%"=="Windows_NT" color 00\r
+\r
+goto omega\r
+\r
+:mainEnd\r
+\r
+rem If there were no errors, we run the post script.\r
+if "%OS%"=="Windows_NT" @endlocal\r
+if "%OS%"=="WINNT" @endlocal\r
+\r
+if "%HOME%"=="" goto homeDrivePathPost\r
+if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"\r
+\r
+:homeDrivePathPost\r
+if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost\r
+if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost\r
+if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat"\r
+\r
+:userProfilePost\r
+if "%USERPROFILE%"=="" goto omega\r
+if "%USERPROFILE%"=="%HOME%" goto omega\r
+if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega\r
+if exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat"\r
+\r
+:omega\r
+\r