59 |
|
|
60 |
|
|
61 |
|
|
62 |
<!-- Files excluded from emulation and dist-docs --> |
<!-- Files excluded from dist-docs and emulation jar --> |
63 |
<patternset id="emulation.excludes"> |
<patternset id="unsafe.exclusion"> |
64 |
<exclude name="java/util/Random.*"/> |
<exclude name="java/util/Random.*"/> |
65 |
<exclude name="sun/misc/Unsafe.*"/> |
<exclude name="sun/misc/Unsafe.*"/> |
66 |
</patternset> |
</patternset> |
67 |
|
|
68 |
|
<!-- Files excludes from emulation jar --> |
69 |
|
<patternset id="atomic.exclusion"> |
70 |
|
<exclude name="java/util/concurrent/atomic/AtomicBoolean*"/> |
71 |
|
<exclude name="java/util/concurrent/atomic/AtomicInteger*"/> |
72 |
|
<exclude name="java/util/concurrent/atomic/AtomicLong*"/> |
73 |
|
<exclude name="java/util/concurrent/atomic/AtomicReference*"/> |
74 |
|
</patternset> |
75 |
|
|
76 |
|
|
77 |
|
|
78 |
<!-- Main targets --> |
<!-- Main targets --> |
85 |
|
|
86 |
<mkdir dir="${build.classes.dir}"/> |
<mkdir dir="${build.classes.dir}"/> |
87 |
|
|
88 |
|
<!-- |
89 |
|
<echo>javac ${gjc.args}</echo> |
90 |
|
<echo>bootclasspath=${compile.bootclasspath}</echo> |
91 |
|
--> |
92 |
|
|
93 |
<javac srcdir="${prepare.src.dir}" |
<javac srcdir="${prepare.src.dir}" |
94 |
destdir="${build.classes.dir}" |
destdir="${build.classes.dir}" |
95 |
debug="${build.debug}" |
debug="${build.debug}" |
98 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
99 |
fork="true"> |
fork="true"> |
100 |
|
|
101 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args}"/> |
102 |
<compilerarg line="${build.javac.args}"/> |
<bootclasspath refid="compile.bootclasspath"/> |
103 |
|
|
104 |
</javac> |
</javac> |
105 |
|
|
190 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
191 |
fork="true"> |
fork="true"> |
192 |
|
|
193 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args} -s"/> |
194 |
<compilerarg line="${build.javac.args} -s"/> |
<bootclasspath refid="compile.bootclasspath"/> |
195 |
|
|
196 |
</javac> |
</javac> |
197 |
|
|
202 |
depends="init, dist-clean, dist-jar, dist-docs" |
depends="init, dist-clean, dist-jar, dist-docs" |
203 |
description="Puts all distributable products in single hierarchy"/> |
description="Puts all distributable products in single hierarchy"/> |
204 |
|
|
205 |
|
<target name="release" |
206 |
|
depends="dist" |
207 |
|
description="Puts entire CVS tree, plus distribution productions, in a jar"> |
208 |
|
|
209 |
|
<!-- |
210 |
|
#keep build dir? - dl |
211 |
|
<delete dir="${build.dir}"/> |
212 |
|
--> |
213 |
|
<property name="release.jar" value="dist/jsr166-${version}-dist.jar"/> |
214 |
|
|
215 |
|
<jar basedir="${basedir}" destfile="${release.jar}"> |
216 |
|
<exclude name="${release.jar}"/> |
217 |
|
<exclude name="user.properties"/> |
218 |
|
<exclude name="etc/notes/**"/> |
219 |
|
<exclude name="lib/gjc/2.1/**"/> |
220 |
|
<exclude name="**/SyntaxTest.java"/> |
221 |
|
</jar> |
222 |
|
|
223 |
|
</target> |
224 |
|
|
225 |
<target name="clean" |
<target name="clean" |
226 |
description="Removes all build products"> |
description="Removes all build products"> |
304 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
305 |
fork="true"> |
fork="true"> |
306 |
|
|
307 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args}"/> |
308 |
<compilerarg line="${build.javac.args}"/> |
<bootclasspath refid="compile.bootclasspath"/> |
309 |
|
|
310 |
</javac> |
</javac> |
311 |
|
|
319 |
|
|
320 |
<jar destfile="${product.jar}" duplicate="add"> |
<jar destfile="${product.jar}" duplicate="add"> |
321 |
<fileset dir="${build.classes.dir}"> |
<fileset dir="${build.classes.dir}"> |
322 |
<patternset refid="emulation.excludes"/> |
<patternset refid="atomic.exclusion"/> |
323 |
|
<patternset refid="unsafe.exclusion"/> |
324 |
</fileset> |
</fileset> |
325 |
<fileset dir="${build.emulation.dir}"/> |
<fileset dir="${build.emulation.dir}"/> |
326 |
</jar> |
</jar> |
360 |
</fileset> |
</fileset> |
361 |
</copy> |
</copy> |
362 |
|
|
363 |
|
<!-- Not needed now, used for doccheck filtering: |
364 |
|
<property name="generic.declarations" |
365 |
|
value="public interface E {} public interface T {} public interface K {} public interface V {}" |
366 |
|
/> |
367 |
|
--> |
368 |
|
|
369 |
<copy todir="${build.filter.src.dir}"> |
<copy todir="${build.filter.src.dir}"> |
370 |
<fileset dir="${src.dir}"> |
<fileset dir="${src.dir}"> |
371 |
<exclude name="**/*.html"/> |
<exclude name="**/*.html"/> |
372 |
<patternset refid="emulation.excludes"/> |
<patternset refid="unsafe.exclusion"/> |
373 |
</fileset> |
</fileset> |
374 |
<filterchain> |
<filterchain> |
375 |
|
|
376 |
|
<!-- |
377 |
|
# This filter gets rid of angle-bracketed type parameters |
378 |
|
# so that javadoc can run on the result. The following |
379 |
|
# heuristic seems to work: |
380 |
|
# |
381 |
|
# For all lines not starting with space(s)-asterisk-space(s), |
382 |
|
# replace <something> with a space, where there may be more |
383 |
|
# than one right angle bracket at the end, and "something" |
384 |
|
# must not contain parens or pipes. (This may need some |
385 |
|
# tweaking.) |
386 |
|
--> |
387 |
|
|
388 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
389 |
classpath="${build.ant.dir}"> |
classpath="${build.ant.dir}"> |
|
<!-- |
|
|
# These arguments are to get rid of angle-bracketed type |
|
|
# parameters so that javadoc can run on the result. The |
|
|
# following heuristic that seems to work: |
|
|
# |
|
|
# For all lines not starting with space(s)-asterisk-space(s), |
|
|
# replace <something> with a space, where there may be more |
|
|
# than one right angle bracket at the end, and "something" |
|
|
# must not contain parens or pipes. (This may need some |
|
|
# tweaking.) |
|
|
--> |
|
390 |
<param name="notmatching" value="^\s+\*\s.*$"/> |
<param name="notmatching" value="^\s+\*\s.*$"/> |
391 |
<param name="pattern" value="<[^|>()]+?>+"/> |
<param name="pattern" value="<[^|>()]+?>+"/> |
392 |
<param name="replacement" value=" "/> |
<param name="replacement" value=" "/> |
393 |
</filterreader> |
</filterreader> |
394 |
|
|
395 |
|
|
396 |
|
<!-- |
397 |
|
# This filter uncomments lines beginning with "//@" so that |
398 |
|
# javadoc can see imports that are needed to resolve links |
399 |
|
# but that shouldn't be in the compiled code. |
400 |
|
--> |
401 |
|
|
402 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
403 |
classpath="${build.ant.dir}"> |
classpath="${build.ant.dir}"> |
404 |
<!-- |
<param name="matching" value="^//@.*$"/> |
405 |
# These arguments are to uncomment lines beginning with |
<param name="pattern" value="^//@"/> |
|
# "//@" so that javadoc can see imports that are needed |
|
|
# to resolve links but that shouldn't be in the compiled |
|
|
# code. |
|
|
--> |
|
|
<param name="matching" value="^//@.*$"/> |
|
|
<param name="pattern" value="^//@"/> |
|
406 |
<param name="replacement" value=""/> |
<param name="replacement" value=""/> |
407 |
</filterreader> |
</filterreader> |
408 |
|
|
409 |
|
|
410 |
|
<!-- |
411 |
|
# The next two filters try to make the source look like |
412 |
|
# something that doccheck can process. The first removes |
413 |
|
# -source 1.4 assertions and the second adds in a bunch |
414 |
|
# of single letter public nested marker interfaces so that |
415 |
|
# the generic type parameters are recognized. |
416 |
|
# |
417 |
|
# Currently commented out because doccheck doesn't work. :-( |
418 |
|
--> |
419 |
|
|
420 |
|
<!-- |
421 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
422 |
|
classpath="${build.ant.dir}"> |
423 |
|
<param name="matching" value="^\s*assert[\s ].*$"/> |
424 |
|
<param name="pattern" value="assert"/> |
425 |
|
<param name="replacement" value="//assert"/> |
426 |
|
</filterreader> |
427 |
|
|
428 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
429 |
|
classpath="${build.ant.dir}"> |
430 |
|
<param name="matching" value="^(.*(class|interface|implements) .*|)\{.*$"/> |
431 |
|
<param name="pattern" value="$"/> |
432 |
|
<param name="replacement" value=" ${generic.declarations}"/> |
433 |
|
</filterreader> |
434 |
|
--> |
435 |
|
|
436 |
</filterchain> |
</filterchain> |
437 |
</copy> |
</copy> |
438 |
|
|
444 |
|
|
445 |
<mkdir dir="${build.testcases.dir}"/> |
<mkdir dir="${build.testcases.dir}"/> |
446 |
|
|
447 |
|
<!-- |
448 |
|
<echo>javac ${gjc.args}</echo> |
449 |
|
<echo>bootclasspath=${test.compile.bootclasspath}</echo> |
450 |
|
<echo>classpath="${test.classpath}"</echo> |
451 |
|
--> |
452 |
|
|
453 |
<javac srcdir="${test.src.dir}" |
<javac srcdir="${test.src.dir}" |
454 |
destdir="${build.testcases.dir}" |
destdir="${build.testcases.dir}" |
455 |
debug="${build.debug}" |
debug="${build.debug}" |
458 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
459 |
fork="true"> |
fork="true"> |
460 |
|
|
461 |
<classpath refid="test.classpath"/> |
<compilerarg line="${gjc.args}"/> |
462 |
<bootclasspath refid="javac.bootclasspath"/> |
<bootclasspath refid="test.compile.bootclasspath"/> |
463 |
<compilerarg line="${build.javac.args}"/> |
<classpath refid="test.classpath"/> |
464 |
|
|
465 |
</javac> |
</javac> |
466 |
|
|
482 |
dir="${build.reports.dir}" |
dir="${build.reports.dir}" |
483 |
fork="true"> |
fork="true"> |
484 |
|
|
485 |
<jvmarg value="${test.bootclasspath.arg}"/> |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
486 |
|
|
487 |
<formatter type="xml"/> |
<formatter type="xml"/> |
488 |
|
|
526 |
<target name="configure-compiler"> |
<target name="configure-compiler"> |
527 |
|
|
528 |
<property name="gjc.version" |
<property name="gjc.version" |
529 |
value="1.3"/> |
value="2.0"/> |
530 |
|
|
531 |
<condition property="build.novariance" value="-novariance"> |
<condition property="novariance.arg" value="-novariance"> |
532 |
<and> |
<and> |
533 |
<equals arg1="${gjc.version}" arg2="2.0"/> |
<equals arg1="${gjc.version}" arg2="2.0"/> |
534 |
<or> |
<or> |
538 |
</and> |
</and> |
539 |
</condition> |
</condition> |
540 |
|
|
541 |
<property name="build.novariance" |
<property name="novariance.arg" |
542 |
value=""/> |
value=""/> |
543 |
|
|
544 |
<property name="gjc.dir" |
<property name="gjc.dir" |
548 |
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
549 |
|
|
550 |
<property name="collect.jar" |
<property name="collect.jar" |
551 |
location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/> |
location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/> |
552 |
|
|
553 |
|
|
554 |
<condition property="build.warnunchecked" value="-warnunchecked"> |
<condition property="warnunchecked.arg" value="-warnunchecked"> |
555 |
<istrue value="${gjc.warnunchecked}"/> |
<istrue value="${gjc.warnunchecked}"/> |
556 |
</condition> |
</condition> |
557 |
|
|
558 |
<property name="build.warnunchecked" value=""/> |
<property name="warnunchecked.arg" value=""/> |
559 |
|
|
560 |
|
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
561 |
|
<istrue value="${build.nothreads}"/> |
562 |
|
</condition> |
563 |
|
|
564 |
|
|
565 |
<!-- |
<!-- |
566 |
! Bootclasspath munging for source compilation. |
! Bootclasspath munging for source compilation. |
567 |
--> |
--> |
568 |
|
|
569 |
<path id="javac.bootclasspath.prefix"> |
<path id="pre.bootclasspath"> |
|
<!-- <pathelement location="${src.dir}"/> --> |
|
570 |
<pathelement location="${javac.jar}"/> |
<pathelement location="${javac.jar}"/> |
571 |
</path> |
</path> |
572 |
|
|
573 |
<path id="javac.bootclasspath"> |
<path id="compile.bootclasspath"> |
574 |
<!-- <pathelement location="${src.dir}"/> --> |
<pathelement location="${build.classes.dir}"/> |
575 |
<pathelement location="${collect.jar}"/> |
<pathelement location="${collect.jar}"/> |
576 |
<pathelement location="${rt.jar}"/> |
<pathelement location="${rt.jar}"/> |
577 |
</path> |
</path> |
578 |
|
|
579 |
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
<!-- Flatten paths into platform-appropriate strings --> |
580 |
<property name="javac.bootclasspath.prefix" |
<property name="pre.bootclasspath" refid="pre.bootclasspath"/> |
581 |
refid="javac.bootclasspath.prefix"/> |
<property name="compile.bootclasspath" refid="compile.bootclasspath"/> |
|
|
|
|
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
|
|
<property name="build.bootclasspath.arg" |
|
|
value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
|
|
|
|
|
<!-- Flatten bootclasspath for trace message --> |
|
|
<property name="javac.bootclasspath" |
|
|
refid="javac.bootclasspath"/> |
|
582 |
|
|
|
<!-- Common options in javac invocations --> |
|
|
<property name="build.javac.args" |
|
|
value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/> |
|
583 |
|
|
584 |
<echo>javac ${build.javac.args}</echo> |
<!-- Common options in javac invocations --> |
585 |
<echo>bootclasspath=${javac.bootclasspath}</echo> |
<property name="gjc.args" |
586 |
|
value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}" |
587 |
|
/> |
588 |
|
|
589 |
</target> |
</target> |
590 |
|
|
591 |
|
|
|
<target name="configure-src"> |
|
|
|
|
|
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
|
|
<istrue value="${build.nothreads}"/> |
|
|
</condition> |
|
|
|
|
|
</target> |
|
|
|
|
592 |
<target name="prepare-src" |
<target name="prepare-src" |
593 |
depends="configure-src" |
depends="configure-compiler" |
594 |
if="prepare.src.dir"> |
if="prepare.src.dir"> |
595 |
|
|
596 |
<mkdir dir="${prepare.src.dir}"/> |
<mkdir dir="${prepare.src.dir}"/> |
620 |
</target> |
</target> |
621 |
|
|
622 |
|
|
623 |
<target name="configure-tests"> |
<target name="configure-tests" |
624 |
|
depends="configure-compiler"> |
625 |
|
|
626 |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
627 |
<available property="junit.available" |
<available property="junit.available" |
642 |
<pathelement location="${junit.jar}"/> |
<pathelement location="${junit.jar}"/> |
643 |
</path> |
</path> |
644 |
|
|
645 |
<!-- Flatten test classpath into a platform-appropriate string --> |
<path id="test.compile.bootclasspath"> |
646 |
<property name="test.classpath" refid="test.classpath"/> |
<pathelement location="${javac.jar}"/> |
647 |
|
<pathelement location="${collect.jar}"/> |
648 |
|
<pathelement location="${rt.jar}"/> |
649 |
|
</path> |
650 |
|
|
651 |
<!-- Turn the flattened test classpath into a javac argument --> |
<path id="test.run.bootclasspath"> |
652 |
<property name="test.bootclasspath.arg" |
<pathelement location="${javac.jar}"/> |
653 |
value='-Xbootclasspath/p:${test.classpath}'/> |
<path refid="test.classpath"/> |
654 |
|
</path> |
655 |
|
|
656 |
|
<!-- Flatten test classpaths into platform-appropriate strings --> |
657 |
|
<property name="test.classpath" refid="test.classpath"/> |
658 |
|
<property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/> |
659 |
|
<property name="test.run.bootclasspath" refid="test.run.bootclasspath"/> |
660 |
|
|
661 |
</target> |
</target> |
662 |
|
|
687 |
</target> |
</target> |
688 |
|
|
689 |
|
|
690 |
|
<target name="ng" depends="test"> |
691 |
|
<java classname="SuperfluousAbstract" fork="true"> |
692 |
|
|
693 |
|
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
694 |
|
|
695 |
|
</java> |
696 |
|
</target> |
697 |
|
|
698 |
|
|
699 |
</project> |
</project> |