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.

bootstrap.bat 4.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. @echo off
  2. REM You will need to specify JAVA_HOME if compiling with 1.2 or later.
  3. REM Copyright 2000-2005 The Apache Software Foundation
  4. REM
  5. REM Licensed under the Apache License, Version 2.0 (the "License");
  6. REM you may not use this file except in compliance with the License.
  7. REM You may obtain a copy of the License at
  8. REM
  9. REM http://www.apache.org/licenses/LICENSE-2.0
  10. REM
  11. REM Unless required by applicable law or agreed to in writing, software
  12. REM distributed under the License is distributed on an "AS IS" BASIS,
  13. REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. REM See the License for the specific language governing permissions and
  15. REM limitations under the License.
  16. set OLDJAVA=%JAVA%
  17. set OLDJAVAC=%JAVAC%
  18. set BOOTOLDCLASSPATH=%CLASSPATH%
  19. set OLDANTHOME=%ANT_HOME%
  20. set ANT_HOME=.
  21. if "" == "%JAVA%" if "" == "%JAVA_HOME%" set JAVA=java
  22. if "" == "%JAVA%" set JAVA=%JAVA_HOME%\bin\java
  23. if "" == "%JAVAC%" if "" == "%JAVA_HOME%" set JAVAC=javac
  24. if "" == "%JAVAC%" set JAVAC=%JAVA_HOME%\bin\javac
  25. echo.
  26. echo ... Bootstrapping Ant Distribution
  27. if "%OS%" == "Windows_NT" if exist bootstrap\nul rmdir/s/q bootstrap
  28. if not "%OS%" == "Windows_NT" if exist bootstrap\nul deltree/y bootstrap
  29. if "%OS%" == "Windows_NT" if exist build\nul rmdir/s/q build
  30. if not "%OS%" == "Windows_NT" if exist build\nul deltree/y build
  31. SET LOCALCLASSPATH=lib\xercesImpl.jar;lib\xml-apis.jar
  32. for %%i in (lib\optional\*.jar) do call src\script\lcp.bat %%i
  33. if exist "%JAVA_HOME%\lib\tools.jar" call src\script\lcp.bat %JAVA_HOME%\lib\tools.jar
  34. if exist "%JAVA_HOME%\lib\classes.zip" call src\script\lcp.bat %JAVA_HOME%\lib\classes.zip
  35. set TOOLS=src\main\org\apache\tools
  36. set CLASSDIR=build\classes
  37. SET CLASSPATH=%LOCALCLASSPATH%;%CLASSDIR%;src\main;%CLASSPATH%
  38. echo JAVA_HOME=%JAVA_HOME%
  39. echo JAVA=%JAVA%
  40. echo JAVAC=%JAVAC%
  41. echo CLASSPATH=%CLASSPATH%
  42. if "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul rmdir/s/q %CLASSDIR%
  43. if not "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul deltree/y %CLASSDIR%
  44. if not exist build\nul mkdir build
  45. if not exist build\classes\nul mkdir build\classes
  46. echo.
  47. echo ... Compiling Ant Classes
  48. "%JAVAC%" %BOOTJAVAC_OPTS% -d %CLASSDIR% %TOOLS%\bzip2\*.java %TOOLS%\tar\*.java %TOOLS%\zip\*.java %TOOLS%\ant\*.java %TOOLS%\ant\types\*.java %TOOLS%\ant\taskdefs\*.java %TOOLS%\ant\util\regexp\RegexpMatcher.java %TOOLS%\ant\util\regexp\RegexpMatcherFactory.java %TOOLS%\ant\taskdefs\condition\*.java %TOOLS%\ant\taskdefs\compilers\*.java
  49. if ERRORLEVEL 1 goto mainend
  50. echo.
  51. echo ... Copying Required Files
  52. copy %TOOLS%\ant\taskdefs\*.properties %CLASSDIR%\org\apache\tools\ant\taskdefs
  53. copy %TOOLS%\ant\types\*.properties %CLASSDIR%\org\apache\tools\ant\types
  54. echo.
  55. echo ... Building Ant Distribution
  56. if not "%OS%"=="Windows_NT" goto win9xStart
  57. :winNTStart
  58. @setlocal
  59. REM parse command line arguments
  60. rem Need to check if we are using the 4NT shell...
  61. if "%eval[2+2]" == "4" goto setup4NT
  62. rem On NT/2K grab all arguments at once
  63. set ANT_CMD_LINE_ARGS=%*
  64. goto doneStart
  65. :setup4NT
  66. set ANT_CMD_LINE_ARGS=%$
  67. goto doneStart
  68. :win9xStart
  69. rem Slurp the command line arguments. This loop allows for an unlimited number of
  70. rem agruments (up to the command line limit, anyway).
  71. set ANT_CMD_LINE_ARGS=
  72. :setupArgs
  73. if %1a==a goto doneStart
  74. set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
  75. shift
  76. goto setupArgs
  77. :doneStart
  78. rem This label provides a place for the argument list loop to break out
  79. rem and for NT handling to skip to.
  80. "%JAVA%" %ANT_OPTS% org.apache.tools.ant.Main -emacs %ANT_CMD_LINE_ARGS% bootstrap
  81. set ANT_CMD_LINE_ARGS=
  82. if not "%OS%"=="Windows_NT" goto mainEnd
  83. :winNTend
  84. @endlocal
  85. :mainEnd
  86. echo.
  87. echo ... Cleaning Up Build Directories
  88. if "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul rmdir/s/q %CLASSDIR%
  89. if not "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul deltree/y %CLASSDIR%
  90. echo.
  91. echo ... Done Bootstrapping Ant Distribution
  92. set JAVA=%OLDJAVA%
  93. set JAVAC=%OLDJAVAC%
  94. set CLASSPATH=%BOOTOLDCLASSPATH%
  95. set ANT_HOME=%OLDANTHOME%
  96. set OLDJAVA=
  97. set OLDJAVAC=
  98. set BOOTOLDCLASSPATH=
  99. set LOCALCLASSPATH=
  100. set OLDANTHOME=
  101. set TOOLS=