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.

fetch.xml 7.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <?xml version="1.0"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!--
  17. =======================================================================
  18. Build file to fetch optional libraries for Apache Ant
  19. =======================================================================
  20. -->
  21. <project name="fetch" default="all" basedir=".">
  22. <description>
  23. This build file downloads JAR files that optional Ant tasks use,
  24. and installs them in a location that is accessible the next time Ant runs.
  25. You can choose three locations, by going -Ddest=LOCATION on the command line
  26. -Ddest=user user lib dir ${user.home}/.ant/lib
  27. -Ddest=system ant lib dir ${ant.home}/lib
  28. -Ddest=optional optional dir $${basedir}/lib/optional (for Ant developers)
  29. You may also need to set proxy settings. On Java1.5, Ant tries to get
  30. this from the OS, unless you use the -noproxy option.
  31. Proxies can be configured manually setting the JVM proxy values in the
  32. ANT_OPTS environment variable.
  33. For example, to set the proxy up in the tcsh shell, the command would be
  34. something like:
  35. For csh/tcsh:
  36. setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
  37. For bash:
  38. export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
  39. For Windows, set the environment variable in the appropriate dialog box
  40. and open a new console. or, by hand
  41. set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080
  42. </description>
  43. <!-- Give user a chance to override without editing this file
  44. (and without typing -D each time it compiles it) -->
  45. <property file="${user.home}/.ant/ant.properties"/>
  46. <property name="lib.dir" location="lib" />
  47. <property name="optional.dir" location="${lib.dir}/optional" />
  48. <property name="userlib.dir" location="${user.home}/.ant/lib" />
  49. <!-- load in our properties table -->
  50. <property file="${lib.dir}/libraries.properties"/>
  51. <import file="get-m2.xml" />
  52. <target name="pick-dest">
  53. <fail>
  54. <condition>
  55. <not>
  56. <isset property="dest"/>
  57. </not>
  58. </condition>ERROR
  59. Set -Ddest=LOCATION on the command line
  60. -Ddest=user user lib dir ${user.home}/.ant/lib
  61. -Ddest=system ant lib dir ${ant.home}/lib
  62. -Ddest=optional optional dir $${basedir}/lib/optional (for Ant developers)
  63. </fail>
  64. <condition property="dest.dir"
  65. value="${lib.dir}">
  66. <equals arg1="${dest}" arg2="system" />
  67. </condition>
  68. <condition property="dest.dir"
  69. value="${optional.dir}">
  70. <equals arg1="${dest}" arg2="optional" />
  71. </condition>
  72. <condition property="dest.dir"
  73. value="${userlib.dir}">
  74. <equals arg1="${dest}" arg2="user" />
  75. </condition>
  76. <fail unless="dest.dir">Unknown destination : ${dest}</fail>
  77. <echo>Downloading to ${dest.dir}</echo>
  78. <property name="m2.dest.dir" value="${dest.dir}" />
  79. </target>
  80. <target name="macros" depends="pick-dest,get-m2"
  81. xmlns:artifact="antlib:org.apache.maven.artifact.ant">
  82. <macrodef name="f2">
  83. <attribute name="project" />
  84. <attribute name="archive" default="@{project}"/>
  85. <sequential>
  86. <fail>
  87. Unknown archive @{archive} -no property @{archive}.version defined.
  88. <condition>
  89. <not>
  90. <isset property="@{archive}.version"/>
  91. </not>
  92. </condition>
  93. </fail>
  94. <artifact:dependencies pathID="@{archive}.path">
  95. <dependency groupID="@{project}"
  96. artifactID="@{archive}"
  97. version="${@{archive}.version}"/>
  98. </artifact:dependencies>
  99. <!-- now we are left with the problem of getting the files
  100. into our directory -->
  101. <copypath destdir="${dest.dir}" pathref="@{archive}.path">
  102. <flattenmapper/>
  103. </copypath>
  104. </sequential>
  105. </macrodef>
  106. </target>
  107. <!-- any init stuff -->
  108. <target name="init" depends="macros" />
  109. <target name="diag" depends="init">
  110. <echoproperties />
  111. </target>
  112. <target name="logging"
  113. description="load logging libraries"
  114. depends="init">
  115. <f2 project="log4j" />
  116. <f2 project="commons-logging" archive="commons-logging-api" />
  117. </target>
  118. <target name="junit"
  119. description="load junit libraries"
  120. depends="init">
  121. <f2 project="junit" />
  122. </target>
  123. <target name="xml"
  124. description="load full XML libraries (xalan, resolver)"
  125. depends="init">
  126. <f2 project="xalan" />
  127. <f2 project="xml-resolver" />
  128. </target>
  129. <!--
  130. This is not used as
  131. we like to get the more recent artifacts than are in the repo at the time of writing (2006-12-21)
  132. -->
  133. <target name="xerces"
  134. description="load an updated version of Xerces"
  135. depends="init">
  136. <f2 project="xerces" archive="xercesImpl"/>
  137. <f2 project="xerces" archive="xml-apis" />
  138. </target>
  139. <target name="networking"
  140. description="load networking libraries (commons-net; jsch)"
  141. depends="init">
  142. <f2 project="commons-net" />
  143. <f2 project="com.jcraft" archive="jsch"/>
  144. </target>
  145. <target name="regexp"
  146. description="load regexp libraries"
  147. depends="init">
  148. <f2 project="regexp" />
  149. <f2 project="oro" />
  150. </target>
  151. <target name="antlr"
  152. description="load antlr libraries"
  153. depends="init">
  154. <f2 project="antlr" />
  155. </target>
  156. <target name="bcel"
  157. description="load bcel libraries"
  158. depends="init">
  159. <f2 project="bcel" />
  160. </target>
  161. <target name="jdepend"
  162. description="load jdepend libraries"
  163. depends="init">
  164. <f2 project="jdepend" />
  165. </target>
  166. <target name="bsf"
  167. description="load bsf libraries"
  168. depends="init">
  169. <f2 project="bsf" />
  170. </target>
  171. <target name="jruby"
  172. description="load jruby"
  173. depends="bsf">
  174. <f2 project="org.jruby" archive="jruby"/>
  175. </target>
  176. <target name="beanshell"
  177. description="load beanshell support"
  178. depends="bsf">
  179. <f2 project="org.beanshell" archive="bsh"/>
  180. <f2 project="org.beanshell" archive="bsh-core"/>
  181. </target>
  182. <target name="jython"
  183. description="load jython"
  184. depends="bsf">
  185. <f2 project="jython" archive="jython"/>
  186. </target>
  187. <target name="rhino"
  188. description="load rhino"
  189. depends="bsf">
  190. <f2 project="rhino" archive="js"/>
  191. </target>
  192. <target name="script"
  193. description="load script languages (except jython)"
  194. depends="bsf,jruby,beanshell,rhino"/>
  195. <target name="debugging"
  196. description="internal ant debugging"
  197. depends="init">
  198. <f2 project="which" />
  199. </target>
  200. <target name="javamail" depends="init"
  201. description="load javamail">
  202. <f2 project="javax.mail" archive="mail"/>
  203. </target>
  204. <target name="jspc" depends="init" description="loads Jasper">
  205. <f2 project="tomcat" archive="jasper-compiler"/>
  206. <f2 project="tomcat" archive="jasper-runtime"/>
  207. <f2 project="javax.servlet" archive="servlet-api"/>
  208. </target>
  209. <target name="all"
  210. description="load all the libraries (except jython)"
  211. depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc" />
  212. </project>