OSDN Git Service

DBFlute-0.9.3に更新
[ea2ddl/ea2ddl.git] / ea2ddl-gen / dbflute-0.9.3 / ant / bin / ant.bat
1 @echo off\r
2 \r
3 REM  Licensed to the Apache Software Foundation (ASF) under one or more\r
4 REM  contributor license agreements.  See the NOTICE file distributed with\r
5 REM  this work for additional information regarding copyright ownership.\r
6 REM  The ASF licenses this file to You under the Apache License, Version 2.0\r
7 REM  (the "License"); you may not use this file except in compliance with\r
8 REM  the License.  You may obtain a copy of the License at\r
9 REM \r
10 REM      http://www.apache.org/licenses/LICENSE-2.0\r
11 REM \r
12 REM  Unless required by applicable law or agreed to in writing, software\r
13 REM  distributed under the License is distributed on an "AS IS" BASIS,\r
14 REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
15 REM  See the License for the specific language governing permissions and\r
16 REM  limitations under the License.\r
17 \r
18 REM This is an inordinately troublesome piece of code, particularly because it\r
19 REM tries to work on both Win9x and WinNT-based systems. If we could abandon '9x\r
20 REM support, things would be much easier, but sadly, it is not yet time.\r
21 REM Be cautious about editing this, and only add WinNT specific stuff in code that\r
22 REM only runs on WinNT.\r
23 \r
24 if "%HOME%"=="" goto homeDrivePathPre\r
25 if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"\r
26 \r
27 :homeDrivePathPre\r
28 if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre\r
29 if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre\r
30 if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat"\r
31 \r
32 :userProfilePre\r
33 if "%USERPROFILE%"=="" goto alpha\r
34 if "%USERPROFILE%"=="%HOME%" goto alpha\r
35 if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha\r
36 if exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat"\r
37 \r
38 :alpha\r
39 \r
40 if "%OS%"=="Windows_NT" @setlocal\r
41 if "%OS%"=="WINNT" @setlocal\r
42 \r
43 if "%ANT_HOME%"=="" goto setDefaultAntHome\r
44 \r
45 :stripAntHome\r
46 if not _%ANT_HOME:~-1%==_\ goto checkClasspath\r
47 set ANT_HOME=%ANT_HOME:~0,-1%\r
48 goto stripAntHome\r
49 \r
50 :setDefaultAntHome\r
51 rem %~dp0 is expanded pathname of the current script under NT\r
52 set ANT_HOME=%~dp0..\r
53 \r
54 :checkClasspath\r
55 set _USE_CLASSPATH=yes\r
56 rem CLASSPATH must not be used if it is equal to ""\r
57 if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no\r
58 if "%CLASSPATH%"=="" set _USE_CLASSPATH=no\r
59 \r
60 rem Slurp the command line arguments. This loop allows for an unlimited number\r
61 rem of arguments (up to the command line limit, anyway).\r
62 set ANT_CMD_LINE_ARGS=%1\r
63 if ""%1""=="""" goto doneStart\r
64 shift\r
65 :setupArgs\r
66 if ""%1""=="""" goto doneStart\r
67 if ""%1""==""-noclasspath"" goto clearclasspath\r
68 set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1\r
69 shift\r
70 goto setupArgs\r
71 \r
72 rem here is there is a -noclasspath in the options\r
73 :clearclasspath\r
74 set _USE_CLASSPATH=no\r
75 shift\r
76 goto setupArgs\r
77 \r
78 rem This label provides a place for the argument list loop to break out\r
79 rem and for NT handling to skip to.\r
80 \r
81 :doneStart\r
82 \r
83 if _USE_CLASSPATH==no goto findAntHome\r
84 \r
85 :stripClasspath\r
86 if not _%CLASSPATH:~-1%==_\ goto findAntHome\r
87 set CLASSPATH=%CLASSPATH:~0,-1%\r
88 goto stripClasspath\r
89 \r
90 :findAntHome\r
91 rem find ANT_HOME if it does not exist due to either an invalid value passed\r
92 rem by the user or the %0 problem on Windows 9x\r
93 if exist "%ANT_HOME%\lib\ant.jar" goto checkJava\r
94 \r
95 rem check for ant in Program Files\r
96 if not exist "%ProgramFiles%\ant" goto checkSystemDrive\r
97 set ANT_HOME=%ProgramFiles%\ant\r
98 goto checkJava\r
99 \r
100 :checkSystemDrive\r
101 rem check for ant in root directory of system drive\r
102 if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive\r
103 set ANT_HOME=%SystemDrive%\ant\r
104 goto checkJava\r
105 \r
106 :checkCDrive\r
107 rem check for ant in C:\ant for Win9X users\r
108 if not exist C:\ant\lib\ant.jar goto noAntHome\r
109 set ANT_HOME=C:\ant\r
110 goto checkJava\r
111 \r
112 :noAntHome\r
113 echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.\r
114 goto end\r
115 \r
116 :checkJava\r
117 set _JAVACMD=%JAVACMD%\r
118 \r
119 if "%JAVA_HOME%" == "" goto noJavaHome\r
120 if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome\r
121 if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe\r
122 goto checkJikes\r
123 \r
124 :noJavaHome\r
125 if "%_JAVACMD%" == "" set _JAVACMD=java.exe\r
126 \r
127 :checkJikes\r
128 if not "%JIKESPATH%"=="" goto runAntWithJikes\r
129 \r
130 :runAnt\r
131 if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath\r
132 :runAntWithClasspath\r
133 "%_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
134 rem Check the error code of the Ant build\r
135 if not "%OS%"=="Windows_NT" goto onError\r
136 set ANT_ERROR=%ERRORLEVEL%\r
137 goto end\r
138 \r
139 :runAntNoClasspath\r
140 "%_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
141 rem Check the error code of the Ant build\r
142 if not "%OS%"=="Windows_NT" goto onError\r
143 set ANT_ERROR=%ERRORLEVEL%\r
144 goto end\r
145 \r
146 :runAntWithJikes\r
147 \r
148 if not _%JIKESPATH:~-1%==_\ goto checkJikesAndClasspath\r
149 set JIKESPATH=%JIKESPATH:~0,-1%\r
150 goto runAntWithJikes\r
151 \r
152 :checkJikesAndClasspath\r
153 \r
154 if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath\r
155 \r
156 :runAntWithJikesAndClasspath\r
157 "%_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
158 rem Check the error code of the Ant build\r
159 if not "%OS%"=="Windows_NT" goto onError\r
160 set ANT_ERROR=%ERRORLEVEL%\r
161 goto end\r
162 \r
163 :runAntWithJikesNoClasspath\r
164 "%_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
165 rem Check the error code of the Ant build\r
166 if not "%OS%"=="Windows_NT" goto onError\r
167 set ANT_ERROR=%ERRORLEVEL%\r
168 goto end\r
169 \r
170 :onError\r
171 rem Windows 9x way of checking the error code.  It matches via brute force.\r
172 for %%i in (1 10 100) do set err%%i=\r
173 for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i\r
174 if %err100%==2 goto onError200\r
175 if %err100%==0 set err100=\r
176 for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i\r
177 if "%err100%"=="" if %err10%==0 set err10=\r
178 :onError1\r
179 for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i\r
180 goto onErrorEnd\r
181 :onError200\r
182 for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i\r
183 if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i\r
184 if not err10==5 goto onError1\r
185 :onErrorEnd\r
186 set ANT_ERROR=%err100%%err10%%err1%\r
187 for %%i in (1 10 100) do set err%%i=\r
188 \r
189 :end\r
190 rem bug ID 32069: resetting an undefined env variable changes the errorlevel.\r
191 if not "%_JAVACMD%"=="" set _JAVACMD=\r
192 if not "%_ANT_CMD_LINE_ARGS%"=="" set ANT_CMD_LINE_ARGS=\r
193 \r
194 if "%ANT_ERROR%"=="0" goto mainEnd\r
195 \r
196 rem Set the return code if we are not in NT.  We can only set\r
197 rem a value of 1, but it's better than nothing.\r
198 if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1\r
199 \r
200 rem Set the ERRORLEVEL if we are running NT.\r
201 if "%OS%"=="Windows_NT" color 00\r
202 \r
203 goto omega\r
204 \r
205 :mainEnd\r
206 \r
207 rem If there were no errors, we run the post script.\r
208 if "%OS%"=="Windows_NT" @endlocal\r
209 if "%OS%"=="WINNT" @endlocal\r
210 \r
211 if "%HOME%"=="" goto homeDrivePathPost\r
212 if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"\r
213 \r
214 :homeDrivePathPost\r
215 if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost\r
216 if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost\r
217 if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat"\r
218 \r
219 :userProfilePost\r
220 if "%USERPROFILE%"=="" goto omega\r
221 if "%USERPROFILE%"=="%HOME%" goto omega\r
222 if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega\r
223 if exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat"\r
224 \r
225 :omega\r
226 \r