1 | <?xml version="1.0"?>
|
---|
2 |
|
---|
3 | <!--
|
---|
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
|
---|
10 |
|
---|
11 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
12 |
|
---|
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.
|
---|
18 | -->
|
---|
19 | <!--
|
---|
20 | =======================================================================
|
---|
21 | Build file to fetch optional libraries for Apache Ant
|
---|
22 | =======================================================================
|
---|
23 | -->
|
---|
24 | <project name="fetch" default="all" basedir=".">
|
---|
25 |
|
---|
26 | <description>
|
---|
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.
|
---|
29 |
|
---|
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
|
---|
33 | -Ddest=optional optional dir $${basedir}/lib/optional (for Ant developers)
|
---|
34 |
|
---|
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.
|
---|
37 |
|
---|
38 | Proxies can be configured manually setting the JVM proxy values in the
|
---|
39 | ANT_OPTS environment variable.
|
---|
40 |
|
---|
41 | For example, to set the proxy up in the tcsh shell, the command would be
|
---|
42 | something like:
|
---|
43 |
|
---|
44 | For csh/tcsh:
|
---|
45 | setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
|
---|
46 | For bash:
|
---|
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
|
---|
51 | </description>
|
---|
52 |
|
---|
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" />
|
---|
59 |
|
---|
60 | <!-- load in our properties table -->
|
---|
61 | <property file="${lib.dir}/libraries.properties"/>
|
---|
62 |
|
---|
63 | <!-- Temporary cache for working files -->
|
---|
64 | <property name="temp.dir" location="${user.home}/.ant/tempcache" />
|
---|
65 | <property name="keep.temp.dir" value="true" />
|
---|
66 |
|
---|
67 | <import file="get-m2.xml" />
|
---|
68 |
|
---|
69 | <target name="pick-dest">
|
---|
70 | <fail>
|
---|
71 | <condition>
|
---|
72 | <not>
|
---|
73 | <isset property="dest"/>
|
---|
74 | </not>
|
---|
75 | </condition>ERROR
|
---|
76 | Set -Ddest=LOCATION on the command line
|
---|
77 | -Ddest=user user lib dir ${user.home}/.ant/lib
|
---|
78 | -Ddest=system ant lib dir ${ant.home}/lib
|
---|
79 | -Ddest=optional optional dir $${basedir}/lib/optional (for Ant developers)
|
---|
80 | </fail>
|
---|
81 |
|
---|
82 | <condition property="dest.dir"
|
---|
83 | value="${lib.dir}">
|
---|
84 | <equals arg1="${dest}" arg2="system" />
|
---|
85 | </condition>
|
---|
86 | <condition property="dest.dir"
|
---|
87 | value="${optional.dir}">
|
---|
88 | <equals arg1="${dest}" arg2="optional" />
|
---|
89 | </condition>
|
---|
90 | <condition property="dest.dir"
|
---|
91 | value="${userlib.dir}">
|
---|
92 | <equals arg1="${dest}" arg2="user" />
|
---|
93 | </condition>
|
---|
94 | <fail unless="dest.dir">Unknown destination : ${dest}</fail>
|
---|
95 | <echo>Downloading to ${dest.dir}</echo>
|
---|
96 | <property name="m2.dest.dir" value="${dest.dir}" />
|
---|
97 | </target>
|
---|
98 |
|
---|
99 |
|
---|
100 | <target name="macros" depends="pick-dest,get-m2"
|
---|
101 | xmlns:artifact="antlib:org.apache.maven.artifact.ant">
|
---|
102 |
|
---|
103 | <macrodef name="f2">
|
---|
104 | <attribute name="project" />
|
---|
105 | <attribute name="archive" default="@{project}"/>
|
---|
106 | <attribute name="repository" default="${m2.repo}"/>
|
---|
107 | <sequential>
|
---|
108 | <fail>
|
---|
109 | Unknown archive @{archive} -no property @{archive}.version defined in ${lib.dir}/libraries.properties.
|
---|
110 | <condition>
|
---|
111 | <not>
|
---|
112 | <isset property="@{archive}.version"/>
|
---|
113 | </not>
|
---|
114 | </condition>
|
---|
115 | </fail>
|
---|
116 | <artifact:dependencies pathID="@{archive}.path">
|
---|
117 | <dependency groupID="@{project}"
|
---|
118 | artifactID="@{archive}"
|
---|
119 | version="${@{archive}.version}"/>
|
---|
120 | <remoteRepository url="@{repository}" />
|
---|
121 | </artifact:dependencies>
|
---|
122 | <!-- now we are left with the problem of getting the files
|
---|
123 | into our directory -->
|
---|
124 | <copy todir="${dest.dir}">
|
---|
125 | <path refid="@{archive}.path" />
|
---|
126 | <flattenmapper/>
|
---|
127 | </copy>
|
---|
128 | </sequential>
|
---|
129 | </macrodef>
|
---|
130 | </target>
|
---|
131 |
|
---|
132 | <target name="nonm2-macros" depends="pick-dest">
|
---|
133 | <macrodef name="get-ftp-file">
|
---|
134 | <attribute name="host" />
|
---|
135 | <attribute name="port" default="21"/>
|
---|
136 | <attribute name="remotedir" />
|
---|
137 | <attribute name="filename" />
|
---|
138 | <attribute name="localdir" default="${dest.dir}" />
|
---|
139 | <attribute name="user" default="anonymous"/>
|
---|
140 | <attribute name="pw" default="anonymous"/>
|
---|
141 | <sequential>
|
---|
142 | <ftp server="@{host}" port="@{port}" userid="@{user}" password="@{pw}" passive="true"
|
---|
143 | remotedir="@{remotedir}" action="get" depends="true" preserveLastModified="true"
|
---|
144 | skipFailedTransfers="true">
|
---|
145 | <fileset dir="@{localdir}">
|
---|
146 | <include name="@{filename}" />
|
---|
147 | </fileset>
|
---|
148 | </ftp>
|
---|
149 | </sequential>
|
---|
150 | </macrodef>
|
---|
151 |
|
---|
152 | </target>
|
---|
153 |
|
---|
154 |
|
---|
155 |
|
---|
156 | <!-- any init stuff -->
|
---|
157 | <target name="init" depends="macros" />
|
---|
158 |
|
---|
159 | <target name="init-no-m2" depends="nonm2-macros" />
|
---|
160 |
|
---|
161 | <target name="init-cache">
|
---|
162 | <available property="temp.cache.already.exists" file="${temp.dir}" type="dir" />
|
---|
163 | <condition property="user.wants.temp.cache">
|
---|
164 | <and>
|
---|
165 | <isset property="keep.temp.dir" />
|
---|
166 | <not>
|
---|
167 | <or>
|
---|
168 | <equals arg1="${keep.temp.dir}" arg2="false" casesensitive="false" />
|
---|
169 | <equals arg1="${keep.temp.dir}" arg2="no" casesensitive="false" />
|
---|
170 | <equals arg1="${keep.temp.dir}" arg2="off" casesensitive="false" />
|
---|
171 | </or>
|
---|
172 | </not>
|
---|
173 | </and>
|
---|
174 | </condition>
|
---|
175 | <condition property="delete.temp.cache">
|
---|
176 | <and>
|
---|
177 | <not>
|
---|
178 | <isset property="temp.cache.already.exists" />
|
---|
179 | </not>
|
---|
180 | <not>
|
---|
181 | <isset property="user.wants.temp.cache" />
|
---|
182 | </not>
|
---|
183 | </and>
|
---|
184 | </condition>
|
---|
185 | </target>
|
---|
186 |
|
---|
187 | <target name="-setup-temp-cache" depends="init-cache" unless="temp.cache.already.exists"
|
---|
188 | description="Setup temporary cache for downloaded files">
|
---|
189 | <mkdir dir="${temp.dir}" />
|
---|
190 | </target>
|
---|
191 |
|
---|
192 | <target name="-cleanup-temp-cache" depends="init-cache" if="delete.temp.cache"
|
---|
193 | description="Gets rid of the temporary cache directory">
|
---|
194 | <delete dir="${temp.dir}" />
|
---|
195 | </target>
|
---|
196 |
|
---|
197 |
|
---|
198 | <target name="diag" depends="init">
|
---|
199 | <echoproperties />
|
---|
200 | </target>
|
---|
201 |
|
---|
202 | <target name="logging"
|
---|
203 | description="load logging libraries"
|
---|
204 | depends="init">
|
---|
205 | <f2 project="log4j" />
|
---|
206 | <f2 project="commons-logging" archive="commons-logging-api" />
|
---|
207 | </target>
|
---|
208 |
|
---|
209 | <target name="junit"
|
---|
210 | description="load junit libraries"
|
---|
211 | depends="init">
|
---|
212 | <f2 project="junit" />
|
---|
213 | </target>
|
---|
214 |
|
---|
215 | <target name="xml"
|
---|
216 | description="load full XML libraries (xalan, resolver)"
|
---|
217 | depends="init">
|
---|
218 | <f2 project="xalan" />
|
---|
219 | <f2 project="xml-resolver" />
|
---|
220 | </target>
|
---|
221 |
|
---|
222 | <target name="networking"
|
---|
223 | description="load networking libraries (commons-net; jsch)"
|
---|
224 | depends="init">
|
---|
225 | <f2 project="commons-net" />
|
---|
226 | <f2 project="com.jcraft" archive="jsch"/>
|
---|
227 | </target>
|
---|
228 |
|
---|
229 | <target name="regexp"
|
---|
230 | description="load regexp libraries"
|
---|
231 | depends="init">
|
---|
232 | <f2 project="regexp" />
|
---|
233 | <f2 project="oro" />
|
---|
234 | </target>
|
---|
235 |
|
---|
236 | <target name="antlr"
|
---|
237 | description="load antlr libraries"
|
---|
238 | depends="init">
|
---|
239 | <f2 project="antlr" />
|
---|
240 | </target>
|
---|
241 |
|
---|
242 | <target name="bcel"
|
---|
243 | description="load bcel libraries"
|
---|
244 | depends="init">
|
---|
245 | <f2 project="bcel" />
|
---|
246 | </target>
|
---|
247 |
|
---|
248 | <target name="jdepend"
|
---|
249 | description="load jdepend libraries"
|
---|
250 | depends="init">
|
---|
251 | <f2 project="jdepend" />
|
---|
252 | </target>
|
---|
253 |
|
---|
254 | <target name="bsf"
|
---|
255 | description="load bsf libraries"
|
---|
256 | depends="init">
|
---|
257 | <f2 project="bsf" />
|
---|
258 | </target>
|
---|
259 |
|
---|
260 | <target name="jruby"
|
---|
261 | description="load jruby"
|
---|
262 | depends="bsf">
|
---|
263 | <f2 project="org.jruby" archive="jruby"/>
|
---|
264 | </target>
|
---|
265 |
|
---|
266 | <target name="beanshell"
|
---|
267 | description="load beanshell support"
|
---|
268 | depends="bsf">
|
---|
269 | <f2 project="org.beanshell" archive="bsh"/>
|
---|
270 | <f2 project="org.beanshell" archive="bsh-core"/>
|
---|
271 | </target>
|
---|
272 |
|
---|
273 | <target name="jython"
|
---|
274 | description="load jython"
|
---|
275 | depends="bsf">
|
---|
276 | <f2 project="jython" archive="jython"/>
|
---|
277 | </target>
|
---|
278 |
|
---|
279 | <target name="rhino"
|
---|
280 | description="load rhino"
|
---|
281 | depends="bsf">
|
---|
282 | <f2 project="rhino" archive="js"/>
|
---|
283 | </target>
|
---|
284 |
|
---|
285 | <target name="script"
|
---|
286 | description="load script languages (except jython)"
|
---|
287 | depends="bsf,jruby,beanshell,rhino"/>
|
---|
288 |
|
---|
289 | <target name="debugging"
|
---|
290 | description="internal ant debugging"
|
---|
291 | depends="init">
|
---|
292 | <f2 project="which" />
|
---|
293 | </target>
|
---|
294 |
|
---|
295 | <target name="javamail" depends="init"
|
---|
296 | description="load javamail">
|
---|
297 | <f2 project="javax.mail" archive="mail"/>
|
---|
298 | </target>
|
---|
299 |
|
---|
300 | <target name="jspc" depends="init" description="loads Jasper">
|
---|
301 | <f2 project="tomcat" archive="jasper-compiler"/>
|
---|
302 | <f2 project="tomcat" archive="jasper-runtime"/>
|
---|
303 | <f2 project="javax.servlet" archive="servlet-api"/>
|
---|
304 | </target>
|
---|
305 |
|
---|
306 | <target name="jai" depends="init"
|
---|
307 | description="load java advanced imaging">
|
---|
308 | <f2 project="javax.media" archive="jai-core" repository="https://repository.jboss.org/nexus/content/groups/public/"/>
|
---|
309 | <f2 project="com.sun.media" archive="jai-codec" repository="https://repository.jboss.org/nexus/content/groups/public/"/>
|
---|
310 | </target>
|
---|
311 |
|
---|
312 | <target name="netrexx" depends="init-no-m2,-setup-temp-cache,-fetch-netrexx,-fetch-netrexx-no-commons-net"
|
---|
313 | description="load NetRexx compiler">
|
---|
314 | <copy todir="${dest.dir}" flatten="true">
|
---|
315 | <zipfileset src="${temp.dir}/NetRexx.zip">
|
---|
316 | <include name="NetRexx\lib\NetRexxC.jar" />
|
---|
317 | <include name="NetRexx\browse\license.txt" />
|
---|
318 | </zipfileset>
|
---|
319 | </copy>
|
---|
320 | <antcall target="-cleanup-temp-cache"/>
|
---|
321 | </target>
|
---|
322 | <available property="have.commons.net" classname="org.apache.commons.net.ftp.FTPClientConfig"/>
|
---|
323 | <target name="-fetch-netrexx" if="have.commons.net">
|
---|
324 | <get-ftp-file host="ftp.software.ibm.com" remotedir="/software/awdtools/netrexx"
|
---|
325 | filename="NetRexx.zip" localdir="${temp.dir}" />
|
---|
326 | </target>
|
---|
327 | <target name="-fetch-netrexx-no-commons-net" unless="have.commons.net">
|
---|
328 | <get src="ftp://ftp.software.ibm.com/software/awdtools/netrexx/NetRexx.zip" dest="${temp.dir}/NetRexx.zip" skipexisting="true"/>
|
---|
329 | </target>
|
---|
330 |
|
---|
331 | <target name="all"
|
---|
332 | description="load all the libraries (except jython)"
|
---|
333 | depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc,jai,netrexx" />
|
---|
334 |
|
---|
335 | </project>
|
---|