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 2.8 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. @echo off
  2. REM Copyright (c) 2001-2002 The Apache Software Foundation. All rights
  3. REM reserved.
  4. if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
  5. if "%OS%"=="Windows_NT" @setlocal
  6. rem %~dp0 is expanded pathname of the current script under NT
  7. set DEFAULT_ANT_HOME=%~dp0..
  8. if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%
  9. set DEFAULT_ANT_HOME=
  10. rem Slurp the command line arguments. This loop allows for an unlimited number
  11. rem of arguments (up to the command line limit, anyway).
  12. set ANT_CMD_LINE_ARGS=%1
  13. if ""%1""=="""" goto doneStart
  14. shift
  15. :setupArgs
  16. if ""%1""=="""" goto doneStart
  17. set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
  18. shift
  19. goto setupArgs
  20. rem This label provides a place for the argument list loop to break out
  21. rem and for NT handling to skip to.
  22. :doneStart
  23. rem find ANT_HOME if it does not exist due to either an invalid value passed
  24. rem by the user or the %0 problem on Windows 9x
  25. if exist "%ANT_HOME%" goto checkJava
  26. rem check for ant in Program Files on system drive
  27. if not exist "%SystemDrive%\Program Files\ant" goto checkSystemDrive
  28. set ANT_HOME=%SystemDrive%\Program Files\ant
  29. goto checkJava
  30. :checkSystemDrive
  31. rem check for ant in root directory of system drive
  32. if not exist %SystemDrive%\ant\nul goto checkCDrive
  33. set ANT_HOME=%SystemDrive%\ant
  34. goto checkJava
  35. :checkCDrive
  36. rem check for ant in C:\ant for Win9X users
  37. if not exist C:\ant\nul goto noAntHome
  38. set ANT_HOME=C:\ant
  39. goto checkJava
  40. :noAntHome
  41. echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
  42. goto end
  43. :checkJava
  44. set LOCALCLASSPATH=%CLASSPATH%
  45. for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" %%i
  46. if "%JAVA_HOME%" == "" goto noJavaHome
  47. if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
  48. set _JAVACMD=%JAVA_HOME%\bin\java.exe
  49. if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat" "%JAVA_HOME%\lib\tools.jar"
  50. if exist "%JAVA_HOME%\lib\classes.zip" call "%ANT_HOME%\bin\lcp.bat" "%JAVA_HOME%\lib\classes.zip"
  51. goto checkJikes
  52. :noJavaHome
  53. set _JAVACMD=java.exe
  54. echo.
  55. echo Warning: JAVA_HOME environment variable is not set.
  56. echo If build fails because sun.* classes could not be found
  57. echo you will need to set the JAVA_HOME environment variable
  58. echo to the installation directory of java.
  59. echo.
  60. :checkJikes
  61. if not "%JIKESPATH%"=="" goto runAntWithJikes
  62. :runAnt
  63. "%_JAVACMD%" -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
  64. goto end
  65. :runAntWithJikes
  66. "%_JAVACMD%" -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
  67. goto end
  68. :end
  69. set LOCALCLASSPATH=
  70. set _JAVACMD=
  71. set ANT_CMD_LINE_ARGS=
  72. if "%OS%"=="Windows_NT" @endlocal
  73. :mainEnd
  74. if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"