⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ant.bat

📁 Use the links below to download a source distribution of Ant from one of our mirrors. It is good pra
💻 BAT
字号:
@echo offREM  Licensed to the Apache Software Foundation (ASF) under one or moreREM  contributor license agreements.  See the NOTICE file distributed withREM  this work for additional information regarding copyright ownership.REM  The ASF licenses this file to You under the Apache License, Version 2.0REM  (the "License"); you may not use this file except in compliance withREM  the License.  You may obtain a copy of the License atREM REM      http://www.apache.org/licenses/LICENSE-2.0REM REM  Unless required by applicable law or agreed to in writing, softwareREM  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 andREM  limitations under the License.REM This is an inordinately troublesome piece of code, particularly because itREM tries to work on both Win9x and WinNT-based systems. If we could abandon '9xREM support, things would be much easier, but sadly, it is not yet time.REM Be cautious about editing this, and only add WinNT specific stuff in code thatREM only runs on WinNT.if "%HOME%"=="" goto homeDrivePathPreif exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat":homeDrivePathPreif "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePreif "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePreif exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat":userProfilePreif "%USERPROFILE%"=="" goto alphaif "%USERPROFILE%"=="%HOME%" goto alphaif "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alphaif exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat":alphaif "%OS%"=="Windows_NT" @setlocalif "%OS%"=="WINNT" @setlocalif "%ANT_HOME%"=="" goto setDefaultAntHome:stripAntHomeif not _%ANT_HOME:~-1%==_\ goto checkClasspathset ANT_HOME=%ANT_HOME:~0,-1%goto stripAntHome:setDefaultAntHomerem %~dp0 is expanded pathname of the current script under NTset ANT_HOME=%~dp0..:checkClasspathset _USE_CLASSPATH=yesrem CLASSPATH must not be used if it is equal to ""if "%CLASSPATH%"=="""" set _USE_CLASSPATH=noif "%CLASSPATH%"=="" set _USE_CLASSPATH=norem Slurp the command line arguments. This loop allows for an unlimited numberrem of arguments (up to the command line limit, anyway).set ANT_CMD_LINE_ARGS=%1if ""%1""=="""" goto doneStartshift:setupArgsif ""%1""=="""" goto doneStartif ""%1""==""-noclasspath"" goto clearclasspathset ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1shiftgoto setupArgsrem here is there is a -noclasspath in the options:clearclasspathset _USE_CLASSPATH=noshiftgoto setupArgsrem This label provides a place for the argument list loop to break outrem and for NT handling to skip to.:doneStartif _USE_CLASSPATH==no goto findAntHome:stripClasspathif not _%CLASSPATH:~-1%==_\ goto findAntHomeset CLASSPATH=%CLASSPATH:~0,-1%goto stripClasspath:findAntHomerem find ANT_HOME if it does not exist due to either an invalid value passedrem by the user or the %0 problem on Windows 9xif exist "%ANT_HOME%\lib\ant.jar" goto checkJavarem check for ant in Program Filesif not exist "%ProgramFiles%\ant" goto checkSystemDriveset ANT_HOME=%ProgramFiles%\antgoto checkJava:checkSystemDriverem check for ant in root directory of system driveif not exist %SystemDrive%\ant\lib\ant.jar goto checkCDriveset ANT_HOME=%SystemDrive%\antgoto checkJava:checkCDriverem check for ant in C:\ant for Win9X usersif not exist C:\ant\lib\ant.jar goto noAntHomeset ANT_HOME=C:\antgoto checkJava:noAntHomeecho ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.goto end:checkJavaset _JAVACMD=%JAVACMD%if "%JAVA_HOME%" == "" goto noJavaHomeif not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHomeif "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exegoto checkJikes:noJavaHomeif "%_JAVACMD%" == "" set _JAVACMD=java.exe:checkJikesif not "%JIKESPATH%"=="" goto runAntWithJikes:runAntif "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath:runAntWithClasspath"%_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%rem Check the error code of the Ant buildif not "%OS%"=="Windows_NT" goto onErrorset ANT_ERROR=%ERRORLEVEL%goto end:runAntNoClasspath"%_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%rem Check the error code of the Ant buildif not "%OS%"=="Windows_NT" goto onErrorset ANT_ERROR=%ERRORLEVEL%goto end:runAntWithJikesif not _%JIKESPATH:~-1%==_\ goto checkJikesAndClasspathset JIKESPATH=%JIKESPATH:~0,-1%goto runAntWithJikes:checkJikesAndClasspathif "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath:runAntWithJikesAndClasspath"%_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%rem Check the error code of the Ant buildif not "%OS%"=="Windows_NT" goto onErrorset ANT_ERROR=%ERRORLEVEL%goto end:runAntWithJikesNoClasspath"%_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%rem Check the error code of the Ant buildif not "%OS%"=="Windows_NT" goto onErrorset ANT_ERROR=%ERRORLEVEL%goto end:onErrorrem Windows 9x way of checking the error code.  It matches via brute force.for %%i in (1 10 100) do set err%%i=for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%iif %err100%==2 goto onError200if %err100%==0 set err100=for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%iif "%err100%"=="" if %err10%==0 set err10=:onError1for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%igoto onErrorEnd:onError200for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%iif err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%iif not err10==5 goto onError1:onErrorEndset ANT_ERROR=%err100%%err10%%err1%for %%i in (1 10 100) do set err%%i=:endrem bug ID 32069: resetting an undefined env variable changes the errorlevel.if not "%_JAVACMD%"=="" set _JAVACMD=if not "%_ANT_CMD_LINE_ARGS%"=="" set ANT_CMD_LINE_ARGS=if "%ANT_ERROR%"=="0" goto mainEndrem Set the return code if we are not in NT.  We can only setrem a value of 1, but it's better than nothing.if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1rem Set the ERRORLEVEL if we are running NT.if "%OS%"=="Windows_NT" color 00goto omega:mainEndrem If there were no errors, we run the post script.if "%OS%"=="Windows_NT" @endlocalif "%OS%"=="WINNT" @endlocalif "%HOME%"=="" goto homeDrivePathPostif exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat":homeDrivePathPostif "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePostif "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePostif exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat":userProfilePostif "%USERPROFILE%"=="" goto omegaif "%USERPROFILE%"=="%HOME%" goto omegaif "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omegaif exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat":omega

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -