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

ant.bat 3.0KB

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