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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <?xml version="1.0"?>
  2. <!--
  3. =======================================================================
  4. Build file to fetch optiona 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. This can be done by
  18. setting the JVM proxy values in the ANT_OPTS environment
  19. variables.
  20. For example, to set the proxy up in the tcsh shell, the command would be
  21. something like:
  22. For csh/tcsh:
  23. setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
  24. For bash:
  25. export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
  26. For Windows, set the environment variable in the appropriate dialog box
  27. and open a new console.
  28. </description>
  29. <!-- Give user a chance to override without editing this file
  30. (and without typing -D each time it compiles it) -->
  31. <property file="${user.home}/.ant/ant.properties"/>
  32. <property name="lib.dir" location="lib" />
  33. <property name="optional.dir" location="${lib.dir}/optional" />
  34. <property name="userlib.dir" location="${user.home}/.ant/lib" />
  35. <!-- load in our properties table -->
  36. <property file="${lib.dir}/libraries.properties"/>
  37. <target name="pick-dest">
  38. <condition property="dest.dir"
  39. value="${lib.dir}">
  40. <or>
  41. <equals arg1="${dest}" arg2="system" />
  42. <not><isset property="dest"/></not>
  43. </or>
  44. </condition>
  45. <condition property="dest.dir"
  46. value="${optional.dir}">
  47. <equals arg1="${dest}" arg2="optional" />
  48. </condition>
  49. <condition property="dest.dir"
  50. value="${userlib.dir}">
  51. <equals arg1="${dest}" arg2="user" />
  52. </condition>
  53. <fail>
  54. Unknown destination : ${dest}
  55. <condition>
  56. <not><isset property="dest.dir" /></not>
  57. </condition>
  58. </fail>
  59. <echo>Downloading to ${dest.dir}</echo>
  60. </target>
  61. <target name="probe-m2" depends="pick-dest">
  62. <!-- Look for M2 ant tasks in our classpath-->
  63. <available property="m2.antlib.found"
  64. resource="org/apache/maven/artifact/ant/antlib.xml" />
  65. <condition property="m2.antlib.typefound">
  66. <typefound name="antlib:org.apache.maven.artifact.ant:artifact" />
  67. </condition>
  68. </target>
  69. <target name="get-m2" depends="probe-m2,pick-dest" unless="m2.antlib.found">
  70. <!-- fetch M2 ant tasks into our repository, if it is not there-->
  71. <get src="${m2.antlib.url}"
  72. dest="${dest.dir}/${m2.jar.name}"
  73. verbose="true"
  74. usetimestamp="false"/>
  75. <fail status="0">
  76. The Maven2 JAR has been installed; rerun ant to load it.
  77. </fail>
  78. </target>
  79. <target name="macros" depends="get-m2"
  80. xmlns:artifact="antlib:org.apache.maven.artifact.ant">
  81. <macrodef name="f2">
  82. <attribute name="project" />
  83. <attribute name="archive" default="@{project}"/>
  84. <sequential>
  85. <fail>
  86. Unknown archive @{archive}
  87. <condition>
  88. <not>
  89. <isset property="@{archive}.version"/>
  90. </not>
  91. </condition>
  92. </fail>
  93. <artifact:dependencies pathID="@{archive}.path">
  94. <dependency groupID="@{project}"
  95. artifactID="@{archive}"
  96. version="${@{archive}.version}"/>
  97. </artifact:dependencies>
  98. <!-- now we are left with the problem of getting the files
  99. into our directory -->
  100. <copypath destdir="${dest.dir}" pathref="@{archive}.path">
  101. <flattenmapper/>
  102. </copypath>
  103. </sequential>
  104. </macrodef>
  105. </target>
  106. <!-- any init stuff -->
  107. <target name="init" depends="pick-dest,macros" >
  108. </target>
  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. <target name="networking"
  130. description="load networking libraries (commons-net; jsch)"
  131. depends="init">
  132. <f2 project="commons-net" />
  133. <f2 project="jsch" />
  134. </target>
  135. <target name="regexp"
  136. description="load regexp libraries"
  137. depends="init">
  138. <f2 project="regexp" />
  139. <f2 project="oro" />
  140. </target>
  141. <target name="antlr"
  142. description="load antlr libraries"
  143. depends="init">
  144. <f2 project="antlr" />
  145. </target>
  146. <target name="bcel"
  147. description="load bcel libraries"
  148. depends="init">
  149. <f2 project="bcel" />
  150. </target>
  151. <target name="jdepend"
  152. description="load jdepend libraries"
  153. depends="init">
  154. <f2 project="jdepend" />
  155. </target>
  156. <target name="bsf"
  157. description="load bsf libraries"
  158. depends="init">
  159. <f2 project="bsf" />
  160. </target>
  161. <target name="debugging"
  162. description="internal ant debugging"
  163. depends="init">
  164. <f2 project="which" />
  165. </target>
  166. <target name="all"
  167. description="load all the libraries"
  168. depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging" />
  169. </project>