1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
|
<project name="ant-contrib" basedir="." default="dist"
xmlns:ivy="antlib:fr.jayasoft.ivy">
<property file="build.properties" />
<property name="jar.name" value="ant-contrib" />
<property name="target.dir" location="target" />
<property name="target.stage.dir" location="${target.dir}/stage" />
<property name="dist.dir" location="dist" />
<property name="root.dir" location="." />
<property name="src.exclude.pattern"
value="**/target,**/target/**/*,**/dist,**/dist/**/*,.metadata,.metadata/**/*,.settings,.settings/**/*,.project,.classpath" />
<path id="ivy.lib.path">
<fileset dir="lib/ivy/jars" includes="ivy-1.4.1.jar"/>
<fileset dir="lib/commons-cli/jars" includes="commons-cli-1.0.jar"/>
<fileset dir="lib/commons-codec/jars" includes="commons-codec-1.3.jar"/>
<fileset dir="lib/commons-httpclient/jars" includes="commons-httpclient-3.0.1.jar"/>
<fileset dir="lib/commons-logging/jars" includes="commons-logging-1.0.4.jar"/>
<fileset dir="lib/oro/jars" includes="oro-2.0.8.jar"/>
</path>
<taskdef resource="fr/jayasoft/ivy/ant/antlib.xml"
uri="antlib:fr.jayasoft.ivy"
classpathref="ivy.lib.path" />
<macrodef name="compile">
<attribute name="config"/>
<sequential>
<ivy:cachepath pathid="@{config}.provided.path"
conf="@{config}-provided"
type="jar" />
<mkdir dir="@{config}/target/classes" />
<javac srcdir="@{config}/src/java"
destdir="@{config}/target/classes"
source="1.4"
target="1.4">
<classpath>
<path refid="@{config}.provided.path" />
<fileset dir="." includes="**/target/classes" />
</classpath>
</javac>
</sequential>
</macrodef>
<macrodef name="make-jar">
<attribute name="config"/>
<element name="additional-classes" optional="true" />
<sequential>
<jar file="@{config}/target/${jar.name}-@{config}.jar"
basedir="@{config}/target/classes">
<additional-classes />
</jar>
</sequential>
</macrodef>
<macrodef name="tasks-properties">
<attribute name="config"/>
<element name="filesets" optional="true" />
<sequential>
<doclet destdir="@{config}/target/classes/net/sf/antcontrib" verbose="true" force="true" >
<fileset dir="@{config}/src/java">
<include name="**/*.java" />
</fileset>
<filesets />
<template templateFile="etc/ant1.5-tasks.xdt"
destinationFile="antcontrib.properties" />
</doclet>
</sequential>
</macrodef>
<macrodef name="tasks-xml">
<attribute name="config"/>
<element name="filesets" optional="true" />
<sequential>
<doclet destdir="@{config}/target/classes/net/sf/antcontrib" verbose="true" force="true" >
<fileset dir="@{config}/src/java">
<include name="**/*.java" />
</fileset>
<filesets />
<xmltemplate templateFile="etc/ant1.6-tasks.xdt"
destinationFile="antlib.xml" />
</doclet>
</sequential>
</macrodef>
<macrodef name="copy-jar">
<attribute name="config" />
<sequential>
<copy todir="${target.stage.dir}">
<fileset dir="@{config}/target" includes="${jar.name}*.jar" />
<mapper type="glob" from="*.jar" to="*-${project.version}.jar" />
</copy>
</sequential>
</macrodef>
<macrodef name="copy-dist-libs">
<attribute name="config" />
<sequential>
<ivy:cachefileset setid="@{config}.dist.libs.path"
conf="@{config}"
type="jar" />
<mkdir dir="${target.stage.dir}/lib/@{config}" />
<copy todir="${target.stage.dir}/lib/@{config}">
<fileset refid="@{config}.dist.libs.path" />
<mapper type="flatten" />
</copy>
</sequential>
</macrodef>
<fileset id="inherited-1.5"
dir="ant1.5/src/java"
includes="**/*.java">
<exclude name="net/sf/antcontrib/logic/ForEach.java" />
<exclude name="net/sf/antcontrib/logic/Assert.java" />
<exclude name="net/sf/antcontrib/logic/AntFetch.java" />
<exclude name="net/sf/antcontrib/logic/AntCallback.java" />
</fileset>
<fileset id="inherited-1.6"
dir="ant1.6/src/java"
includes="**/*.java">
<exclude name="net/sf/antcontrib/logic/ant16/ForTask.java" />
<exclude name="net/sf/antcontrib/logic/ant16/AntFetch.java" />
<exclude name="net/sf/antcontrib/logic/ant16/AntCallback.java" />
</fileset>
<target name="configure">
<ivy:configure file="ivy-conf.xml" />
</target>
<target name="resolve" depends="configure">
<ivy:resolve file="ivy.xml" />
<ivy:cachepath pathid="build.classpath" conf="build" />
<taskdef name="doclet"
classname="xdoclet.DocletTask"
classpathref="build.classpath" />
</target>
<target name="compile" depends="resolve">
<compile config="ant1.5" />
<compile config="ant1.6" />
<compile config="ant1.7" />
<tasks-properties config="ant1.5" />
<tasks-properties config="ant1.6">
<filesets>
<fileset refid="inherited-1.5" />
</filesets>
</tasks-properties>
<tasks-properties config="ant1.7">
<filesets>
<fileset refid="inherited-1.5" />
<fileset refid="inherited-1.6" />
</filesets>
</tasks-properties>
<tasks-xml config="ant1.6">
<filesets>
<fileset refid="inherited-1.5" />
</filesets>
</tasks-xml>
<tasks-xml config="ant1.7">
<filesets>
<fileset refid="inherited-1.5" />
<fileset refid="inherited-1.6" />
</filesets>
</tasks-xml>
<fileset id="inherit-1.5-classes"
dir="ant1.5/target/classes">
<exclude name="net/sf/antcontrib/logic/For*.class" />
<exclude name="net/sf/antcontrib/logic/Assert*.class" />
<exclude name="net/sf/antcontrib/logic/AntFetch*.class" />
<exclude name="net/sf/antcontrib/logic/AntCallback*.class" />
<exclude name="net/sf/antcontrib/logic/ProjectDelegate*.class" />
</fileset>
<fileset id="inherit-1.6-classes"
dir="ant1.6/target/classes">
<exclude name="net/sf/antcontrib/logic/ant16/For*.class" />
<exclude name="net/sf/antcontrib/logic/ant16/AntFetch*.class" />
<exclude name="net/sf/antcontrib/logic/ant16/AntCallback*.class" />
<exclude name="net/sf/antcontrib/logic/ant16/ProjectDelegate*.class" />
</fileset>
</target>
<target name="jar" depends="compile">
<make-jar config="ant1.5" />
<make-jar config="ant1.6">
<additional-classes>
<fileset refid="inherit-1.5-classes" />
</additional-classes>
</make-jar>
<make-jar config="ant1.7">
<additional-classes>
<fileset refid="inherit-1.5-classes" />
<fileset refid="inherit-1.6-classes" />
</additional-classes>
</make-jar>
</target>
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="." includes="**/target.*,**/target/**/*,**/dist,**/dist/**/*" />
</delete>
</target>
<target name="dist-stage" depends="jar">
<mkdir dir="${target.stage.dir}" />
<mkdir dir="${target.stage.dir}/lib" />
<copy-jar config="ant1.5" />
<copy-jar config="ant1.6" />
<copy-jar config="ant1.7" />
<copy-dist-libs config="ant1.5" />
<copy-dist-libs config="ant1.6" />
<copy-dist-libs config="ant1.7" />
</target>
<target name="zip" depends="dist-stage">
<mkdir dir="${dist.dir}" />
<zip file="${dist.dir}/${project.name}-${project.version}-bin.zip">
<zipfileset prefix="ant-contrib"
dir="${target.stage.dir}"
includes="**/*" />
</zip>
<zip file="${dist.dir}/${project.name}-${project.version}-src.zip">
<zipfileset prefix="ant-contrib-${project.version}"
dir="${root.dir}"
includes="**/*"
excludes="${src.exclude.pattern}" />
</zip>
</target>
<target name="tar-zip" depends="dist-stage">
<mkdir dir="${dist.dir}" />
<tar destfile="${dist.dir}/${project.name}-${project.version}-bin.tar.gz"
compression="gzip">
<tarfileset prefix="ant-contrib-${project.version}"
dir="${target.stage.dir}"
includes="**/*" />
</tar>
<tar destfile="${dist.dir}/${project.name}-${project.version}-bin.tar.bz2"
compression="bzip2">
<tarfileset prefix="ant-contrib-${project.version}"
dir="${target.stage.dir}"
includes="**/*" />
</tar>
<tar destfile="${dist.dir}/${project.name}-${project.version}-src.tar.gz"
compression="gzip">
<tarfileset prefix="ant-contrib-${project.version}"
dir="${root.dir}"
includes="**/*"
excludes="${src.exclude.pattern}" />
</tar>
<tar destfile="${dist.dir}/${project.name}-${project.version}-src.tar.bz2"
compression="bzip2">
<tarfileset prefix="ant-contrib-${project.version}"
dir="${root.dir}"
includes="**/*"
excludes="${src.exclude.pattern}" />
</tar>
</target>
<target name="package" depends="dist-stage,zip,tar-zip">
<checksum fileext=".md5">
<fileset dir="${dist.dir}">
<include name="*.zip"/>
<include name="*.tar.bz2"/>
<include name="*.tar.gz"/>
</fileset>
</checksum>
</target>
<macrodef name="xdocs">
<attribute name="config" />
<element name="additional-source-files" optional="true" />
<element name="additional-classpath" optional="true" />
<sequential>
<taskdef name="antdoclet"
classname="org.apache.ant.xdoclet.AntDocletTask">
<classpath>
<path refid="build.classpath" />
<pathelement location="@{config}/target/classes" />
<additional-classpath />
<path refid="@{config}.provided.path" />
</classpath>
</taskdef>
<mkdir dir="@{config}/target/xdocs" />
<antdoclet destdir="@{config}/target/xdocs"
excludedtags="@version,@author"
force="true"
mergedir="@{config}/src/xdocs">
<fileset dir="@{config}/src/java" />
<additional-source-files />
<taskdescriptor />
</antdoclet>
</sequential>
</macrodef>
<target name="xdocs" depends="compile">
<xdocs config="ant1.5" />
<xdocs config="ant1.6">
<additional-source-files>
<fileset refid="inherited-1.5" />
</additional-source-files>
<additional-classpath>
<pathelement location="ant1.5/target/classes" />
</additional-classpath>
</xdocs>
<xdocs config="ant1.7">
<additional-source-files>
<fileset refid="inherited-1.5" />
<fileset refid="inherited-1.6" />
</additional-source-files>
<additional-classpath>
<pathelement location="ant1.5/target/classes" />
<pathelement location="ant1.6/target/classes" />
</additional-classpath>
</xdocs>
</target>
<target name="dist" depends="package">
</target>
</project>
|