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, prepare-src" |
74 |
|
description="Compiles main sources to build folder"> |
75 |
|
|
76 |
+ |
<property name="prepare.src.dir" value="${src.dir}"/> |
77 |
+ |
|
78 |
|
<mkdir dir="${build.classes.dir}"/> |
79 |
|
|
80 |
< |
<javac srcdir="${src.dir}" |
80 |
> |
<javac srcdir="${prepare.src.dir}" |
81 |
|
destdir="${build.classes.dir}" |
82 |
|
debug="${build.debug}" |
83 |
|
debuglevel="${build.debuglevel}" |
94 |
|
|
95 |
|
|
96 |
|
<target name="jar" |
97 |
< |
depends="check-emulation, init-jar, native-jar, emulation-jar" |
97 |
> |
depends="configure-emulation, init-jar, native-jar, emulation-jar" |
98 |
|
description="Builds library jar from compiled sources"/> |
99 |
|
|
100 |
|
|
101 |
|
<target name="test" |
102 |
< |
depends="init, check-junit, report-tests" |
102 |
> |
depends="init, configure-tests, report-tests" |
103 |
|
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
104 |
|
|
105 |
|
|
159 |
|
|
160 |
|
|
161 |
|
<target name="strip" |
162 |
< |
depends="init" |
162 |
> |
depends="init, configure-compiler" |
163 |
|
description="Strip generics from java source (not working yet)"> |
164 |
|
|
165 |
|
<mkdir dir="${build.stripped.dir}"/> |
230 |
|
|
231 |
|
<!-- Internal targets --> |
232 |
|
|
278 |
– |
<target name="set-warnings-if" if="build.warnings"> |
279 |
– |
|
280 |
– |
<property name="build.warnings.arg" value="-warnunchecked"/> |
281 |
– |
|
282 |
– |
</target> |
283 |
– |
|
233 |
|
|
234 |
< |
<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"> |
234 |
> |
<target name="init"> |
235 |
|
|
236 |
|
<!-- Version is kept in a separate file --> |
237 |
|
<loadfile property="version" srcFile="version.properties"/> |
238 |
|
<echo>Building JSR-166 version ${version}</echo> |
239 |
|
|
299 |
– |
<!-- Common options in javac invocations --> |
300 |
– |
<property name="build.javac.args" |
301 |
– |
value="${build.bootclasspath.arg} ${build.warnings.arg} ${build.novariance.arg}"/> |
302 |
– |
|
240 |
|
</target> |
241 |
|
|
242 |
|
|
259 |
|
|
260 |
|
|
261 |
|
<target name="compile-emulation" |
262 |
< |
depends="init" |
262 |
> |
depends="init, configure-compiler" |
263 |
|
if="build.emulation.true"> |
264 |
|
|
265 |
|
<mkdir dir="${build.emulation.dir}"/> |
446 |
|
</target> |
447 |
|
|
448 |
|
|
449 |
< |
<target name="check-junit"> |
449 |
> |
<target name="configure-compiler"> |
450 |
|
|
451 |
< |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
452 |
< |
<available property="junit.available" |
453 |
< |
classname="junit.framework.Protectable"/> |
451 |
> |
<property name="gjc.version" |
452 |
> |
value="2.0"/> |
453 |
> |
|
454 |
> |
<condition property="build.novariance" value="-novariance"> |
455 |
> |
<and> |
456 |
> |
<equals arg1="${gjc.version}" arg2="2.0"/> |
457 |
> |
<or> |
458 |
> |
<not><isset property="gjc.novariance"/></not> |
459 |
> |
<istrue value="${gjc.novariance}"/> |
460 |
> |
</or> |
461 |
> |
</and> |
462 |
> |
</condition> |
463 |
> |
|
464 |
> |
<property name="build.novariance" |
465 |
> |
value=""/> |
466 |
> |
|
467 |
> |
<property name="gjc.dir" |
468 |
> |
value="${lib.dir}/gjc"/> |
469 |
> |
|
470 |
> |
<property name="javac.jar" |
471 |
> |
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
472 |
> |
|
473 |
> |
<property name="collect.jar" |
474 |
> |
location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/> |
475 |
> |
|
476 |
> |
|
477 |
> |
<condition property="build.warnunchecked" value="-warnunchecked"> |
478 |
> |
<istrue value="${gjc.warnunchecked}"/> |
479 |
> |
</condition> |
480 |
> |
|
481 |
> |
<property name="build.warnunchecked" value=""/> |
482 |
> |
|
483 |
> |
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
484 |
> |
<istrue value="${build.nothreads}"/> |
485 |
> |
</condition> |
486 |
|
|
487 |
< |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
488 |
< |
unless="junit.available"/> |
487 |
> |
|
488 |
> |
<!-- |
489 |
> |
! Bootclasspath munging for source compilation. |
490 |
> |
--> |
491 |
> |
|
492 |
> |
<path id="javac.bootclasspath.prefix"> |
493 |
> |
<!-- <pathelement location="${src.dir}"/> --> |
494 |
> |
<pathelement location="${javac.jar}"/> |
495 |
> |
</path> |
496 |
> |
|
497 |
> |
<path id="javac.bootclasspath"> |
498 |
> |
<!-- <pathelement location="${src.dir}"/> --> |
499 |
> |
<pathelement location="${collect.jar}"/> |
500 |
> |
<pathelement location="${rt.jar}"/> |
501 |
> |
</path> |
502 |
> |
|
503 |
> |
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
504 |
> |
<property name="javac.bootclasspath.prefix" |
505 |
> |
refid="javac.bootclasspath.prefix"/> |
506 |
> |
|
507 |
> |
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
508 |
> |
<property name="build.bootclasspath.arg" |
509 |
> |
value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
510 |
> |
|
511 |
> |
<!-- Flatten bootclasspath for trace message --> |
512 |
> |
<property name="javac.bootclasspath" |
513 |
> |
refid="javac.bootclasspath"/> |
514 |
> |
|
515 |
> |
<!-- Common options in javac invocations --> |
516 |
> |
<property name="build.javac.args" |
517 |
> |
value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/> |
518 |
> |
|
519 |
> |
<echo>javac ${build.javac.args}</echo> |
520 |
> |
<echo>bootclasspath=${javac.bootclasspath}</echo> |
521 |
|
|
522 |
|
</target> |
523 |
|
|
524 |
|
|
525 |
< |
<target name="check-emulation"> |
525 |
> |
<target name="prepare-src" |
526 |
> |
depends="configure-compiler" |
527 |
> |
if="prepare.src.dir"> |
528 |
> |
|
529 |
> |
<mkdir dir="${prepare.src.dir}"/> |
530 |
> |
<copy todir="${prepare.src.dir}"> |
531 |
> |
<fileset dir="${src.dir}"> |
532 |
> |
<exclude name="java/lang/**"/> |
533 |
> |
</fileset> |
534 |
> |
</copy> |
535 |
> |
|
536 |
> |
</target> |
537 |
> |
|
538 |
> |
|
539 |
> |
<target name="configure-emulation"> |
540 |
> |
|
541 |
|
<condition property="build.emulation.true"> |
542 |
|
<or> |
543 |
< |
<isset property="build.emulation"/> |
544 |
< |
<os family="windows"/> |
543 |
> |
<and> |
544 |
> |
<os family="windows"/> |
545 |
> |
<not> |
546 |
> |
<isset property="build.emulation"/> |
547 |
> |
</not> |
548 |
> |
</and> |
549 |
> |
<istrue value="${build.emulation}"/> |
550 |
|
</or> |
551 |
|
</condition> |
552 |
+ |
|
553 |
+ |
</target> |
554 |
+ |
|
555 |
+ |
|
556 |
+ |
<target name="configure-tests"> |
557 |
+ |
|
558 |
+ |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
559 |
+ |
<available property="junit.available" |
560 |
+ |
classname="junit.framework.Protectable"/> |
561 |
+ |
|
562 |
+ |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
563 |
+ |
unless="junit.available"/> |
564 |
+ |
|
565 |
+ |
|
566 |
+ |
<!-- |
567 |
+ |
! Bootclasspath munging for testing, so JUnit can test our local |
568 |
+ |
! modifications to java.*. |
569 |
+ |
--> |
570 |
+ |
|
571 |
+ |
<path id="test.classpath"> |
572 |
+ |
<pathelement location="${product.jar}"/> |
573 |
+ |
<pathelement location="${build.testcases.dir}"/> |
574 |
+ |
<pathelement location="${junit.jar}"/> |
575 |
+ |
</path> |
576 |
+ |
|
577 |
+ |
<!-- Flatten test classpath into a platform-appropriate string --> |
578 |
+ |
<property name="test.classpath" refid="test.classpath"/> |
579 |
+ |
|
580 |
+ |
<!-- Turn the flattened test classpath into a javac argument --> |
581 |
+ |
<property name="test.bootclasspath.arg" |
582 |
+ |
value='-Xbootclasspath/p:${test.classpath}'/> |
583 |
+ |
|
584 |
|
</target> |
585 |
|
|
586 |
|
|