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 6.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?xml version="1.0"?>
  2. <!--
  3. =======================================================================
  4. Build file to fetch optional libraries for Apache Ant
  5. Copyright (c) 2005 The Apache Software Foundation. All rights
  6. reserved.
  7. =======================================================================
  8. -->
  9. <project name="fetch" default="all" basedir=".">
  10. <description>
  11. This build file downloads JAR files that optional Ant tasks use,
  12. and installs them in a location that is accessible the next time Ant runs.
  13. You can choose three locations, by going -Ddest=LOCATION on the command line
  14. -Ddest=user user lib dir ${user.home}/.ant/lib
  15. -Ddest=system ant lib dir ${ant.home}/lib --Default--
  16. -Ddest=optional optional dir ${ant.home}/lib/optional (for Ant developers)
  17. You may also need to set proxy settings. On Java1.5, Ant tries to get
  18. this from the OS, unless you use the -noproxy option.
  19. Proxies can be configured manually setting the JVM proxy values in the
  20. ANT_OPTS environment variable.
  21. For example, to set the proxy up in the tcsh shell, the command would be
  22. something like:
  23. For csh/tcsh:
  24. setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
  25. For bash:
  26. export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
  27. For Windows, set the environment variable in the appropriate dialog box
  28. and open a new console. or, by hand
  29. set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080
  30. </description>
  31. <!-- Give user a chance to override without editing this file
  32. (and without typing -D each time it compiles it) -->
  33. <property file="${user.home}/.ant/ant.properties"/>
  34. <property name="lib.dir" location="lib" />
  35. <property name="optional.dir" location="${lib.dir}/optional" />
  36. <property name="userlib.dir" location="${user.home}/.ant/lib" />
  37. <!-- load in our properties table -->
  38. <property file="${lib.dir}/libraries.properties"/>
  39. <target name="pick-dest">
  40. <condition property="dest.dir"
  41. value="${lib.dir}">
  42. <or>
  43. <equals arg1="${dest}" arg2="system" />
  44. <not><isset property="dest"/></not>
  45. </or>
  46. </condition>
  47. <condition property="dest.dir"
  48. value="${optional.dir}">
  49. <equals arg1="${dest}" arg2="optional" />
  50. </condition>
  51. <condition property="dest.dir"
  52. value="${userlib.dir}">
  53. <equals arg1="${dest}" arg2="user" />
  54. </condition>
  55. <fail>
  56. Unknown destination : ${dest}
  57. <condition>
  58. <not><isset property="dest.dir" /></not>
  59. </condition>
  60. </fail>
  61. <echo>Downloading to ${dest.dir}</echo>
  62. </target>
  63. <target name="probe-m2" depends="pick-dest">
  64. <!-- Look for M2 ant tasks in our classpath-->
  65. <available property="m2.antlib.found"
  66. resource="org/apache/maven/artifact/ant/antlib.xml" />
  67. <condition property="m2.antlib.typefound">
  68. <typefound name="antlib:org.apache.maven.artifact.ant:artifact" />
  69. </condition>
  70. </target>
  71. <target name="get-m2" depends="probe-m2,pick-dest" unless="m2.antlib.found">
  72. <!-- fetch M2 ant tasks into our repository, if it is not there-->
  73. <get src="${m2.antlib.url}"
  74. dest="${dest.dir}/${m2.jar.name}"
  75. verbose="true"
  76. usetimestamp="false"/>
  77. <fail status="0">
  78. The Maven2 JAR has been installed; rerun ant to load it.
  79. </fail>
  80. </target>
  81. <target name="macros" depends="get-m2"
  82. xmlns:artifact="antlib:org.apache.maven.artifact.ant">
  83. <macrodef name="f2">
  84. <attribute name="project" />
  85. <attribute name="archive" default="@{project}"/>
  86. <sequential>
  87. <fail>
  88. Unknown archive @{archive}
  89. <condition>
  90. <not>
  91. <isset property="@{archive}.version"/>
  92. </not>
  93. </condition>
  94. </fail>
  95. <artifact:dependencies pathID="@{archive}.path">
  96. <dependency groupID="@{project}"
  97. artifactID="@{archive}"
  98. version="${@{archive}.version}"/>
  99. </artifact:dependencies>
  100. <!-- now we are left with the problem of getting the files
  101. into our directory -->
  102. <copypath destdir="${dest.dir}" pathref="@{archive}.path">
  103. <flattenmapper/>
  104. </copypath>
  105. </sequential>
  106. </macrodef>
  107. </target>
  108. <!-- any init stuff -->
  109. <target name="init" depends="pick-dest,macros" >
  110. </target>
  111. <target name="diag" depends="init">
  112. <echoproperties />
  113. </target>
  114. <target name="logging"
  115. description="load logging libraries"
  116. depends="init">
  117. <f2 project="log4j" />
  118. <f2 project="commons-logging" archive="commons-logging-api" />
  119. </target>
  120. <target name="junit"
  121. description="load junit libraries"
  122. depends="init">
  123. <f2 project="junit" />
  124. </target>
  125. <target name="xml"
  126. description="load full XML libraries (xalan, resolver)"
  127. depends="init">
  128. <f2 project="xalan" />
  129. <f2 project="xml-resolver" />
  130. </target>
  131. <target name="networking"
  132. description="load networking libraries (commons-net; jsch)"
  133. depends="init">
  134. <f2 project="commons-net" />
  135. <f2 project="jsch" />
  136. </target>
  137. <target name="regexp"
  138. description="load regexp libraries"
  139. depends="init">
  140. <f2 project="regexp" />
  141. <f2 project="oro" />
  142. </target>
  143. <target name="antlr"
  144. description="load antlr libraries"
  145. depends="init">
  146. <f2 project="antlr" />
  147. </target>
  148. <target name="bcel"
  149. description="load bcel libraries"
  150. depends="init">
  151. <f2 project="bcel" />
  152. </target>
  153. <target name="jdepend"
  154. description="load jdepend libraries"
  155. depends="init">
  156. <f2 project="jdepend" />
  157. </target>
  158. <target name="bsf"
  159. description="load bsf libraries"
  160. depends="init">
  161. <f2 project="bsf" />
  162. </target>
  163. <target name="debugging"
  164. description="internal ant debugging"
  165. depends="init">
  166. <f2 project="which" />
  167. </target>
  168. <target name="all"
  169. description="load all the libraries"
  170. depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging" />
  171. </project>