1 |
|
<project name="jsr166" default="usage"> |
2 |
|
|
3 |
|
<description> |
4 |
< |
Build file for JSR-166 |
4 |
> |
------------------------------------------------------------------------------ |
5 |
> |
Build file for JSR-166 |
6 |
|
|
7 |
< |
JUnit 3.8 or better must be in ${ant.home}/lib for the test target to work. |
7 |
< |
</description> |
7 |
> |
Usage: ant [target] |
8 |
|
|
9 |
+ |
User-specific settings are read from user.properties. |
10 |
+ |
See user.properties.sample for examples. |
11 |
+ |
------------------------------------------------------------------------------ |
12 |
+ |
</description> |
13 |
|
|
14 |
< |
<target name="usage" description="Prints this message"> |
15 |
< |
<echo> |
12 |
< |
ant [target], where target is one of: |
13 |
< |
|
14 |
< |
usage (default) Prints this message |
15 |
< |
compile Compiles all sources to build folder |
16 |
< |
jar Builds library jar from compiled sources |
17 |
< |
test Runs all tests (requires JUnit 1.8 in ${ant.home}/lib) |
18 |
< |
docs Builds javadocs with custom tags to build folder |
19 |
< |
dist-docs Builds javadocs without custom tags to dist folder |
20 |
< |
dist Puts all distributable products in single hierarchy |
21 |
< |
|
22 |
< |
clean Removes all build products |
23 |
< |
dist-clean Removes all build and distribution products |
24 |
< |
|
25 |
< |
checkstyle Reports on style errors in Java source (verbose, mostly chaff) |
26 |
< |
doccheck Reports on javadoc style errors (not working yet) |
27 |
< |
</echo> |
14 |
> |
<target name="usage" description="Advises user to run with -projecthelp"> |
15 |
> |
<echo>Run "ant -projecthelp" for full usage information.</echo> |
16 |
|
</target> |
17 |
|
|
18 |
+ |
|
19 |
|
<!-- User-specific settings --> |
20 |
|
<property file="user.properties"/> |
21 |
|
|
33 |
– |
<!-- Set build.warnings in user.properties to turn on -warnunchecked --> |
34 |
– |
<!-- <property name="build.warnings" value=""/> --> |
35 |
– |
|
22 |
|
|
23 |
|
<!-- Compilation options --> |
24 |
|
<property name="build.sourcelevel" value="1.5"/> |
26 |
|
<property name="build.debug" value="true"/> |
27 |
|
<property name="build.debuglevel" value="source,lines,vars"/> |
28 |
|
<property name="build.deprecation" value="false"/> |
29 |
+ |
<property name="build.novariance.arg" value=""/> |
30 |
|
|
31 |
|
<!-- Build locations --> |
32 |
|
<property name="build.dir" location="build"/> |
78 |
|
</path> |
79 |
|
|
80 |
|
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
81 |
< |
<property name="javac.bootclasspath.prefix" refid="javac.bootclasspath.prefix"/> |
81 |
> |
<property name="javac.bootclasspath.prefix" |
82 |
> |
refid="javac.bootclasspath.prefix"/> |
83 |
|
|
84 |
|
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
85 |
< |
<property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
86 |
< |
|
85 |
> |
<property name="build.bootclasspath.arg" |
86 |
> |
value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
87 |
|
|
88 |
|
|
89 |
|
<!-- |
101 |
|
<property name="test.classpath" refid="test.classpath"/> |
102 |
|
|
103 |
|
<!-- Turn the flattened test classpath into a javac argument --> |
104 |
< |
<property name="test.javac.args" value='-Xbootclasspath/p:${test.classpath}'/> |
104 |
> |
<property name="test.bootclasspath.arg" |
105 |
> |
value='-Xbootclasspath/p:${test.classpath}'/> |
106 |
|
|
107 |
|
|
108 |
|
|
131 |
|
fork="true"> |
132 |
|
|
133 |
|
<bootclasspath refid="javac.bootclasspath"/> |
134 |
< |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
134 |
> |
<compilerarg line="${build.javac.args}"/> |
135 |
|
|
136 |
|
</javac> |
137 |
|
|
139 |
|
|
140 |
|
|
141 |
|
<target name="jar" |
142 |
< |
depends="native-jar, emulation-jar" |
142 |
> |
depends="check-emulation, init-jar, native-jar, emulation-jar" |
143 |
|
description="Builds library jar from compiled sources"/> |
144 |
|
|
145 |
|
|
146 |
|
<target name="test" |
147 |
|
depends="init, check-junit, report-tests" |
148 |
< |
description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)" /> |
148 |
> |
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
149 |
|
|
150 |
|
|
151 |
|
<target name="checkstyle" |
192 |
|
source="${build.docsourcelevel}"> |
193 |
|
|
194 |
|
<tag name="revised" description="Last revised:"/> |
195 |
< |
<tag name="spec" description="Specified by:"/> |
196 |
< |
<tag name="editor" description="Last edited by:"/> |
197 |
< |
<tag name="fixme" description="FIX ME:"/> |
195 |
> |
<tag name="spec" description="Specified by:"/> |
196 |
> |
<tag name="editor" description="Last edited by:"/> |
197 |
> |
<tag name="fixme" description="FIX ME:"/> |
198 |
> |
|
199 |
|
<packageset dir="${build.filter.src.dir}"/> |
200 |
|
|
201 |
|
</javadoc> |
203 |
|
</target> |
204 |
|
|
205 |
|
|
216 |
– |
<!-- |
217 |
– |
# javac -s doesn't reliably generate compilable code. It generates |
218 |
– |
# bridge methods (marked as "synthetic") that can have identical |
219 |
– |
# signatures to existing methods except for the return value. |
220 |
– |
--> |
206 |
|
<target name="strip" |
207 |
< |
depends="init"> |
207 |
> |
depends="init" |
208 |
> |
description="Strip generics from java source (not working yet)"> |
209 |
|
|
210 |
|
<mkdir dir="${build.stripped.dir}"/> |
211 |
|
|
212 |
+ |
<!-- |
213 |
+ |
# javac -s doesn't reliably generate compilable code. It generates |
214 |
+ |
# bridge methods (marked as "synthetic") that can have identical |
215 |
+ |
# signatures to existing methods except for the return value. |
216 |
+ |
--> |
217 |
|
<javac srcdir="${src.dir}" |
218 |
|
destdir="${build.stripped.dir}" |
219 |
|
debug="${build.debug}" |
223 |
|
fork="true"> |
224 |
|
|
225 |
|
<bootclasspath refid="javac.bootclasspath"/> |
226 |
< |
<compilerarg line="${javac.args} ${build.warnings.option} -s"/> |
226 |
> |
<compilerarg line="${build.javac.args} -s"/> |
227 |
|
|
228 |
|
</javac> |
229 |
|
|
277 |
|
|
278 |
|
<target name="set-warnings-if" if="build.warnings"> |
279 |
|
|
280 |
< |
<property name="build.warnings.option" value="-warnunchecked"/> |
280 |
> |
<property name="build.warnings.arg" value="-warnunchecked"/> |
281 |
|
|
282 |
|
</target> |
283 |
|
|
284 |
|
|
285 |
|
<target name="set-warnings-unless" unless="build.warnings"> |
286 |
|
|
287 |
< |
<property name="build.warnings.option" value=""/> |
287 |
> |
<property name="build.warnings.arg" value=""/> |
288 |
|
|
289 |
|
</target> |
290 |
|
|
296 |
|
<loadfile property="version" srcFile="version.properties"/> |
297 |
|
<echo>Building JSR-166 version ${version}</echo> |
298 |
|
|
299 |
+ |
<!-- Common options in javac invocations --> |
300 |
+ |
<property name="build.javac.args" |
301 |
+ |
value="${build.bootclasspath.arg} ${build.warnings.arg} ${build.novariance.arg}"/> |
302 |
+ |
|
303 |
|
</target> |
304 |
|
|
305 |
|
|
311 |
|
|
312 |
|
|
313 |
|
<target name="native-jar" |
314 |
< |
depends="compile, init-jar" |
315 |
< |
unless="build.emulation"> |
314 |
> |
depends="compile" |
315 |
> |
unless="build.emulation.true"> |
316 |
|
|
317 |
|
<jar destfile="${product.jar}"> |
318 |
|
<fileset dir="${build.classes.dir}"/> |
321 |
|
</target> |
322 |
|
|
323 |
|
|
329 |
– |
<target name="base-jar" |
330 |
– |
depends="compile, init-jar"> |
331 |
– |
|
332 |
– |
<jar destfile="${product.jar}"> |
333 |
– |
<fileset dir="${build.classes.dir}"> |
334 |
– |
<patternset refid="emulation.excludes"/> |
335 |
– |
</fileset> |
336 |
– |
</jar> |
337 |
– |
|
338 |
– |
</target> |
339 |
– |
|
340 |
– |
|
324 |
|
<target name="compile-emulation" |
325 |
|
depends="init" |
326 |
< |
if="build.emulation"> |
326 |
> |
if="build.emulation.true"> |
327 |
|
|
328 |
|
<mkdir dir="${build.emulation.dir}"/> |
329 |
|
|
336 |
|
fork="true"> |
337 |
|
|
338 |
|
<bootclasspath refid="javac.bootclasspath"/> |
339 |
< |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
339 |
> |
<compilerarg line="${build.javac.args}"/> |
340 |
|
|
341 |
|
</javac> |
342 |
|
|
344 |
|
|
345 |
|
|
346 |
|
<target name="emulation-jar" |
347 |
< |
depends="base-jar, compile-emulation" |
348 |
< |
if="build.emulation"> |
347 |
> |
depends="compile-emulation" |
348 |
> |
if="build.emulation.true"> |
349 |
|
|
350 |
< |
<jar destfile="${product.jar}" update="true" duplicate="add"> |
350 |
> |
|
351 |
> |
<jar destfile="${product.jar}" duplicate="add"> |
352 |
> |
<fileset dir="${build.classes.dir}"> |
353 |
> |
<patternset refid="emulation.excludes"/> |
354 |
> |
</fileset> |
355 |
|
<fileset dir="${build.emulation.dir}"/> |
356 |
|
</jar> |
357 |
|
|
386 |
|
|
387 |
|
<copy todir="${build.filter.src.dir}"> |
388 |
|
<fileset dir="${src.dir}"> |
389 |
+ |
<include name="**/*.html"/> |
390 |
+ |
</fileset> |
391 |
+ |
</copy> |
392 |
+ |
|
393 |
+ |
<copy todir="${build.filter.src.dir}"> |
394 |
+ |
<fileset dir="${src.dir}"> |
395 |
+ |
<exclude name="**/*.html"/> |
396 |
|
<patternset refid="emulation.excludes"/> |
397 |
|
</fileset> |
398 |
|
<filterchain> |
444 |
|
source="${build.sourcelevel}" |
445 |
|
fork="true"> |
446 |
|
|
453 |
– |
<bootclasspath refid="javac.bootclasspath"/> |
454 |
– |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
447 |
|
<classpath refid="test.classpath"/> |
448 |
+ |
<bootclasspath refid="javac.bootclasspath"/> |
449 |
+ |
<compilerarg line="${build.javac.args}"/> |
450 |
|
|
451 |
|
</javac> |
452 |
|
|
468 |
|
dir="${build.reports.dir}" |
469 |
|
fork="true"> |
470 |
|
|
471 |
< |
<jvmarg value="${test.javac.args}"/> |
471 |
> |
<jvmarg value="${test.bootclasspath.arg}"/> |
472 |
|
|
473 |
|
<formatter type="xml"/> |
474 |
|
|
521 |
|
</target> |
522 |
|
|
523 |
|
|
524 |
+ |
<target name="check-emulation"> |
525 |
+ |
<condition property="build.emulation.true"> |
526 |
+ |
<or> |
527 |
+ |
<isset property="build.emulation"/> |
528 |
+ |
<os family="windows"/> |
529 |
+ |
</or> |
530 |
+ |
</condition> |
531 |
+ |
</target> |
532 |
+ |
|
533 |
+ |
|
534 |
|
|
535 |
|
<!-- Anthill targets --> |
536 |
|
|