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

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