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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <?xml version="1.0"?>
  2. <!--
  3. =======================================================================
  4. Build file to fetch optional libraries for Apache Ant
  5. Copyright (c) 2005-2006 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. <import file="get-m2.xml" />
  40. <target name="pick-dest">
  41. <condition property="dest.dir"
  42. value="${lib.dir}">
  43. <or>
  44. <equals arg1="${dest}" arg2="system" />
  45. <not><isset property="dest"/></not>
  46. </or>
  47. </condition>
  48. <condition property="dest.dir"
  49. value="${optional.dir}">
  50. <equals arg1="${dest}" arg2="optional" />
  51. </condition>
  52. <condition property="dest.dir"
  53. value="${userlib.dir}">
  54. <equals arg1="${dest}" arg2="user" />
  55. </condition>
  56. <fail unless="dest.dir">Unknown destination : ${dest}</fail>
  57. <echo>Downloading to ${dest.dir}</echo>
  58. <property name="m2.dest.dir" value="${dest.dir}" />
  59. </target>
  60. <target name="macros" depends="pick-dest,get-m2"
  61. xmlns:artifact="antlib:org.apache.maven.artifact.ant">
  62. <macrodef name="f2">
  63. <attribute name="project" />
  64. <attribute name="archive" default="@{project}"/>
  65. <sequential>
  66. <fail>
  67. Unknown archive @{archive}
  68. <condition>
  69. <not>
  70. <isset property="@{archive}.version"/>
  71. </not>
  72. </condition>
  73. </fail>
  74. <artifact:dependencies pathID="@{archive}.path">
  75. <dependency groupID="@{project}"
  76. artifactID="@{archive}"
  77. version="${@{archive}.version}"/>
  78. </artifact:dependencies>
  79. <!-- now we are left with the problem of getting the files
  80. into our directory -->
  81. <copypath destdir="${dest.dir}" pathref="@{archive}.path">
  82. <flattenmapper/>
  83. </copypath>
  84. </sequential>
  85. </macrodef>
  86. </target>
  87. <!-- any init stuff -->
  88. <target name="init" depends="macros" />
  89. <target name="diag" depends="init">
  90. <echoproperties />
  91. </target>
  92. <target name="logging"
  93. description="load logging libraries"
  94. depends="init">
  95. <f2 project="log4j" />
  96. <f2 project="commons-logging" archive="commons-logging-api" />
  97. </target>
  98. <target name="junit"
  99. description="load junit libraries"
  100. depends="init">
  101. <f2 project="junit" />
  102. </target>
  103. <target name="xml"
  104. description="load full XML libraries (xalan, resolver)"
  105. depends="init">
  106. <f2 project="xalan" />
  107. <f2 project="xml-resolver" />
  108. </target>
  109. <target name="networking"
  110. description="load networking libraries (commons-net; jsch)"
  111. depends="init">
  112. <f2 project="commons-net" />
  113. <f2 project="jsch" />
  114. </target>
  115. <target name="regexp"
  116. description="load regexp libraries"
  117. depends="init">
  118. <f2 project="regexp" />
  119. <f2 project="oro" />
  120. </target>
  121. <target name="antlr"
  122. description="load antlr libraries"
  123. depends="init">
  124. <f2 project="antlr" />
  125. </target>
  126. <target name="bcel"
  127. description="load bcel libraries"
  128. depends="init">
  129. <f2 project="bcel" />
  130. </target>
  131. <target name="jdepend"
  132. description="load jdepend libraries"
  133. depends="init">
  134. <f2 project="jdepend" />
  135. </target>
  136. <target name="bsf"
  137. description="load bsf libraries"
  138. depends="init">
  139. <f2 project="bsf" />
  140. </target>
  141. <target name="jruby"
  142. description="load jruby"
  143. depends="bsf">
  144. <f2 project="org.jruby" archive="jruby"/>
  145. </target>
  146. <target name="beanshell"
  147. description="load beanshell support"
  148. depends="bsf">
  149. <f2 project="org.beanshell" archive="bsh"/>
  150. <f2 project="org.beanshell" archive="bsh-core"/>
  151. </target>
  152. <target name="jython"
  153. description="load jython"
  154. depends="bsf">
  155. <f2 project="jython" archive="jython"/>
  156. </target>
  157. <target name="script"
  158. description="load script languages"
  159. depends="bsf,jruby,jython,beanshell"/>
  160. <target name="debugging"
  161. description="internal ant debugging"
  162. depends="init">
  163. <f2 project="which" />
  164. </target>
  165. <target name="all"
  166. description="load all the libraries"
  167. depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging" />
  168. </project>