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.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. @echo off
  2. REM Copyright (c) 2001 The Apache Software Foundation. All rights
  3. REM reserved.
  4. if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
  5. if not "%OS%"=="Windows_NT" goto win9xStart
  6. :winNTStart
  7. @setlocal
  8. rem %~dp0 is name of current script under NT
  9. set DEFAULT_ANT_HOME=%~dp0
  10. rem : operator works similar to make : operator
  11. set DEFAULT_ANT_HOME=%DEFAULT_ANT_HOME%\..
  12. if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%
  13. set DEFAULT_ANT_HOME=
  14. rem Need to check if we are using the 4NT shell...
  15. if "%@eval[2+2]" == "4" goto setup4NT
  16. rem On NT/2K grab all arguments at once
  17. set ANT_CMD_LINE_ARGS=%*
  18. goto doneStart
  19. :setup4NT
  20. set ANT_CMD_LINE_ARGS=%$
  21. goto doneStart
  22. :win9xStart
  23. rem Slurp the command line arguments. This loop allows for an unlimited number of
  24. rem agruments (up to the command line limit, anyway).
  25. set ANT_CMD_LINE_ARGS=
  26. :setupArgs
  27. if %1a==a goto doneStart
  28. set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
  29. shift
  30. goto setupArgs
  31. :doneStart
  32. rem This label provides a place for the argument list loop to break out
  33. rem and for NT handling to skip to.
  34. rem find ANT_HOME
  35. if not "%ANT_HOME%"=="" goto checkJava
  36. rem check for ant in Program Files on system drive
  37. if not exist "%SystemDrive%\Program Files\ant" goto checkSystemDrive
  38. set ANT_HOME=%SystemDrive%\Program Files\ant
  39. goto checkJava
  40. :checkSystemDrive
  41. rem check for ant in root directory of system drive
  42. if not exist %SystemDrive%\ant\nul goto checkCDrive
  43. set ANT_HOME=%SystemDrive%\ant
  44. goto checkJava
  45. :checkCDrive
  46. rem check for ant in C:\ant for Win9X users
  47. if not exist C:\ant\nul goto noAntHome
  48. set ANT_HOME=C:\ant
  49. goto checkJava
  50. :noAntHome
  51. echo ANT_HOME is not set and ant could not be located. Please set ANT_HOME.
  52. goto end
  53. :checkJava
  54. set _JAVACMD=%JAVACMD%
  55. set LOCALCLASSPATH=%CLASSPATH%
  56. for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" %%i
  57. if "%JAVA_HOME%" == "" goto noJavaHome
  58. if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java
  59. if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat" %JAVA_HOME%\lib\tools.jar
  60. if exist "%JAVA_HOME%\lib\classes.zip" call "%ANT_HOME%\bin\lcp.bat" %JAVA_HOME%\lib\classes.zip
  61. goto checkJikes
  62. :noJavaHome
  63. if "%_JAVACMD%" == "" set _JAVACMD=java
  64. echo.
  65. echo Warning: JAVA_HOME environment variable is not set.
  66. echo If build fails because sun.* classes could not be found
  67. echo you will need to set the JAVA_HOME environment variable
  68. echo to the installation directory of java.
  69. echo.
  70. :checkJikes
  71. if not "%JIKESPATH%" == "" goto runAntWithJikes
  72. :runAnt
  73. "%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS%
  74. goto end
  75. :runAntWithJikes
  76. "%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" -Djikes.class.path="%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS%
  77. :end
  78. set LOCALCLASSPATH=
  79. set _JAVACMD=
  80. set ANT_CMD_LINE_ARGS=
  81. if not "%OS%"=="Windows_NT" goto mainEnd
  82. :winNTend
  83. @endlocal
  84. :mainEnd
  85. if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"