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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. @echo off
  2. REM Copyright (c) 2001-2003 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%\lib\ant.jar" goto checkJava
  26. rem check for ant in Program Files
  27. if not exist "%ProgramFiles%\ant" goto checkSystemDrive
  28. set ANT_HOME=%ProgramFiles%\ant
  29. goto checkJava
  30. :checkSystemDrive
  31. rem check for ant in root directory of system drive
  32. if not exist %SystemDrive%\ant\lib\ant.jar 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\lib\ant.jar 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 _JAVACMD=%JAVACMD%
  45. if "%JAVA_HOME%" == "" goto noJavaHome
  46. if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
  47. if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
  48. goto checkJikes
  49. :noJavaHome
  50. if "%_JAVACMD%" == "" set _JAVACMD=java.exe
  51. :checkJikes
  52. if not "%JIKESPATH%"=="" goto runAntWithJikes
  53. :runAnt
  54. if not "%CLASSPATH%"=="" goto runAntWithClasspath
  55. "%_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%
  56. goto end
  57. :runAntWithClasspath
  58. "%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -lib "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
  59. goto end
  60. :runAntWithJikes
  61. if not "%CLASSPATH%"=="" goto runAntWithJikesAndClasspath
  62. "%_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%
  63. goto end
  64. :runAntWithJikesAndClasspath
  65. "%_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% -lib "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
  66. goto end
  67. :end
  68. set _JAVACMD=
  69. set ANT_CMD_LINE_ARGS=
  70. if "%OS%"=="Windows_NT" @endlocal
  71. :mainEnd
  72. if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"