Debian Codegraph @

build.xml

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 3 — not the installed (fully patched) source.
3 Debian patches touch this file
1 <!--
2 Licensed to the Ant-Contrib Project under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The Ant-Contrib Project licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 -->
18 <project
19 name="ant-contrib"
20 default="dist"
21 basedir="."
22 xmlns:ivy="antlib:org.apache.ivy.ant">
23
24 <property file="build.properties" />
25
26 <property name="root.dir" location="." />
27 <property name="src.dir" location="src/main" />
28 <property name="src.java.dir" location="${src.dir}/java" />
29 <property name="src.resources.dir" location="${src.dir}/resources" />
30 <property name="test.dir" location="test" />
31 <property name="test.src.dir" location="${test.dir}/src" />
32 <property name="test.resources.dir" location="${test.dir}/resources" />
33 <property name="docs.dir" location="docs" />
34 <property name="target.dir" location="target" />
35 <property name="target.classes.dir" location="${target.dir}/classes" />
36 <property name="target.test-classes.dir" location="${target.dir}/test-classes" />
37 <property name="target.docs.dir" location="${target.dir}/docs" />
38 <property name="dist.dir" location="dist" />
39 <property name="target.stage.dir" location="${target.dir}/stage" />
40
41 <property name="m2_repo" location="${user.home}/.m2/repository"/>
42 <property name="bcel.version" value="5.1"/>
43 <property name="bcel.jar" value="${m2_repo}/bcel/bcel/${bcel.version}/bcel-${bcel.version}.jar"/>
44 <property name="httpclient.version" value="3.0.1"/>
45 <property name="httpclient.jar" value="${m2_repo}/commons-httpclient/commons-httpclient/${httpclient.version}/commons-httpclient-${httpclient.version}.jar"/>
46 <property name="ivy.version" value="2.0.0"/>
47 <property name="ivy.jar" value="lib/ivy/jars/ivy-${ivy.version}.jar"/>
48 <property name="junit.version" value="3.8.1"/>
49 <property name="junit.jar" value="${m2_repo}/junit/junit/${junit.version}/junit-${junit.version}.jar"/>
50 <property name="ant.jar.version" value="1.6.5"/>
51 <property name="ant.jar" value="${m2_repo}/ant/ant/${ant.jar.version}/ant-${ant.jar.version}.jar"/>
52
53
54 <target name="init" unless="no-ivy">
55 <path id="ivy.lib.path">
56 <fileset dir="lib/ivy/jars" includes="ivy-2.0.0.jar"/>
57 <fileset dir="lib/commons-cli/jars" includes="commons-cli-1.0.jar"/>
58 <fileset dir="lib/commons-codec/jars" includes="commons-codec-1.3.jar"/>
59 <fileset dir="lib/commons-httpclient/jars" includes="commons-httpclient-3.0.1.jar"/>
60 <fileset dir="lib/commons-logging/jars" includes="commons-logging-1.0.4.jar"/>
61 <fileset dir="lib/oro/jars" includes="oro-2.0.8.jar"/>
62 </path>
63
64 <taskdef resource="org/apache/ivy/ant/antlib.xml"
65 uri="antlib:org.apache.ivy.ant"
66 classpathref="ivy.lib.path"/>
67 </target>
68
69 <target name="configure" depends="init" unless="no-ivy">
70 <ivy:configure file="ivysettings.xml" />
71 </target>
72
73 <target name="resolve" depends="configure" unless="no-ivy">
74 <ivy:resolve />
75 </target>
76
77 <target name="classpath-ivy" depends="resolve" unless="no-ivy">
78 <ivy:cachepath pathid="compile.classpath" type="jar" conf="provided" />
79 <ivy:cachepath pathid="runtime.classpath" type="jar" conf="default" />
80 <ivy:cachepath pathid="test.classpath" type="jar" conf="test" />
81 <ivy:cachefileset setid="compile.fileset" type="jar" conf="provided" />
82 <ivy:cachefileset setid="runtime.fileset" type="jar" conf="default" />
83 <ivy:cachefileset setid="test.fileset" type="jar" conf="test" />
84 </target>
85
86 <target name="classpath-no-ivy" if="no-ivy">
87 <path id="compile.classpath">
88 <pathelement location="${bcel.jar}"/>
89 <pathelement location="${httpclient.jar}"/>
90 <pathelement location="${ivy.jar}"/>
91 <pathelement location="${ant.jar}"/>
92 </path>
93
94 <path id="test.classpath">
95 <path refid="compile.classpath"/>
96 <pathelement location="${junit.jar}"/>
97 </path>
98
99 <fileset id="runtime.fileset" dir="lib"/>
100 </target>
101
102 <target name="classpath" depends="classpath-ivy, classpath-no-ivy"/>
103
104 <target name="compile" depends="classpath">
105 <mkdir dir="${target.classes.dir}" />
106 <javac srcdir="${src.java.dir}"
107 destdir="${target.classes.dir}"
108 debug="true"
109 classpathref="compile.classpath"
110 source="${jdk.source}"
111 target="${jdk.target}"
112 />
113
114 <copy todir="${target.classes.dir}">
115 <fileset dir="${src.resources.dir}"
116 includes="**/*.properties,**/*.xml" />
117 </copy>
118 </target>
119
120 <target name="compile-tests" depends="classpath,compile">
121 <mkdir dir="${target.test-classes.dir}" />
122 <javac srcdir="${test.src.dir}"
123 destdir="${target.test-classes.dir}"
124 debug="true"
125 source="${jdk.source}"
126 target="${jdk.target}">
127 <classpath>
128 <path refid="test.classpath" />
129 <pathelement location="${target.classes.dir}" />
130 </classpath>
131 </javac>
132
133 <copy todir="${target.test-classes.dir}">
134 <fileset dir="${test.src.dir}"
135 includes="**/*.properties,**/*.xml" />
136 <fileset dir="${test.resources.dir}"
137 includes="**/*.java,**/*.properties,**/*.xml"
138 excludes="**/design/src/**/*" />
139 <fileset dir="${test.resources.dir}/design/src"
140 includes="**/design/src/**/*" />
141 </copy>
142 </target>
143
144 <target name="jar" depends="compile">
145 <mkdir dir="${target.dir}" />
146 <tstamp>
147 <format property="tstamp" pattern="dd/MM/yyyy HH:mm:ss" />
148 </tstamp>
149 <jar file="${target.dir}/${jar.name}">
150 <manifest>
151 <attribute name="Version" value="${project.version}"/>
152 <attribute name="Build-Timestamp" value="${tstamp}"/>
153 </manifest>
154 <fileset dir="${target.classes.dir}" />
155 </jar>
156 </target>
157
158 <target name="clean">
159 <mkdir dir="${target.dir}" />
160 <mkdir dir="${dist.dir}" />
161 <delete includeemptydirs="true">
162 <fileset dir="${target.dir}" includes="**/*" />
163 <fileset dir="${dist.dir}" includes="**/*" />
164 </delete>
165 </target>
166
167 <target name="javadoc" depends="classpath">
168 <javadoc sourcepath="${src.java.dir}"
169 destdir="${target.docs.dir}/api"
170 packagenames="net.sf.antcontrib.*"
171 author="true"
172 version="true"
173 windowtitle="Ant Contrib"
174 classpathref="compile.classpath">
175 <tag name="ant.task" enabled="false" description="Task:" scope="types"/>
176 <tag name="ant.datatype" enabled="false"
177 description="Data type:" scope="types"/>
178 <tag name="ant.attribute" enabled="false"
179 description="Attribute:" scope="types"/>
180 <tag name="ant.attribute.group" enabled="false"
181 description="Attribute group:" scope="types"/>
182 <tag name="ant.element" enabled="false"
183 description="Nested element:" scope="types"/>
184 </javadoc>
185 </target>
186
187 <target name="docs" depends="javadoc">
188 <mkdir dir="${target.docs.dir}" />
189 <copy todir="${target.docs.dir}">
190 <fileset dir="${docs.dir}" includes="**/*" />
191 </copy>
192 </target>
193
194 <target name="dist-stage" depends="jar,docs">
195 <mkdir dir="${target.stage.dir}" />
196 <mkdir dir="${target.stage.dir}/lib" />
197
198 <copy file="${target.dir}/${jar.name}"
199 tofile="${target.stage.dir}/${jar.name.versioned}" />
200
201 <copy todir="${target.stage.dir}">
202 <fileset dir="${root.dir}" includes="README.txt" />
203 <fileset dir="${target.dir}" includes="docs/**/*" />
204 </copy>
205 <copy todir="${target.stage.dir}/lib" flatten="true">
206 <fileset refid="runtime.fileset" />
207 </copy>
208 </target>
209
210 <target name="zip" depends="dist-stage">
211 <mkdir dir="${dist.dir}" />
212 <zip file="${dist.dir}/${project.name}-${project.version}-bin.zip">
213 <zipfileset prefix="ant-contrib" dir="${target.stage.dir}"
214 includes="**/*" />
215 </zip>
216
217 <zip file="${dist.dir}/${project.name}-${project.version}-src.zip">
218 <zipfileset prefix="ant-contrib"
219 dir="${root.dir}"
220 includes="**/*"
221 excludes="target,target/**/*,dist,dist/**/*" />
222 </zip>
223 </target>
224
225 <target name="tar.gz" depends="dist-stage">
226 <mkdir dir="${dist.dir}" />
227
228 <tar destfile="${dist.dir}/${project.name}-${project.version}-bin.tar.gz"
229 compression="gzip">
230 <tarfileset prefix="ant-contrib"
231 dir="${target.stage.dir}"
232 includes="**/*" />
233 </tar>
234
235 <tar destfile="${dist.dir}/${project.name}-${project.version}-bin.tar.bz2"
236 compression="bzip2">
237 <tarfileset prefix="ant-contrib"
238 dir="${target.stage.dir}"
239 includes="**/*" />
240 </tar>
241
242 <tar destfile="${dist.dir}/${project.name}-${project.version}-src.tar.gz"
243 compression="gzip">
244 <tarfileset prefix="ant-contrib"
245 dir="${root.dir}"
246 includes="**/*"
247 excludes="target,target/**/*,dist,dist/**/*" />
248 </tar>
249
250 <tar destfile="${dist.dir}/${project.name}-${project.version}-src.tar.bz2"
251 compression="bzip2">
252 <tarfileset prefix="ant-contrib"
253 dir="${root.dir}"
254 includes="**/*"
255 excludes="target,target/**/*,dist,dist/**/*" />
256 </tar>
257
258 </target>
259
260 <target name="package" depends="tar.gz,zip">
261 <checksum fileext=".md5">
262 <fileset dir="${dist.dir}">
263 <include name="*.zip"/>
264 <include name="*.tar.bz2"/>
265 <include name="*.tar.gz"/>
266 </fileset>
267 </checksum>
268 </target>
269
270 <target name="dist" depends="package">
271 </target>
272
273 <target name="run-test" depends="compile-tests, jar">
274 <property name="lib.dir" location="lib" />
275 <pathconvert pathsep="${path.separator}"
276 dirsep="/"
277 property="tpath">
278 <path refid="test.classpath" />
279 </pathconvert>
280
281 <junit haltonfailure="false" haltonerror="false"
282 errorproperty="junit.error" failureproperty="junit.failure">
283 <formatter type="brief" usefile="false"/>
284 <batchtest>
285 <fileset dir="${target.test-classes.dir}" excludes="${skip-tests}">
286 <exclude name="**/antclipse/**" unless="eclipse.present"/>
287 <exclude name="walls/**"/>
288 </fileset>
289 </batchtest>
290 <sysproperty key="antcontrib.jar" file="${target.dir}/${jar.name}"/>
291 <sysproperty key="test.classpath" value="${tpath}"/>
292 <classpath>
293 <path refid="test.classpath" />
294 <pathelement location="${target.classes.dir}" />
295 <pathelement location="${target.test-classes.dir}" />
296 </classpath>
297 </junit>
298
299 <fail message="JUnit error (${junit.error}) encountered." if="junit.error" />
300 <fail message="JUnit failure (${junit.failure}) encountered." if="junit.failure" />
301 </target>
302
303 <target name="test-all" depends="compile-tests">
304 <antcall target="run-test">
305 <param name="skip-tests" value="**/BuildFileTestBase.class"/>
306 </antcall>
307 </target>
308
309
310 <target name="gump-safe-test" depends="compile-tests">
311 <!-- all AntServerTest tests started failing on Gump
312 with IOException at 2004-12-06T15:00:16
313 after successfully completing at 2004-12-06T03:00:19 -->
314 <antcall target="run-test">
315 <param name="skip-tests" value="**/AntServerTest.class **/BuildFileTest*.class"/>
316 </antcall>
317 </target>
318
319 <target name="test" depends="gump-safe-test"/>
320
321 </project>