You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ant.bat 3.9 kB

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