1
|
1 |
@echo off
|
|
2 |
|
|
3 |
REM Copyright 2001,2004-2005 The Apache Software Foundation
|
|
4 |
REM
|
|
5 |
REM Licensed under the Apache License, Version 2.0 (the "License");
|
|
6 |
REM you may not use this file except in compliance with the License.
|
|
7 |
REM You may obtain a copy of the License at
|
|
8 |
REM
|
|
9 |
REM http://www.apache.org/licenses/LICENSE-2.0
|
|
10 |
REM
|
|
11 |
REM Unless required by applicable law or agreed to in writing, software
|
|
12 |
REM distributed under the License is distributed on an "AS IS" BASIS,
|
|
13 |
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14 |
REM See the License for the specific language governing permissions and
|
|
15 |
REM limitations under the License.
|
|
16 |
|
|
17 |
if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
|
|
18 |
|
|
19 |
if "%OS%"=="Windows_NT" @setlocal
|
|
20 |
if "%OS%"=="WINNT" @setlocal
|
|
21 |
|
|
22 |
rem %~dp0 is expanded pathname of the current script under NT
|
|
23 |
set DEFAULT_ANT_HOME=%~dp0..
|
|
24 |
|
|
25 |
if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%
|
|
26 |
set DEFAULT_ANT_HOME=
|
|
27 |
|
|
28 |
set _USE_CLASSPATH=yes
|
|
29 |
|
|
30 |
rem Slurp the command line arguments. This loop allows for an unlimited number
|
|
31 |
rem of arguments (up to the command line limit, anyway).
|
|
32 |
set ANT_CMD_LINE_ARGS=%1
|
|
33 |
if ""%1""=="""" goto doneStart
|
|
34 |
shift
|
|
35 |
:setupArgs
|
|
36 |
if ""%1""=="""" goto doneStart
|
|
37 |
if ""%1""==""-noclasspath"" goto clearclasspath
|
|
38 |
set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
|
|
39 |
shift
|
|
40 |
goto setupArgs
|
|
41 |
|
|
42 |
rem here is there is a -noclasspath in the options
|
|
43 |
:clearclasspath
|
|
44 |
set _USE_CLASSPATH=no
|
|
45 |
shift
|
|
46 |
goto setupArgs
|
|
47 |
|
|
48 |
rem This label provides a place for the argument list loop to break out
|
|
49 |
rem and for NT handling to skip to.
|
|
50 |
|
|
51 |
:doneStart
|
|
52 |
rem find ANT_HOME if it does not exist due to either an invalid value passed
|
|
53 |
rem by the user or the %0 problem on Windows 9x
|
|
54 |
if exist "%ANT_HOME%\lib\ant.jar" goto checkJava
|
|
55 |
|
|
56 |
rem check for ant in Program Files
|
|
57 |
if not exist "%ProgramFiles%\ant" goto checkSystemDrive
|
|
58 |
set ANT_HOME=%ProgramFiles%\ant
|
|
59 |
goto checkJava
|
|
60 |
|
|
61 |
:checkSystemDrive
|
|
62 |
rem check for ant in root directory of system drive
|
|
63 |
if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
|
|
64 |
set ANT_HOME=%SystemDrive%\ant
|
|
65 |
goto checkJava
|
|
66 |
|
|
67 |
:checkCDrive
|
|
68 |
rem check for ant in C:\ant for Win9X users
|
|
69 |
if not exist C:\ant\lib\ant.jar goto noAntHome
|
|
70 |
set ANT_HOME=C:\ant
|
|
71 |
goto checkJava
|
|
72 |
|
|
73 |
:noAntHome
|
|
74 |
echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
|
|
75 |
goto end
|
|
76 |
|
|
77 |
:checkJava
|
|
78 |
set _JAVACMD=%JAVACMD%
|
|
79 |
|
|
80 |
if "%JAVA_HOME%" == "" goto noJavaHome
|
|
81 |
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
|
|
82 |
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
|
|
83 |
goto checkJikes
|
|
84 |
|
|
85 |
:noJavaHome
|
|
86 |
if "%_JAVACMD%" == "" set _JAVACMD=java.exe
|
|
87 |
|
|
88 |
:checkJikes
|
|
89 |
if not "%JIKESPATH%"=="" goto runAntWithJikes
|
|
90 |
|
|
91 |
:runAnt
|
|
92 |
if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
|
|
93 |
if not "%CLASSPATH%"=="" goto runAntWithClasspath
|
|
94 |
"%_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%
|
|
95 |
goto end
|
|
96 |
|
|
97 |
:runAntNoClasspath
|
|
98 |
"%_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%
|
|
99 |
goto end
|
|
100 |
|
|
101 |
:runAntWithClasspath
|
|
102 |
"%_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%
|
|
103 |
goto end
|
|
104 |
|
|
105 |
:runAntWithJikes
|
|
106 |
if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath
|
|
107 |
if not "%CLASSPATH%"=="" goto runAntWithJikesAndClasspath
|
|
108 |
|
|
109 |
:runAntWithJikesNoClasspath
|
|
110 |
"%_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%
|
|
111 |
goto end
|
|
112 |
|
|
113 |
:runAntWithJikesAndClasspath
|
|
114 |
"%_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%
|
|
115 |
goto end
|
|
116 |
|
|
117 |
:end
|
|
118 |
set _JAVACMD=
|
|
119 |
set ANT_CMD_LINE_ARGS=
|
|
120 |
|
|
121 |
if "%OS%"=="Windows_NT" @endlocal
|
|
122 |
if "%OS%"=="WINNT" @endlocal
|
|
123 |
|
|
124 |
:mainEnd
|
|
125 |
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
|
|
126 |
|