4 Licensed to the Apache Software Foundation (ASF) under one or more
5 contributor license agreements. See the NOTICE file distributed with
6 this work for additional information regarding copyright ownership.
7 The ASF licenses this file to You under the Apache License, Version 2.0
8 (the "License"); you may not use this file except in compliance with
9 the License. You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
20 =======================================================================
21 Build file to fetch optional libraries for Apache Ant
22 =======================================================================
24 <project name="fetch" default="all" basedir=".">
27 This build file downloads JAR files that optional Ant tasks use,
28 and installs them in a location that is accessible the next time Ant runs.
30 You can choose three locations, by going -Ddest=LOCATION on the command line
31 -Ddest=user user lib dir ${user.home}/.ant/lib
32 -Ddest=system ant lib dir ${ant.home}/lib --Default--
33 -Ddest=optional optional dir ${ant.home}/lib/optional (for Ant developers)
35 You may also need to set proxy settings. On Java1.5, Ant tries to get
36 this from the OS, unless you use the -noproxy option.
38 Proxies can be configured manually setting the JVM proxy values in the
39 ANT_OPTS environment variable.
41 For example, to set the proxy up in the tcsh shell, the command would be
45 setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
47 export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
48 For Windows, set the environment variable in the appropriate dialog box
49 and open a new console. or, by hand
50 set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080
53 <!-- Give user a chance to override without editing this file
54 (and without typing -D each time it compiles it) -->
55 <property file="${user.home}/.ant/ant.properties"/>
56 <property name="lib.dir" location="lib" />
57 <property name="optional.dir" location="${lib.dir}/optional" />
58 <property name="userlib.dir" location="${user.home}/.ant/lib" />
60 <!-- load in our properties table -->
61 <property file="${lib.dir}/libraries.properties"/>
63 <import file="get-m2.xml" />
65 <target name="pick-dest">
66 <property name="dest" value="system" />
67 <condition property="dest.dir"
69 <equals arg1="${dest}" arg2="system" />
71 <condition property="dest.dir"
72 value="${optional.dir}">
73 <equals arg1="${dest}" arg2="optional" />
75 <condition property="dest.dir"
76 value="${userlib.dir}">
77 <equals arg1="${dest}" arg2="user" />
79 <fail unless="dest.dir">Unknown destination : ${dest}</fail>
80 <echo>Downloading to ${dest.dir}</echo>
81 <property name="m2.dest.dir" value="${dest.dir}" />
85 <target name="macros" depends="pick-dest,get-m2"
86 xmlns:artifact="antlib:org.apache.maven.artifact.ant">
89 <attribute name="project" />
90 <attribute name="archive" default="@{project}"/>
93 Unknown archive @{archive} -no property @{archive}.version defined.
96 <isset property="@{archive}.version"/>
100 <artifact:dependencies pathID="@{archive}.path">
101 <dependency groupID="@{project}"
102 artifactID="@{archive}"
103 version="${@{archive}.version}"/>
104 </artifact:dependencies>
105 <!-- now we are left with the problem of getting the files
106 into our directory -->
107 <copypath destdir="${dest.dir}" pathref="@{archive}.path">
116 <!-- any init stuff -->
117 <target name="init" depends="macros" />
120 <target name="diag" depends="init">
124 <target name="logging"
125 description="load logging libraries"
127 <f2 project="log4j" />
128 <f2 project="commons-logging" archive="commons-logging-api" />
132 description="load junit libraries"
134 <f2 project="junit" />
138 description="load full XML libraries (xalan, resolver)"
140 <f2 project="xalan" />
141 <f2 project="xml-resolver" />
146 we like to get the more recent artifacts than are in the repo at the time of writing (2006-12-21)
149 <target name="xerces"
150 description="load an updated version of Xerces"
152 <f2 project="xerces" archive="xercesImpl"/>
153 <f2 project="xerces" archive="xml-apis" />
156 <target name="networking"
157 description="load networking libraries (commons-net; jsch)"
159 <f2 project="commons-net" />
160 <f2 project="com.jcraft" archive="jsch"/>
163 <target name="regexp"
164 description="load regexp libraries"
166 <f2 project="regexp" />
171 description="load antlr libraries"
173 <f2 project="antlr" />
177 description="load bcel libraries"
179 <f2 project="bcel" />
182 <target name="jdepend"
183 description="load jdepend libraries"
185 <f2 project="jdepend" />
189 description="load bsf libraries"
195 description="load jruby"
197 <f2 project="org.jruby" archive="jruby"/>
200 <target name="beanshell"
201 description="load beanshell support"
203 <f2 project="org.beanshell" archive="bsh"/>
204 <f2 project="org.beanshell" archive="bsh-core"/>
207 <target name="jython"
208 description="load jython"
210 <f2 project="jython" archive="jython"/>
214 description="load rhino"
216 <f2 project="rhino" archive="js"/>
219 <target name="script"
220 description="load script languages"
221 depends="bsf,jruby,jython,beanshell,rhino"/>
223 <target name="debugging"
224 description="internal ant debugging"
226 <f2 project="which" />
230 description="load all the libraries"
231 depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script" />