7 |
|
Usage: ant [target] |
8 |
|
|
9 |
|
User-specific settings are read from user.properties. |
10 |
< |
See user.properties.sample for examples. |
10 |
> |
See user.properties.sample for an explanation of some useful settings. |
11 |
|
------------------------------------------------------------------------------ |
12 |
|
</description> |
13 |
|
|
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=""/> |
29 |
|
|
30 |
|
<!-- Build locations --> |
31 |
|
<property name="build.dir" location="build"/> |
54 |
|
|
55 |
|
<!-- Jar locations --> |
56 |
|
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
58 |
– |
<property name="javac.jar" location="${lib.dir}/javac.jar"/> |
59 |
– |
<property name="collect.jar" location="${lib.dir}/collect.jar"/> |
57 |
|
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
58 |
|
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
59 |
|
|
60 |
|
|
61 |
|
|
65 |
– |
<!-- |
66 |
– |
! Bootclasspath munging for source compilation. |
67 |
– |
--> |
68 |
– |
|
69 |
– |
<path id="javac.bootclasspath.prefix"> |
70 |
– |
<!-- <pathelement location="${src.dir}"/> --> |
71 |
– |
<pathelement location="${javac.jar}"/> |
72 |
– |
</path> |
73 |
– |
|
74 |
– |
<path id="javac.bootclasspath"> |
75 |
– |
<!-- <pathelement location="${src.dir}"/> --> |
76 |
– |
<pathelement location="${collect.jar}"/> |
77 |
– |
<pathelement location="${rt.jar}"/> |
78 |
– |
</path> |
79 |
– |
|
80 |
– |
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
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="build.bootclasspath.arg" |
86 |
– |
value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
87 |
– |
|
88 |
– |
|
89 |
– |
<!-- |
90 |
– |
! Bootclasspath munging for testing, so JUnit can test our local |
91 |
– |
! modifications to java.*. |
92 |
– |
--> |
93 |
– |
|
94 |
– |
<path id="test.classpath"> |
95 |
– |
<pathelement location="${product.jar}"/> |
96 |
– |
<pathelement location="${build.testcases.dir}"/> |
97 |
– |
<pathelement location="${junit.jar}"/> |
98 |
– |
</path> |
99 |
– |
|
100 |
– |
<!-- Flatten test classpath into a platform-appropriate string --> |
101 |
– |
<property name="test.classpath" refid="test.classpath"/> |
102 |
– |
|
103 |
– |
<!-- Turn the flattened test classpath into a javac argument --> |
104 |
– |
<property name="test.bootclasspath.arg" |
105 |
– |
value='-Xbootclasspath/p:${test.classpath}'/> |
106 |
– |
|
107 |
– |
|
108 |
– |
|
62 |
|
<!-- Files excluded from emulation and dist-docs --> |
63 |
|
<patternset id="emulation.excludes"> |
64 |
|
<exclude name="java/util/Random.*"/> |
70 |
|
<!-- Main targets --> |
71 |
|
|
72 |
|
<target name="compile" |
73 |
< |
depends="init" |
73 |
> |
depends="init, configure-compiler" |
74 |
|
description="Compiles main sources to build folder"> |
75 |
|
|
76 |
|
<mkdir dir="${build.classes.dir}"/> |
92 |
|
|
93 |
|
|
94 |
|
<target name="jar" |
95 |
< |
depends="check-emulation, init-jar, native-jar, emulation-jar" |
95 |
> |
depends="configure-emulation, init-jar, native-jar, emulation-jar" |
96 |
|
description="Builds library jar from compiled sources"/> |
97 |
|
|
98 |
|
|
99 |
|
<target name="test" |
100 |
< |
depends="init, check-junit, report-tests" |
100 |
> |
depends="init, configure-tests, report-tests" |
101 |
|
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
102 |
|
|
103 |
|
|
157 |
|
|
158 |
|
|
159 |
|
<target name="strip" |
160 |
< |
depends="init" |
160 |
> |
depends="init, configure-compiler" |
161 |
|
description="Strip generics from java source (not working yet)"> |
162 |
|
|
163 |
|
<mkdir dir="${build.stripped.dir}"/> |
228 |
|
|
229 |
|
<!-- Internal targets --> |
230 |
|
|
278 |
– |
<target name="set-warnings-if" if="build.warnings"> |
279 |
– |
|
280 |
– |
<property name="build.warnings.arg" value="-warnunchecked"/> |
281 |
– |
|
282 |
– |
</target> |
283 |
– |
|
231 |
|
|
232 |
< |
<target name="set-warnings-unless" unless="build.warnings"> |
286 |
< |
|
287 |
< |
<property name="build.warnings.arg" value=""/> |
288 |
< |
|
289 |
< |
</target> |
290 |
< |
|
291 |
< |
|
292 |
< |
<target name="init" |
293 |
< |
depends="set-warnings-if, set-warnings-unless"> |
232 |
> |
<target name="init"> |
233 |
|
|
234 |
|
<!-- Version is kept in a separate file --> |
235 |
|
<loadfile property="version" srcFile="version.properties"/> |
236 |
|
<echo>Building JSR-166 version ${version}</echo> |
237 |
|
|
299 |
– |
<!-- Common options in javac invocations --> |
300 |
– |
<property name="build.javac.args" |
301 |
– |
value="${build.bootclasspath.arg} ${build.warnings.arg} ${build.novariance.arg}"/> |
302 |
– |
|
238 |
|
</target> |
239 |
|
|
240 |
|
|
257 |
|
|
258 |
|
|
259 |
|
<target name="compile-emulation" |
260 |
< |
depends="init" |
260 |
> |
depends="init, configure-compiler" |
261 |
|
if="build.emulation.true"> |
262 |
|
|
263 |
|
<mkdir dir="${build.emulation.dir}"/> |
444 |
|
</target> |
445 |
|
|
446 |
|
|
447 |
< |
<target name="check-junit"> |
447 |
> |
<target name="configure-compiler"> |
448 |
|
|
449 |
< |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
450 |
< |
<available property="junit.available" |
516 |
< |
classname="junit.framework.Protectable"/> |
449 |
> |
<property name="gjc.version" |
450 |
> |
value="1.3"/> |
451 |
|
|
452 |
< |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
453 |
< |
unless="junit.available"/> |
452 |
> |
<condition property="build.novariance" value="-novariance"> |
453 |
> |
<and> |
454 |
> |
<equals arg1="${gjc.version}" arg2="2.0"/> |
455 |
> |
<or> |
456 |
> |
<not><isset property="gjc.novariance"/></not> |
457 |
> |
<istrue value="${gjc.novariance}"/> |
458 |
> |
</or> |
459 |
> |
</and> |
460 |
> |
</condition> |
461 |
> |
|
462 |
> |
<property name="build.novariance" |
463 |
> |
value=""/> |
464 |
> |
|
465 |
> |
<property name="gjc.dir" |
466 |
> |
value="${lib.dir}/gjc"/> |
467 |
> |
|
468 |
> |
<property name="javac.jar" |
469 |
> |
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
470 |
> |
|
471 |
> |
<property name="collect.jar" |
472 |
> |
location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/> |
473 |
> |
|
474 |
> |
|
475 |
> |
<condition property="build.warnunchecked" value="-warnunchecked"> |
476 |
> |
<istrue value="${gjc.warnunchecked}"/> |
477 |
> |
</condition> |
478 |
> |
|
479 |
> |
<property name="build.warnunchecked" value=""/> |
480 |
> |
|
481 |
> |
|
482 |
> |
<!-- |
483 |
> |
! Bootclasspath munging for source compilation. |
484 |
> |
--> |
485 |
> |
|
486 |
> |
<path id="javac.bootclasspath.prefix"> |
487 |
> |
<!-- <pathelement location="${src.dir}"/> --> |
488 |
> |
<pathelement location="${javac.jar}"/> |
489 |
> |
</path> |
490 |
> |
|
491 |
> |
<path id="javac.bootclasspath"> |
492 |
> |
<!-- <pathelement location="${src.dir}"/> --> |
493 |
> |
<pathelement location="${collect.jar}"/> |
494 |
> |
<pathelement location="${rt.jar}"/> |
495 |
> |
</path> |
496 |
> |
|
497 |
> |
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
498 |
> |
<property name="javac.bootclasspath.prefix" |
499 |
> |
refid="javac.bootclasspath.prefix"/> |
500 |
> |
|
501 |
> |
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
502 |
> |
<property name="build.bootclasspath.arg" |
503 |
> |
value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
504 |
> |
|
505 |
> |
<!-- Flatten bootclasspath for trace message --> |
506 |
> |
<property name="javac.bootclasspath" |
507 |
> |
refid="javac.bootclasspath"/> |
508 |
> |
|
509 |
> |
<!-- Common options in javac invocations --> |
510 |
> |
<property name="build.javac.args" |
511 |
> |
value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/> |
512 |
> |
|
513 |
> |
<echo>javac ${build.javac.args} |
514 |
> |
bootclasspath is ${javac.bootclasspath}</echo> |
515 |
|
|
516 |
|
</target> |
517 |
|
|
518 |
|
|
519 |
< |
<target name="check-emulation"> |
519 |
> |
<target name="configure-emulation"> |
520 |
> |
|
521 |
|
<condition property="build.emulation.true"> |
522 |
|
<or> |
523 |
< |
<isset property="build.emulation"/> |
524 |
< |
<os family="windows"/> |
523 |
> |
<and> |
524 |
> |
<os family="windows"/> |
525 |
> |
<not> |
526 |
> |
<isset property="build.emulation"/> |
527 |
> |
</not> |
528 |
> |
</and> |
529 |
> |
<istrue value="${build.emulation}"/> |
530 |
|
</or> |
531 |
|
</condition> |
532 |
+ |
|
533 |
+ |
</target> |
534 |
+ |
|
535 |
+ |
|
536 |
+ |
<target name="configure-tests"> |
537 |
+ |
|
538 |
+ |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
539 |
+ |
<available property="junit.available" |
540 |
+ |
classname="junit.framework.Protectable"/> |
541 |
+ |
|
542 |
+ |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
543 |
+ |
unless="junit.available"/> |
544 |
+ |
|
545 |
+ |
|
546 |
+ |
<!-- |
547 |
+ |
! Bootclasspath munging for testing, so JUnit can test our local |
548 |
+ |
! modifications to java.*. |
549 |
+ |
--> |
550 |
+ |
|
551 |
+ |
<path id="test.classpath"> |
552 |
+ |
<pathelement location="${product.jar}"/> |
553 |
+ |
<pathelement location="${build.testcases.dir}"/> |
554 |
+ |
<pathelement location="${junit.jar}"/> |
555 |
+ |
</path> |
556 |
+ |
|
557 |
+ |
<!-- Flatten test classpath into a platform-appropriate string --> |
558 |
+ |
<property name="test.classpath" refid="test.classpath"/> |
559 |
+ |
|
560 |
+ |
<!-- Turn the flattened test classpath into a javac argument --> |
561 |
+ |
<property name="test.bootclasspath.arg" |
562 |
+ |
value='-Xbootclasspath/p:${test.classpath}'/> |
563 |
+ |
|
564 |
|
</target> |
565 |
|
|
566 |
|
|