7 |
Usage: ant [target] |
Usage: ant [target] |
8 |
|
|
9 |
User-specific settings are read from user.properties. |
User-specific settings are read from user.properties. |
10 |
See user.properties.sample for examples. |
See user.properties.sample for an explanation of some useful settings. |
11 |
------------------------------------------------------------------------------ |
------------------------------------------------------------------------------ |
12 |
</description> |
</description> |
13 |
|
|
26 |
<property name="build.debug" value="true"/> |
<property name="build.debug" value="true"/> |
27 |
<property name="build.debuglevel" value="source,lines,vars"/> |
<property name="build.debuglevel" value="source,lines,vars"/> |
28 |
<property name="build.deprecation" value="false"/> |
<property name="build.deprecation" value="false"/> |
|
<property name="build.novariance.arg" value=""/> |
|
29 |
|
|
30 |
<!-- Build locations --> |
<!-- Build locations --> |
31 |
<property name="build.dir" location="build"/> |
<property name="build.dir" location="build"/> |
54 |
|
|
55 |
<!-- Jar locations --> |
<!-- Jar locations --> |
56 |
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
|
<property name="javac.jar" location="${lib.dir}/javac.jar"/> |
|
|
<property name="collect.jar" location="${lib.dir}/collect.jar"/> |
|
57 |
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
58 |
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
59 |
|
|
60 |
|
|
61 |
|
|
|
<!-- |
|
|
! Bootclasspath munging for source compilation. |
|
|
--> |
|
|
|
|
|
<path id="javac.bootclasspath.prefix"> |
|
|
<!-- <pathelement location="${src.dir}"/> --> |
|
|
<pathelement location="${javac.jar}"/> |
|
|
</path> |
|
|
|
|
|
<path id="javac.bootclasspath"> |
|
|
<!-- <pathelement location="${src.dir}"/> --> |
|
|
<pathelement location="${collect.jar}"/> |
|
|
<pathelement location="${rt.jar}"/> |
|
|
</path> |
|
|
|
|
|
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
|
|
<property name="javac.bootclasspath.prefix" |
|
|
refid="javac.bootclasspath.prefix"/> |
|
|
|
|
|
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
|
|
<property name="build.bootclasspath.arg" |
|
|
value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
|
|
|
|
|
|
|
|
<!-- |
|
|
! Bootclasspath munging for testing, so JUnit can test our local |
|
|
! modifications to java.*. |
|
|
--> |
|
|
|
|
|
<path id="test.classpath"> |
|
|
<pathelement location="${product.jar}"/> |
|
|
<pathelement location="${build.testcases.dir}"/> |
|
|
<pathelement location="${junit.jar}"/> |
|
|
</path> |
|
|
|
|
|
<!-- Flatten test classpath into a platform-appropriate string --> |
|
|
<property name="test.classpath" refid="test.classpath"/> |
|
|
|
|
|
<!-- Turn the flattened test classpath into a javac argument --> |
|
|
<property name="test.bootclasspath.arg" |
|
|
value='-Xbootclasspath/p:${test.classpath}'/> |
|
|
|
|
|
|
|
|
|
|
62 |
<!-- Files excluded from emulation and dist-docs --> |
<!-- Files excluded from emulation and dist-docs --> |
63 |
<patternset id="emulation.excludes"> |
<patternset id="emulation.excludes"> |
64 |
<exclude name="java/util/Random.*"/> |
<exclude name="java/util/Random.*"/> |
70 |
<!-- Main targets --> |
<!-- Main targets --> |
71 |
|
|
72 |
<target name="compile" |
<target name="compile" |
73 |
depends="init" |
depends="init, configure-compiler, prepare-src" |
74 |
description="Compiles main sources to build folder"> |
description="Compiles main sources to build folder"> |
75 |
|
|
76 |
|
<property name="prepare.src.dir" value="${src.dir}"/> |
77 |
|
|
78 |
<mkdir dir="${build.classes.dir}"/> |
<mkdir dir="${build.classes.dir}"/> |
79 |
|
|
80 |
<javac srcdir="${src.dir}" |
<javac srcdir="${prepare.src.dir}" |
81 |
destdir="${build.classes.dir}" |
destdir="${build.classes.dir}" |
82 |
debug="${build.debug}" |
debug="${build.debug}" |
83 |
debuglevel="${build.debuglevel}" |
debuglevel="${build.debuglevel}" |
94 |
|
|
95 |
|
|
96 |
<target name="jar" |
<target name="jar" |
97 |
depends="check-emulation, init-jar, native-jar, emulation-jar" |
depends="configure-emulation, init-jar, native-jar, emulation-jar" |
98 |
description="Builds library jar from compiled sources"/> |
description="Builds library jar from compiled sources"/> |
99 |
|
|
100 |
|
|
101 |
<target name="test" |
<target name="test" |
102 |
depends="init, check-junit, report-tests" |
depends="init, configure-tests, report-tests" |
103 |
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
104 |
|
|
105 |
|
|
159 |
|
|
160 |
|
|
161 |
<target name="strip" |
<target name="strip" |
162 |
depends="init" |
depends="init, configure-compiler" |
163 |
description="Strip generics from java source (not working yet)"> |
description="Strip generics from java source (not working yet)"> |
164 |
|
|
165 |
<mkdir dir="${build.stripped.dir}"/> |
<mkdir dir="${build.stripped.dir}"/> |
230 |
|
|
231 |
<!-- Internal targets --> |
<!-- Internal targets --> |
232 |
|
|
|
<target name="set-warnings-if" if="build.warnings"> |
|
|
|
|
|
<property name="build.warnings.arg" value="-warnunchecked"/> |
|
|
|
|
|
</target> |
|
|
|
|
233 |
|
|
234 |
<target name="set-warnings-unless" unless="build.warnings"> |
<target name="init"> |
|
|
|
|
<property name="build.warnings.arg" value=""/> |
|
|
|
|
|
</target> |
|
|
|
|
|
|
|
|
<target name="init" |
|
|
depends="set-warnings-if, set-warnings-unless"> |
|
235 |
|
|
236 |
<!-- Version is kept in a separate file --> |
<!-- Version is kept in a separate file --> |
237 |
<loadfile property="version" srcFile="version.properties"/> |
<loadfile property="version" srcFile="version.properties"/> |
238 |
<echo>Building JSR-166 version ${version}</echo> |
<echo>Building JSR-166 version ${version}</echo> |
239 |
|
|
|
<!-- Common options in javac invocations --> |
|
|
<property name="build.javac.args" |
|
|
value="${build.bootclasspath.arg} ${build.warnings.arg} ${build.novariance.arg}"/> |
|
|
|
|
240 |
</target> |
</target> |
241 |
|
|
242 |
|
|
259 |
|
|
260 |
|
|
261 |
<target name="compile-emulation" |
<target name="compile-emulation" |
262 |
depends="init" |
depends="init, configure-compiler" |
263 |
if="build.emulation.true"> |
if="build.emulation.true"> |
264 |
|
|
265 |
<mkdir dir="${build.emulation.dir}"/> |
<mkdir dir="${build.emulation.dir}"/> |
446 |
</target> |
</target> |
447 |
|
|
448 |
|
|
449 |
<target name="check-junit"> |
<target name="configure-compiler"> |
450 |
|
|
451 |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
<property name="gjc.version" |
452 |
<available property="junit.available" |
value="2.0"/> |
|
classname="junit.framework.Protectable"/> |
|
453 |
|
|
454 |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
<condition property="build.novariance" value="-novariance"> |
455 |
unless="junit.available"/> |
<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 |
|
<or> |
485 |
|
<and> |
486 |
|
<not><isset property="build.nothreads"/></not> |
487 |
|
<equals arg1="${gjc.version}" arg2="2.0"/> |
488 |
|
</and> |
489 |
|
<istrue value="${build.nothreads}"/> |
490 |
|
</or> |
491 |
|
</condition> |
492 |
|
|
493 |
|
|
494 |
|
<!-- |
495 |
|
! Bootclasspath munging for source compilation. |
496 |
|
--> |
497 |
|
|
498 |
|
<path id="javac.bootclasspath.prefix"> |
499 |
|
<!-- <pathelement location="${src.dir}"/> --> |
500 |
|
<pathelement location="${javac.jar}"/> |
501 |
|
</path> |
502 |
|
|
503 |
|
<path id="javac.bootclasspath"> |
504 |
|
<!-- <pathelement location="${src.dir}"/> --> |
505 |
|
<pathelement location="${collect.jar}"/> |
506 |
|
<pathelement location="${rt.jar}"/> |
507 |
|
</path> |
508 |
|
|
509 |
|
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
510 |
|
<property name="javac.bootclasspath.prefix" |
511 |
|
refid="javac.bootclasspath.prefix"/> |
512 |
|
|
513 |
|
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
514 |
|
<property name="build.bootclasspath.arg" |
515 |
|
value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
516 |
|
|
517 |
|
<!-- Flatten bootclasspath for trace message --> |
518 |
|
<property name="javac.bootclasspath" |
519 |
|
refid="javac.bootclasspath"/> |
520 |
|
|
521 |
|
<!-- Common options in javac invocations --> |
522 |
|
<property name="build.javac.args" |
523 |
|
value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/> |
524 |
|
|
525 |
|
<echo>javac ${build.javac.args}</echo> |
526 |
|
<echo>bootclasspath=${javac.bootclasspath}</echo> |
527 |
|
|
528 |
</target> |
</target> |
529 |
|
|
530 |
|
|
531 |
<target name="check-emulation"> |
<target name="prepare-src" |
532 |
|
depends="configure-compiler" |
533 |
|
if="prepare.src.dir"> |
534 |
|
|
535 |
|
<mkdir dir="${prepare.src.dir}"/> |
536 |
|
<copy todir="${prepare.src.dir}"> |
537 |
|
<fileset dir="${src.dir}"> |
538 |
|
<exclude name="java/lang/**"/> |
539 |
|
</fileset> |
540 |
|
</copy> |
541 |
|
|
542 |
|
</target> |
543 |
|
|
544 |
|
|
545 |
|
<target name="configure-emulation"> |
546 |
|
|
547 |
<condition property="build.emulation.true"> |
<condition property="build.emulation.true"> |
548 |
<or> |
<or> |
549 |
<isset property="build.emulation"/> |
<and> |
550 |
<os family="windows"/> |
<os family="windows"/> |
551 |
|
<not> |
552 |
|
<isset property="build.emulation"/> |
553 |
|
</not> |
554 |
|
</and> |
555 |
|
<istrue value="${build.emulation}"/> |
556 |
</or> |
</or> |
557 |
</condition> |
</condition> |
558 |
|
|
559 |
|
</target> |
560 |
|
|
561 |
|
|
562 |
|
<target name="configure-tests"> |
563 |
|
|
564 |
|
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
565 |
|
<available property="junit.available" |
566 |
|
classname="junit.framework.Protectable"/> |
567 |
|
|
568 |
|
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
569 |
|
unless="junit.available"/> |
570 |
|
|
571 |
|
|
572 |
|
<!-- |
573 |
|
! Bootclasspath munging for testing, so JUnit can test our local |
574 |
|
! modifications to java.*. |
575 |
|
--> |
576 |
|
|
577 |
|
<path id="test.classpath"> |
578 |
|
<pathelement location="${product.jar}"/> |
579 |
|
<pathelement location="${build.testcases.dir}"/> |
580 |
|
<pathelement location="${junit.jar}"/> |
581 |
|
</path> |
582 |
|
|
583 |
|
<!-- Flatten test classpath into a platform-appropriate string --> |
584 |
|
<property name="test.classpath" refid="test.classpath"/> |
585 |
|
|
586 |
|
<!-- Turn the flattened test classpath into a javac argument --> |
587 |
|
<property name="test.bootclasspath.arg" |
588 |
|
value='-Xbootclasspath/p:${test.classpath}'/> |
589 |
|
|
590 |
</target> |
</target> |
591 |
|
|
592 |
|
|