1 |
tim |
1.18 |
<project name="jsr166" default="usage"> |
2 |
tim |
1.1 |
|
3 |
|
|
<description> |
4 |
tim |
1.29 |
------------------------------------------------------------------------------ |
5 |
|
|
Build file for JSR-166 |
6 |
tim |
1.18 |
|
7 |
tim |
1.29 |
Usage: ant [target] |
8 |
|
|
|
9 |
|
|
User-specific settings are read from user.properties. |
10 |
tim |
1.32 |
See user.properties.sample for an explanation of some useful settings. |
11 |
tim |
1.29 |
------------------------------------------------------------------------------ |
12 |
tim |
1.18 |
</description> |
13 |
tim |
1.11 |
|
14 |
tim |
1.29 |
<target name="usage" description="Advises user to run with -projecthelp"> |
15 |
|
|
<echo>Run "ant -projecthelp" for full usage information.</echo> |
16 |
|
|
</target> |
17 |
tim |
1.3 |
|
18 |
tim |
1.11 |
|
19 |
tim |
1.27 |
<!-- User-specific settings --> |
20 |
tim |
1.23 |
<property file="user.properties"/> |
21 |
tim |
1.27 |
|
22 |
tim |
1.1 |
|
23 |
|
|
<!-- Compilation options --> |
24 |
tim |
1.11 |
<property name="build.sourcelevel" value="1.5"/> |
25 |
tim |
1.25 |
<property name="build.docsourcelevel" value="1.4"/> |
26 |
tim |
1.1 |
<property name="build.debug" value="true"/> |
27 |
|
|
<property name="build.debuglevel" value="source,lines,vars"/> |
28 |
tim |
1.13 |
<property name="build.deprecation" value="false"/> |
29 |
tim |
1.1 |
|
30 |
|
|
<!-- Build locations --> |
31 |
|
|
<property name="build.dir" location="build"/> |
32 |
|
|
<property name="build.classes.dir" location="${build.dir}/classes"/> |
33 |
tim |
1.27 |
<property name="build.emulation.dir" location="${build.dir}/emulation"/> |
34 |
tim |
1.1 |
<property name="build.testcases.dir" location="${build.dir}/testcases"/> |
35 |
|
|
<property name="build.lib.dir" location="${build.dir}/lib"/> |
36 |
|
|
<property name="build.ant.dir" location="${build.dir}/ant"/> |
37 |
tim |
1.9 |
<property name="build.javadocs.dir" location="${build.dir}/javadocs"/> |
38 |
tim |
1.16 |
<property name="build.stripped.dir" location="${build.dir}/stripped"/> |
39 |
tim |
1.1 |
<property name="build.reports.dir" location="${build.dir}/reports"/> |
40 |
tim |
1.16 |
<property name="build.doccheck.dir" location="${build.dir}/doccheck"/> |
41 |
tim |
1.1 |
<property name="build.filter.src.dir" location="${build.dir}/filtersrc"/> |
42 |
tim |
1.47 |
<property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/> |
43 |
tim |
1.1 |
|
44 |
|
|
<!-- Source locations --> |
45 |
tim |
1.22 |
<property name="src.dir" location="${basedir}/src/main"/> |
46 |
tim |
1.27 |
<property name="emulation.src.dir" location="${basedir}/src/emulation"/> |
47 |
tim |
1.22 |
<property name="test.src.dir" location="${basedir}/src/test"/> |
48 |
tim |
1.1 |
<property name="ant.src.dir" location="${basedir}/etc/ant"/> |
49 |
|
|
<property name="stylesheet.dir" location="${basedir}/etc/xsl"/> |
50 |
|
|
<property name="lib.dir" location="${basedir}/lib"/> |
51 |
tim |
1.9 |
<property name="dist.dir" location="${basedir}/dist"/> |
52 |
|
|
|
53 |
|
|
<!-- Distribution locations --> |
54 |
|
|
<property name="dist.javadocs.dir" location="${dist.dir}/docs"/> |
55 |
tim |
1.1 |
|
56 |
|
|
<!-- Jar locations --> |
57 |
|
|
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
58 |
|
|
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
59 |
|
|
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
60 |
tim |
1.49 |
<property name="sinjdoc.jar" location="${lib.dir}/sinjdoc.jar"/> |
61 |
tim |
1.27 |
|
62 |
tim |
1.28 |
|
63 |
tim |
1.40 |
<!-- Files excluded from dist-docs and emulation jar --> |
64 |
|
|
<patternset id="unsafe.exclusion"> |
65 |
tim |
1.28 |
<exclude name="java/util/Random.*"/> |
66 |
|
|
<exclude name="sun/misc/Unsafe.*"/> |
67 |
|
|
</patternset> |
68 |
|
|
|
69 |
tim |
1.40 |
<!-- Files excludes from emulation jar --> |
70 |
|
|
<patternset id="atomic.exclusion"> |
71 |
tim |
1.41 |
<exclude name="java/util/concurrent/atomic/AtomicBoolean*"/> |
72 |
tim |
1.40 |
<exclude name="java/util/concurrent/atomic/AtomicInteger*"/> |
73 |
|
|
<exclude name="java/util/concurrent/atomic/AtomicLong*"/> |
74 |
|
|
<exclude name="java/util/concurrent/atomic/AtomicReference*"/> |
75 |
|
|
</patternset> |
76 |
|
|
|
77 |
tim |
1.28 |
|
78 |
|
|
|
79 |
tim |
1.11 |
<!-- Main targets --> |
80 |
|
|
|
81 |
tim |
1.28 |
<target name="compile" |
82 |
tim |
1.33 |
depends="init, configure-compiler, prepare-src" |
83 |
tim |
1.27 |
description="Compiles main sources to build folder"> |
84 |
|
|
|
85 |
tim |
1.33 |
<property name="prepare.src.dir" value="${src.dir}"/> |
86 |
|
|
|
87 |
tim |
1.1 |
<mkdir dir="${build.classes.dir}"/> |
88 |
tim |
1.27 |
|
89 |
tim |
1.37 |
<!-- |
90 |
|
|
<echo>javac ${gjc.args}</echo> |
91 |
|
|
<echo>bootclasspath=${compile.bootclasspath}</echo> |
92 |
|
|
--> |
93 |
|
|
|
94 |
tim |
1.33 |
<javac srcdir="${prepare.src.dir}" |
95 |
tim |
1.1 |
destdir="${build.classes.dir}" |
96 |
|
|
debug="${build.debug}" |
97 |
|
|
debuglevel="${build.debuglevel}" |
98 |
|
|
deprecation="${build.deprecation}" |
99 |
|
|
source="${build.sourcelevel}" |
100 |
|
|
fork="true"> |
101 |
|
|
|
102 |
tim |
1.37 |
<compilerarg line="${gjc.args}"/> |
103 |
|
|
<bootclasspath refid="compile.bootclasspath"/> |
104 |
tim |
1.1 |
|
105 |
|
|
</javac> |
106 |
tim |
1.27 |
|
107 |
tim |
1.1 |
</target> |
108 |
|
|
|
109 |
|
|
|
110 |
tim |
1.28 |
<target name="jar" |
111 |
tim |
1.32 |
depends="configure-emulation, init-jar, native-jar, emulation-jar" |
112 |
tim |
1.28 |
description="Builds library jar from compiled sources"/> |
113 |
tim |
1.1 |
|
114 |
|
|
|
115 |
tim |
1.28 |
<target name="test" |
116 |
tim |
1.32 |
depends="init, configure-tests, report-tests" |
117 |
tim |
1.29 |
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
118 |
tim |
1.1 |
|
119 |
|
|
|
120 |
tim |
1.28 |
<target name="checkstyle" |
121 |
|
|
depends="filter-src" |
122 |
tim |
1.18 |
description="Reports on style errors in Java source (verbose, mostly chaff)"> |
123 |
tim |
1.27 |
|
124 |
tim |
1.15 |
<taskdef resource="checkstyletask.properties" |
125 |
|
|
classpath="${lib.dir}/checkstyle-all-2.4.jar"/> |
126 |
|
|
|
127 |
|
|
<checkstyle> |
128 |
tim |
1.16 |
<formatter type="plain"/> <!-- also available: type="xml" --> |
129 |
tim |
1.15 |
<fileset dir="${build.filter.src.dir}" includes="**/*.java"/> |
130 |
|
|
</checkstyle> |
131 |
tim |
1.27 |
|
132 |
tim |
1.15 |
</target> |
133 |
|
|
|
134 |
tim |
1.16 |
|
135 |
tim |
1.28 |
<target name="doccheck" |
136 |
tim |
1.47 |
depends="filter-doccheck" |
137 |
|
|
description="Reports on javadoc style errors"> |
138 |
tim |
1.27 |
|
139 |
tim |
1.16 |
<delete dir="${build.doccheck.dir}"/> |
140 |
|
|
<mkdir dir="${build.doccheck.dir}"/> |
141 |
tim |
1.27 |
|
142 |
tim |
1.16 |
<javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
143 |
|
|
docletpath="${lib.dir}/doccheck.jar" |
144 |
|
|
destdir="${build.doccheck.dir}"> |
145 |
tim |
1.47 |
<packageset dir="${build.filter.doccheck.dir}"/> |
146 |
tim |
1.16 |
</javadoc> |
147 |
tim |
1.27 |
|
148 |
tim |
1.48 |
<echo>DocCheck output is in ${build.doccheck.dir}</echo> |
149 |
|
|
|
150 |
tim |
1.16 |
</target> |
151 |
|
|
|
152 |
|
|
|
153 |
tim |
1.28 |
<target name="docs" |
154 |
|
|
depends="filter-src" |
155 |
tim |
1.9 |
description="Builds javadocs with custom tags to build folder"> |
156 |
tim |
1.27 |
|
157 |
tim |
1.9 |
<delete dir="${build.javadocs.dir}"/> |
158 |
|
|
<mkdir dir="${build.javadocs.dir}"/> |
159 |
tim |
1.27 |
|
160 |
tim |
1.9 |
<javadoc destdir="${build.javadocs.dir}" |
161 |
tim |
1.8 |
link="http://java.sun.com/j2se/1.4.1/docs/api" |
162 |
|
|
overview="${src.dir}/intro.html" |
163 |
dholmes |
1.24 |
source="${build.docsourcelevel}"> |
164 |
tim |
1.8 |
|
165 |
tim |
1.9 |
<tag name="revised" description="Last revised:"/> |
166 |
tim |
1.29 |
<tag name="spec" description="Specified by:"/> |
167 |
|
|
<tag name="editor" description="Last edited by:"/> |
168 |
|
|
<tag name="fixme" description="FIX ME:"/> |
169 |
|
|
|
170 |
tim |
1.22 |
<packageset dir="${build.filter.src.dir}"/> |
171 |
tim |
1.8 |
|
172 |
|
|
</javadoc> |
173 |
tim |
1.49 |
|
174 |
|
|
</target> |
175 |
|
|
|
176 |
|
|
|
177 |
|
|
<target name="sinjdocs" |
178 |
|
|
depends="configure-tests" |
179 |
|
|
description="Builds javadocs with custom tags to build folder"> |
180 |
|
|
|
181 |
|
|
<delete dir="${build.javadocs.dir}"/> |
182 |
|
|
<mkdir dir="${build.javadocs.dir}"/> |
183 |
|
|
|
184 |
|
|
<java classname="net.cscott.sinjdoc.Main" fork="true"> |
185 |
|
|
|
186 |
|
|
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
187 |
|
|
|
188 |
|
|
<classpath> |
189 |
|
|
<pathelement location="${sinjdoc.jar}"/> |
190 |
|
|
<path refid="test.classpath"/> |
191 |
|
|
</classpath> |
192 |
|
|
|
193 |
|
|
<!-- <arg value="-link"/> <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> --> |
194 |
|
|
|
195 |
|
|
<arg value="-d"/> <arg value="${build.javadocs.dir}"/> |
196 |
|
|
<arg value="-sourcepath"/> <arg value="${src.dir}"/> |
197 |
|
|
<arg value="-overview"/> <arg value="${src.dir}/intro.html"/> |
198 |
|
|
<arg value="-source"/> <arg value="1.5"/> |
199 |
|
|
<arg value="-verbose"/> |
200 |
|
|
<arg value="java.util"/> |
201 |
|
|
|
202 |
|
|
<!-- |
203 |
|
|
<arg value="-help"/> |
204 |
|
|
--> |
205 |
|
|
|
206 |
|
|
</java> |
207 |
tim |
1.27 |
|
208 |
tim |
1.8 |
</target> |
209 |
|
|
|
210 |
|
|
|
211 |
tim |
1.28 |
<target name="strip" |
212 |
tim |
1.32 |
depends="init, configure-compiler" |
213 |
tim |
1.31 |
description="Strip generics from java source (not working yet)"> |
214 |
tim |
1.27 |
|
215 |
tim |
1.16 |
<mkdir dir="${build.stripped.dir}"/> |
216 |
tim |
1.27 |
|
217 |
tim |
1.31 |
<!-- |
218 |
|
|
# javac -s doesn't reliably generate compilable code. It generates |
219 |
|
|
# bridge methods (marked as "synthetic") that can have identical |
220 |
|
|
# signatures to existing methods except for the return value. |
221 |
|
|
--> |
222 |
tim |
1.16 |
<javac srcdir="${src.dir}" |
223 |
|
|
destdir="${build.stripped.dir}" |
224 |
|
|
debug="${build.debug}" |
225 |
|
|
debuglevel="${build.debuglevel}" |
226 |
|
|
deprecation="${build.deprecation}" |
227 |
|
|
source="${build.sourcelevel}" |
228 |
|
|
fork="true"> |
229 |
|
|
|
230 |
tim |
1.37 |
<compilerarg line="${gjc.args} -s"/> |
231 |
|
|
<bootclasspath refid="compile.bootclasspath"/> |
232 |
tim |
1.16 |
|
233 |
|
|
</javac> |
234 |
tim |
1.27 |
|
235 |
tim |
1.16 |
</target> |
236 |
|
|
|
237 |
|
|
|
238 |
tim |
1.28 |
<target name="dist" |
239 |
|
|
depends="init, dist-clean, dist-jar, dist-docs" |
240 |
tim |
1.16 |
description="Puts all distributable products in single hierarchy"/> |
241 |
tim |
1.1 |
|
242 |
tim |
1.42 |
<target name="release" |
243 |
|
|
depends="dist" |
244 |
|
|
description="Puts entire CVS tree, plus distribution productions, in a jar"> |
245 |
|
|
|
246 |
tim |
1.46 |
<!-- |
247 |
dl |
1.45 |
#keep build dir? - dl |
248 |
tim |
1.42 |
<delete dir="${build.dir}"/> |
249 |
dl |
1.45 |
--> |
250 |
tim |
1.42 |
<property name="release.jar" value="dist/jsr166-${version}-dist.jar"/> |
251 |
|
|
|
252 |
|
|
<jar basedir="${basedir}" destfile="${release.jar}"> |
253 |
|
|
<exclude name="${release.jar}"/> |
254 |
|
|
<exclude name="user.properties"/> |
255 |
|
|
<exclude name="etc/notes/**"/> |
256 |
tim |
1.43 |
<exclude name="lib/gjc/2.1/**"/> |
257 |
tim |
1.44 |
<exclude name="**/SyntaxTest.java"/> |
258 |
tim |
1.42 |
</jar> |
259 |
|
|
|
260 |
|
|
</target> |
261 |
tim |
1.1 |
|
262 |
tim |
1.11 |
<target name="clean" |
263 |
|
|
description="Removes all build products"> |
264 |
tim |
1.27 |
|
265 |
tim |
1.11 |
<delete dir="${build.dir}"/> |
266 |
|
|
<delete dir="${build.classes.dir}"/> |
267 |
|
|
<delete dir="${build.lib.dir}"/> |
268 |
tim |
1.27 |
|
269 |
tim |
1.1 |
</target> |
270 |
|
|
|
271 |
|
|
|
272 |
tim |
1.11 |
<target name="dist-clean" |
273 |
|
|
description="Removes all build and distribution products"> |
274 |
tim |
1.27 |
|
275 |
tim |
1.11 |
<delete dir="${dist.dir}"/> |
276 |
tim |
1.27 |
|
277 |
tim |
1.9 |
</target> |
278 |
tim |
1.10 |
|
279 |
|
|
|
280 |
tim |
1.28 |
<target name="dist-docs" |
281 |
|
|
depends="filter-src" |
282 |
|
|
description="Builds javadocs without custom tags to dist folder"> |
283 |
|
|
|
284 |
|
|
<delete dir="${dist.javadocs.dir}"/> |
285 |
|
|
<mkdir dir="${dist.javadocs.dir}"/> |
286 |
|
|
|
287 |
|
|
<javadoc destdir="${dist.javadocs.dir}" |
288 |
|
|
link="http://java.sun.com/j2se/1.4.1/docs/api" |
289 |
|
|
overview="${src.dir}/intro.html" |
290 |
|
|
source="${build.docsourcelevel}"> |
291 |
|
|
|
292 |
|
|
<packageset dir="${build.filter.src.dir}"/> |
293 |
tim |
1.14 |
|
294 |
tim |
1.28 |
</javadoc> |
295 |
tim |
1.14 |
|
296 |
|
|
</target> |
297 |
|
|
|
298 |
|
|
|
299 |
tim |
1.28 |
|
300 |
tim |
1.11 |
<!-- Internal targets --> |
301 |
tim |
1.9 |
|
302 |
tim |
1.16 |
|
303 |
tim |
1.32 |
<target name="init"> |
304 |
tim |
1.27 |
|
305 |
tim |
1.11 |
<!-- Version is kept in a separate file --> |
306 |
|
|
<loadfile property="version" srcFile="version.properties"/> |
307 |
|
|
<echo>Building JSR-166 version ${version}</echo> |
308 |
tim |
1.27 |
|
309 |
|
|
</target> |
310 |
|
|
|
311 |
|
|
|
312 |
tim |
1.28 |
<target name="init-jar"> |
313 |
tim |
1.27 |
|
314 |
|
|
<mkdir dir="${build.lib.dir}"/> |
315 |
|
|
|
316 |
tim |
1.28 |
</target> |
317 |
|
|
|
318 |
|
|
|
319 |
|
|
<target name="native-jar" |
320 |
tim |
1.30 |
depends="compile" |
321 |
|
|
unless="build.emulation.true"> |
322 |
tim |
1.28 |
|
323 |
tim |
1.27 |
<jar destfile="${product.jar}"> |
324 |
|
|
<fileset dir="${build.classes.dir}"/> |
325 |
|
|
</jar> |
326 |
|
|
|
327 |
|
|
</target> |
328 |
|
|
|
329 |
|
|
|
330 |
tim |
1.28 |
<target name="compile-emulation" |
331 |
tim |
1.32 |
depends="init, configure-compiler" |
332 |
tim |
1.30 |
if="build.emulation.true"> |
333 |
tim |
1.27 |
|
334 |
|
|
<mkdir dir="${build.emulation.dir}"/> |
335 |
|
|
|
336 |
|
|
<javac srcdir="${emulation.src.dir}" |
337 |
|
|
destdir="${build.emulation.dir}" |
338 |
|
|
debug="${build.debug}" |
339 |
|
|
debuglevel="${build.debuglevel}" |
340 |
|
|
deprecation="${build.deprecation}" |
341 |
|
|
source="${build.sourcelevel}" |
342 |
|
|
fork="true"> |
343 |
|
|
|
344 |
tim |
1.37 |
<compilerarg line="${gjc.args}"/> |
345 |
|
|
<bootclasspath refid="compile.bootclasspath"/> |
346 |
tim |
1.27 |
|
347 |
|
|
</javac> |
348 |
|
|
|
349 |
|
|
</target> |
350 |
|
|
|
351 |
|
|
|
352 |
tim |
1.28 |
<target name="emulation-jar" |
353 |
tim |
1.30 |
depends="compile-emulation" |
354 |
|
|
if="build.emulation.true"> |
355 |
tim |
1.27 |
|
356 |
tim |
1.29 |
|
357 |
|
|
<jar destfile="${product.jar}" duplicate="add"> |
358 |
|
|
<fileset dir="${build.classes.dir}"> |
359 |
tim |
1.40 |
<patternset refid="atomic.exclusion"/> |
360 |
|
|
<patternset refid="unsafe.exclusion"/> |
361 |
tim |
1.29 |
</fileset> |
362 |
tim |
1.27 |
<fileset dir="${build.emulation.dir}"/> |
363 |
|
|
</jar> |
364 |
|
|
|
365 |
tim |
1.9 |
</target> |
366 |
|
|
|
367 |
|
|
|
368 |
tim |
1.28 |
<target name="dist-jar" |
369 |
|
|
depends="clean, jar"> |
370 |
tim |
1.27 |
|
371 |
tim |
1.11 |
<copy file="${product.jar}" todir="${dist.dir}"/> |
372 |
tim |
1.27 |
|
373 |
tim |
1.11 |
</target> |
374 |
|
|
|
375 |
|
|
|
376 |
tim |
1.28 |
<target name="compile-ant-filter" |
377 |
|
|
depends="init"> |
378 |
tim |
1.27 |
|
379 |
tim |
1.1 |
<mkdir dir="${build.ant.dir}"/> |
380 |
tim |
1.27 |
|
381 |
tim |
1.1 |
<javac srcdir="${ant.src.dir}" |
382 |
|
|
destdir="${build.ant.dir}" |
383 |
|
|
source="1.4" |
384 |
|
|
/> |
385 |
tim |
1.27 |
|
386 |
tim |
1.1 |
</target> |
387 |
|
|
|
388 |
|
|
|
389 |
tim |
1.28 |
<target name="filter-src" |
390 |
|
|
depends="compile-ant-filter"> |
391 |
tim |
1.27 |
|
392 |
tim |
1.1 |
<mkdir dir="${build.filter.src.dir}"/> |
393 |
tim |
1.27 |
|
394 |
tim |
1.1 |
<copy todir="${build.filter.src.dir}"> |
395 |
|
|
<fileset dir="${src.dir}"> |
396 |
tim |
1.31 |
<include name="**/*.html"/> |
397 |
|
|
</fileset> |
398 |
|
|
</copy> |
399 |
|
|
|
400 |
|
|
<copy todir="${build.filter.src.dir}"> |
401 |
|
|
<fileset dir="${src.dir}"> |
402 |
|
|
<exclude name="**/*.html"/> |
403 |
tim |
1.40 |
<patternset refid="unsafe.exclusion"/> |
404 |
tim |
1.1 |
</fileset> |
405 |
|
|
<filterchain> |
406 |
tim |
1.36 |
|
407 |
|
|
<!-- |
408 |
|
|
# This filter gets rid of angle-bracketed type parameters |
409 |
|
|
# so that javadoc can run on the result. The following |
410 |
|
|
# heuristic seems to work: |
411 |
|
|
# |
412 |
|
|
# For all lines not starting with space(s)-asterisk-space(s), |
413 |
|
|
# replace <something> with a space, where there may be more |
414 |
|
|
# than one right angle bracket at the end, and "something" |
415 |
|
|
# must not contain parens or pipes. (This may need some |
416 |
|
|
# tweaking.) |
417 |
|
|
--> |
418 |
|
|
|
419 |
tim |
1.1 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
420 |
|
|
classpath="${build.ant.dir}"> |
421 |
|
|
<param name="notmatching" value="^\s+\*\s.*$"/> |
422 |
tim |
1.36 |
<param name="pattern" value="<[^|>()]+?>+"/> |
423 |
tim |
1.1 |
<param name="replacement" value=" "/> |
424 |
|
|
</filterreader> |
425 |
tim |
1.36 |
|
426 |
|
|
|
427 |
|
|
<!-- |
428 |
|
|
# This filter uncomments lines beginning with "//@" so that |
429 |
|
|
# javadoc can see imports that are needed to resolve links |
430 |
|
|
# but that shouldn't be in the compiled code. |
431 |
|
|
--> |
432 |
|
|
|
433 |
tim |
1.1 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
434 |
|
|
classpath="${build.ant.dir}"> |
435 |
tim |
1.36 |
<param name="matching" value="^//@.*$"/> |
436 |
|
|
<param name="pattern" value="^//@"/> |
437 |
tim |
1.1 |
<param name="replacement" value=""/> |
438 |
|
|
</filterreader> |
439 |
tim |
1.47 |
</filterchain> |
440 |
|
|
</copy> |
441 |
|
|
|
442 |
|
|
</target> |
443 |
|
|
|
444 |
|
|
|
445 |
|
|
|
446 |
|
|
|
447 |
|
|
<target name="filter-doccheck" |
448 |
|
|
depends="filter-src"> |
449 |
tim |
1.36 |
|
450 |
tim |
1.47 |
<mkdir dir="${build.filter.doccheck.dir}"/> |
451 |
tim |
1.36 |
|
452 |
tim |
1.47 |
<copy todir="${build.filter.doccheck.dir}"> |
453 |
|
|
<fileset dir="${build.filter.src.dir}"> |
454 |
|
|
<include name="**/*.html"/> |
455 |
|
|
</fileset> |
456 |
|
|
</copy> |
457 |
|
|
|
458 |
|
|
<property name="generic.declarations" |
459 |
|
|
value="/** Fake type parameter. */ public interface E {} /** Fake type parameter. */ public interface T {} /** Fake type parameter. */ public interface K {} /** Fake type parameter. */ public interface V {}" |
460 |
|
|
/> |
461 |
|
|
|
462 |
|
|
<copy todir="${build.filter.doccheck.dir}"> |
463 |
|
|
<fileset dir="${build.filter.src.dir}"> |
464 |
|
|
<exclude name="**/*.html"/> |
465 |
|
|
</fileset> |
466 |
|
|
<filterchain> |
467 |
tim |
1.36 |
<!-- |
468 |
tim |
1.47 |
# These two filters try to make the source look like |
469 |
tim |
1.36 |
# something that doccheck can process. The first removes |
470 |
|
|
# -source 1.4 assertions and the second adds in a bunch |
471 |
|
|
# of single letter public nested marker interfaces so that |
472 |
|
|
# the generic type parameters are recognized. |
473 |
|
|
--> |
474 |
|
|
|
475 |
|
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
476 |
|
|
classpath="${build.ant.dir}"> |
477 |
|
|
<param name="matching" value="^\s*assert[\s ].*$"/> |
478 |
|
|
<param name="pattern" value="assert"/> |
479 |
|
|
<param name="replacement" value="//assert"/> |
480 |
|
|
</filterreader> |
481 |
|
|
|
482 |
|
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
483 |
|
|
classpath="${build.ant.dir}"> |
484 |
tim |
1.47 |
<param name="matching" value="^([^*]*(class|interface|implements) .*|)\{.*$"/> |
485 |
tim |
1.36 |
<param name="pattern" value="$"/> |
486 |
|
|
<param name="replacement" value=" ${generic.declarations}"/> |
487 |
|
|
</filterreader> |
488 |
|
|
|
489 |
tim |
1.1 |
</filterchain> |
490 |
|
|
</copy> |
491 |
tim |
1.27 |
|
492 |
tim |
1.1 |
</target> |
493 |
|
|
|
494 |
|
|
|
495 |
tim |
1.28 |
<target name="compile-tests" |
496 |
|
|
depends="jar"> |
497 |
tim |
1.27 |
|
498 |
tim |
1.1 |
<mkdir dir="${build.testcases.dir}"/> |
499 |
tim |
1.27 |
|
500 |
tim |
1.37 |
<!-- |
501 |
|
|
<echo>javac ${gjc.args}</echo> |
502 |
|
|
<echo>bootclasspath=${test.compile.bootclasspath}</echo> |
503 |
|
|
<echo>classpath="${test.classpath}"</echo> |
504 |
|
|
--> |
505 |
|
|
|
506 |
tim |
1.1 |
<javac srcdir="${test.src.dir}" |
507 |
|
|
destdir="${build.testcases.dir}" |
508 |
|
|
debug="${build.debug}" |
509 |
|
|
debuglevel="${build.debuglevel}" |
510 |
|
|
deprecation="${build.deprecation}" |
511 |
|
|
source="${build.sourcelevel}" |
512 |
|
|
fork="true"> |
513 |
|
|
|
514 |
tim |
1.37 |
<compilerarg line="${gjc.args}"/> |
515 |
|
|
<bootclasspath refid="test.compile.bootclasspath"/> |
516 |
|
|
<classpath refid="test.classpath"/> |
517 |
tim |
1.1 |
|
518 |
|
|
</javac> |
519 |
tim |
1.27 |
|
520 |
tim |
1.1 |
</target> |
521 |
tim |
1.11 |
|
522 |
tim |
1.1 |
|
523 |
tim |
1.28 |
<target name="run-tests" |
524 |
|
|
depends="compile-tests"> |
525 |
tim |
1.27 |
|
526 |
|
|
<!-- May be overridden by user.properties --> |
527 |
|
|
<property name="testcase" value="*"/> |
528 |
|
|
|
529 |
tim |
1.1 |
<mkdir dir="${build.reports.dir}"/> |
530 |
tim |
1.27 |
|
531 |
tim |
1.1 |
<junit printsummary="true" |
532 |
|
|
showoutput="true" |
533 |
|
|
errorProperty="junit.failed" |
534 |
|
|
failureProperty="junit.failed" |
535 |
tim |
1.12 |
dir="${build.reports.dir}" |
536 |
|
|
fork="true"> |
537 |
|
|
|
538 |
tim |
1.37 |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
539 |
tim |
1.1 |
|
540 |
|
|
<formatter type="xml"/> |
541 |
|
|
|
542 |
|
|
<batchtest todir="${build.reports.dir}"> |
543 |
|
|
<fileset dir="${test.src.dir}"> |
544 |
tim |
1.23 |
<include name="**/${testcase}Test.java"/> |
545 |
tim |
1.1 |
</fileset> |
546 |
|
|
</batchtest> |
547 |
|
|
|
548 |
|
|
</junit> |
549 |
tim |
1.27 |
|
550 |
tim |
1.1 |
</target> |
551 |
|
|
|
552 |
|
|
|
553 |
tim |
1.28 |
<target name="report-tests" |
554 |
|
|
depends="run-tests"> |
555 |
|
|
|
556 |
tim |
1.1 |
<!-- Sets junit.report.format to frames if Xalan is present, |
557 |
|
|
otherwise sets it to noframes. --> |
558 |
|
|
<available property="junit.report.format" |
559 |
|
|
value="frames" |
560 |
|
|
classname="org.apache.xalan.lib.Redirect" |
561 |
|
|
/> |
562 |
|
|
<property name="junit.report.format" value="noframes"/> |
563 |
|
|
|
564 |
|
|
<junitreport todir="${build.reports.dir}"> |
565 |
|
|
<fileset dir="${build.reports.dir}"> |
566 |
|
|
<include name="TEST-*.xml"/> |
567 |
|
|
</fileset> |
568 |
|
|
<report styledir="${stylesheet.dir}" |
569 |
|
|
format="${junit.report.format}" |
570 |
|
|
todir="${build.reports.dir}" |
571 |
|
|
/> |
572 |
|
|
</junitreport> |
573 |
|
|
|
574 |
|
|
<fail message="Test Cases Failed" if="junit.failed"/> |
575 |
tim |
1.28 |
|
576 |
tim |
1.18 |
</target> |
577 |
|
|
|
578 |
|
|
|
579 |
tim |
1.32 |
<target name="configure-compiler"> |
580 |
|
|
|
581 |
|
|
<property name="gjc.version" |
582 |
tim |
1.46 |
value="2.2"/> |
583 |
tim |
1.32 |
|
584 |
tim |
1.37 |
<condition property="novariance.arg" value="-novariance"> |
585 |
tim |
1.32 |
<and> |
586 |
|
|
<equals arg1="${gjc.version}" arg2="2.0"/> |
587 |
|
|
<or> |
588 |
|
|
<not><isset property="gjc.novariance"/></not> |
589 |
|
|
<istrue value="${gjc.novariance}"/> |
590 |
|
|
</or> |
591 |
|
|
</and> |
592 |
|
|
</condition> |
593 |
|
|
|
594 |
tim |
1.37 |
<property name="novariance.arg" |
595 |
tim |
1.32 |
value=""/> |
596 |
|
|
|
597 |
|
|
<property name="gjc.dir" |
598 |
|
|
value="${lib.dir}/gjc"/> |
599 |
|
|
|
600 |
|
|
<property name="javac.jar" |
601 |
|
|
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
602 |
|
|
|
603 |
|
|
<property name="collect.jar" |
604 |
tim |
1.37 |
location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/> |
605 |
tim |
1.32 |
|
606 |
|
|
|
607 |
tim |
1.37 |
<condition property="warnunchecked.arg" value="-warnunchecked"> |
608 |
tim |
1.32 |
<istrue value="${gjc.warnunchecked}"/> |
609 |
|
|
</condition> |
610 |
|
|
|
611 |
tim |
1.37 |
<property name="warnunchecked.arg" value=""/> |
612 |
tim |
1.32 |
|
613 |
tim |
1.34 |
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
614 |
tim |
1.35 |
<istrue value="${build.nothreads}"/> |
615 |
tim |
1.34 |
</condition> |
616 |
|
|
|
617 |
tim |
1.32 |
|
618 |
|
|
<!-- |
619 |
|
|
! Bootclasspath munging for source compilation. |
620 |
|
|
--> |
621 |
|
|
|
622 |
tim |
1.37 |
<path id="pre.bootclasspath"> |
623 |
tim |
1.32 |
<pathelement location="${javac.jar}"/> |
624 |
|
|
</path> |
625 |
|
|
|
626 |
tim |
1.37 |
<path id="compile.bootclasspath"> |
627 |
tim |
1.39 |
<pathelement location="${build.classes.dir}"/> |
628 |
tim |
1.32 |
<pathelement location="${collect.jar}"/> |
629 |
|
|
<pathelement location="${rt.jar}"/> |
630 |
|
|
</path> |
631 |
|
|
|
632 |
tim |
1.37 |
<!-- Flatten paths into platform-appropriate strings --> |
633 |
|
|
<property name="pre.bootclasspath" refid="pre.bootclasspath"/> |
634 |
|
|
<property name="compile.bootclasspath" refid="compile.bootclasspath"/> |
635 |
|
|
|
636 |
tim |
1.32 |
|
637 |
|
|
<!-- Common options in javac invocations --> |
638 |
tim |
1.37 |
<property name="gjc.args" |
639 |
|
|
value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}" |
640 |
|
|
/> |
641 |
tim |
1.33 |
|
642 |
|
|
</target> |
643 |
|
|
|
644 |
|
|
|
645 |
|
|
<target name="prepare-src" |
646 |
tim |
1.34 |
depends="configure-compiler" |
647 |
tim |
1.33 |
if="prepare.src.dir"> |
648 |
|
|
|
649 |
|
|
<mkdir dir="${prepare.src.dir}"/> |
650 |
|
|
<copy todir="${prepare.src.dir}"> |
651 |
|
|
<fileset dir="${src.dir}"> |
652 |
|
|
<exclude name="java/lang/**"/> |
653 |
|
|
</fileset> |
654 |
|
|
</copy> |
655 |
tim |
1.32 |
|
656 |
|
|
</target> |
657 |
|
|
|
658 |
|
|
|
659 |
|
|
<target name="configure-emulation"> |
660 |
|
|
|
661 |
|
|
<condition property="build.emulation.true"> |
662 |
|
|
<or> |
663 |
|
|
<and> |
664 |
|
|
<os family="windows"/> |
665 |
|
|
<not> |
666 |
|
|
<isset property="build.emulation"/> |
667 |
|
|
</not> |
668 |
|
|
</and> |
669 |
|
|
<istrue value="${build.emulation}"/> |
670 |
|
|
</or> |
671 |
|
|
</condition> |
672 |
|
|
|
673 |
|
|
</target> |
674 |
|
|
|
675 |
|
|
|
676 |
tim |
1.37 |
<target name="configure-tests" |
677 |
|
|
depends="configure-compiler"> |
678 |
tim |
1.28 |
|
679 |
|
|
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
680 |
tim |
1.18 |
<available property="junit.available" |
681 |
tim |
1.28 |
classname="junit.framework.Protectable"/> |
682 |
|
|
|
683 |
|
|
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
684 |
|
|
unless="junit.available"/> |
685 |
|
|
|
686 |
tim |
1.30 |
|
687 |
tim |
1.32 |
<!-- |
688 |
|
|
! Bootclasspath munging for testing, so JUnit can test our local |
689 |
|
|
! modifications to java.*. |
690 |
|
|
--> |
691 |
|
|
|
692 |
|
|
<path id="test.classpath"> |
693 |
|
|
<pathelement location="${product.jar}"/> |
694 |
|
|
<pathelement location="${build.testcases.dir}"/> |
695 |
|
|
<pathelement location="${junit.jar}"/> |
696 |
|
|
</path> |
697 |
|
|
|
698 |
tim |
1.37 |
<path id="test.compile.bootclasspath"> |
699 |
|
|
<pathelement location="${javac.jar}"/> |
700 |
|
|
<pathelement location="${collect.jar}"/> |
701 |
|
|
<pathelement location="${rt.jar}"/> |
702 |
|
|
</path> |
703 |
|
|
|
704 |
|
|
<path id="test.run.bootclasspath"> |
705 |
|
|
<pathelement location="${javac.jar}"/> |
706 |
|
|
<path refid="test.classpath"/> |
707 |
|
|
</path> |
708 |
tim |
1.32 |
|
709 |
tim |
1.37 |
<!-- Flatten test classpaths into platform-appropriate strings --> |
710 |
|
|
<property name="test.classpath" refid="test.classpath"/> |
711 |
|
|
<property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/> |
712 |
|
|
<property name="test.run.bootclasspath" refid="test.run.bootclasspath"/> |
713 |
tim |
1.30 |
|
714 |
tim |
1.28 |
</target> |
715 |
|
|
|
716 |
|
|
|
717 |
|
|
|
718 |
|
|
<!-- Anthill targets --> |
719 |
|
|
|
720 |
|
|
<target name="anthill-build" |
721 |
|
|
depends="jar, test, docs, dist-docs"/> |
722 |
|
|
|
723 |
|
|
<target name="anthill-publish"> |
724 |
|
|
|
725 |
|
|
<copy todir="${deployDir}/docs/private"> |
726 |
|
|
<fileset dir="${build.javadocs.dir}"/> |
727 |
|
|
</copy> |
728 |
|
|
|
729 |
|
|
<copy todir="${deployDir}/docs/public"> |
730 |
|
|
<fileset dir="${dist.javadocs.dir}"/> |
731 |
|
|
</copy> |
732 |
|
|
|
733 |
|
|
<copy tofile="${deployDir}/index.html" |
734 |
|
|
file="${basedir}/etc/anthill-index.html"/> |
735 |
|
|
|
736 |
|
|
<copy todir="${deployDir}/notes"> |
737 |
|
|
<fileset dir="${basedir}/etc/notes"/> |
738 |
|
|
</copy> |
739 |
|
|
|
740 |
tim |
1.43 |
</target> |
741 |
|
|
|
742 |
|
|
|
743 |
|
|
<target name="ng" depends="test"> |
744 |
|
|
<java classname="SuperfluousAbstract" fork="true"> |
745 |
|
|
|
746 |
|
|
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
747 |
|
|
|
748 |
|
|
</java> |
749 |
tim |
1.1 |
</target> |
750 |
|
|
|
751 |
|
|
|
752 |
|
|
</project> |