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/AtomicInteger*"/> |
71 |
|
<exclude name="java/util/concurrent/atomic/AtomicLong*"/> |
72 |
|
<exclude name="java/util/concurrent/atomic/AtomicReference*"/> |
73 |
|
</patternset> |
74 |
|
|
75 |
|
|
76 |
|
|
77 |
<!-- Main targets --> |
<!-- Main targets --> |
84 |
|
|
85 |
<mkdir dir="${build.classes.dir}"/> |
<mkdir dir="${build.classes.dir}"/> |
86 |
|
|
87 |
|
<!-- |
88 |
|
<echo>javac ${gjc.args}</echo> |
89 |
|
<echo>bootclasspath=${compile.bootclasspath}</echo> |
90 |
|
--> |
91 |
|
|
92 |
<javac srcdir="${prepare.src.dir}" |
<javac srcdir="${prepare.src.dir}" |
93 |
destdir="${build.classes.dir}" |
destdir="${build.classes.dir}" |
94 |
debug="${build.debug}" |
debug="${build.debug}" |
97 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
98 |
fork="true"> |
fork="true"> |
99 |
|
|
100 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args}"/> |
101 |
<compilerarg line="${build.javac.args}"/> |
<bootclasspath refid="compile.bootclasspath"/> |
102 |
|
|
103 |
</javac> |
</javac> |
104 |
|
|
189 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
190 |
fork="true"> |
fork="true"> |
191 |
|
|
192 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args} -s"/> |
193 |
<compilerarg line="${build.javac.args} -s"/> |
<bootclasspath refid="compile.bootclasspath"/> |
194 |
|
|
195 |
</javac> |
</javac> |
196 |
|
|
284 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
285 |
fork="true"> |
fork="true"> |
286 |
|
|
287 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args}"/> |
288 |
<compilerarg line="${build.javac.args}"/> |
<bootclasspath refid="compile.bootclasspath"/> |
289 |
|
|
290 |
</javac> |
</javac> |
291 |
|
|
299 |
|
|
300 |
<jar destfile="${product.jar}" duplicate="add"> |
<jar destfile="${product.jar}" duplicate="add"> |
301 |
<fileset dir="${build.classes.dir}"> |
<fileset dir="${build.classes.dir}"> |
302 |
<patternset refid="emulation.excludes"/> |
<patternset refid="atomic.exclusion"/> |
303 |
|
<patternset refid="unsafe.exclusion"/> |
304 |
</fileset> |
</fileset> |
305 |
<fileset dir="${build.emulation.dir}"/> |
<fileset dir="${build.emulation.dir}"/> |
306 |
</jar> |
</jar> |
340 |
</fileset> |
</fileset> |
341 |
</copy> |
</copy> |
342 |
|
|
343 |
|
<!-- Not needed now, used for doccheck filtering: |
344 |
|
<property name="generic.declarations" |
345 |
|
value="public interface E {} public interface T {} public interface K {} public interface V {}" |
346 |
|
/> |
347 |
|
--> |
348 |
|
|
349 |
<copy todir="${build.filter.src.dir}"> |
<copy todir="${build.filter.src.dir}"> |
350 |
<fileset dir="${src.dir}"> |
<fileset dir="${src.dir}"> |
351 |
<exclude name="**/*.html"/> |
<exclude name="**/*.html"/> |
352 |
<patternset refid="emulation.excludes"/> |
<patternset refid="unsafe.exclusion"/> |
353 |
</fileset> |
</fileset> |
354 |
<filterchain> |
<filterchain> |
355 |
|
|
356 |
|
<!-- |
357 |
|
# This filter gets rid of angle-bracketed type parameters |
358 |
|
# so that javadoc can run on the result. The following |
359 |
|
# heuristic seems to work: |
360 |
|
# |
361 |
|
# For all lines not starting with space(s)-asterisk-space(s), |
362 |
|
# replace <something> with a space, where there may be more |
363 |
|
# than one right angle bracket at the end, and "something" |
364 |
|
# must not contain parens or pipes. (This may need some |
365 |
|
# tweaking.) |
366 |
|
--> |
367 |
|
|
368 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
369 |
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.) |
|
|
--> |
|
370 |
<param name="notmatching" value="^\s+\*\s.*$"/> |
<param name="notmatching" value="^\s+\*\s.*$"/> |
371 |
<param name="pattern" value="<[^|>()]+?>+"/> |
<param name="pattern" value="<[^|>()]+?>+"/> |
372 |
<param name="replacement" value=" "/> |
<param name="replacement" value=" "/> |
373 |
</filterreader> |
</filterreader> |
374 |
|
|
375 |
|
|
376 |
|
<!-- |
377 |
|
# This filter uncomments lines beginning with "//@" so that |
378 |
|
# javadoc can see imports that are needed to resolve links |
379 |
|
# but that shouldn't be in the compiled code. |
380 |
|
--> |
381 |
|
|
382 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
383 |
classpath="${build.ant.dir}"> |
classpath="${build.ant.dir}"> |
384 |
<!-- |
<param name="matching" value="^//@.*$"/> |
385 |
# 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="^//@"/> |
|
386 |
<param name="replacement" value=""/> |
<param name="replacement" value=""/> |
387 |
</filterreader> |
</filterreader> |
388 |
|
|
389 |
|
|
390 |
|
<!-- |
391 |
|
# The next two filters try to make the source look like |
392 |
|
# something that doccheck can process. The first removes |
393 |
|
# -source 1.4 assertions and the second adds in a bunch |
394 |
|
# of single letter public nested marker interfaces so that |
395 |
|
# the generic type parameters are recognized. |
396 |
|
# |
397 |
|
# Currently commented out because doccheck doesn't work. :-( |
398 |
|
--> |
399 |
|
|
400 |
|
<!-- |
401 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
402 |
|
classpath="${build.ant.dir}"> |
403 |
|
<param name="matching" value="^\s*assert[\s ].*$"/> |
404 |
|
<param name="pattern" value="assert"/> |
405 |
|
<param name="replacement" value="//assert"/> |
406 |
|
</filterreader> |
407 |
|
|
408 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
409 |
|
classpath="${build.ant.dir}"> |
410 |
|
<param name="matching" value="^(.*(class|interface|implements) .*|)\{.*$"/> |
411 |
|
<param name="pattern" value="$"/> |
412 |
|
<param name="replacement" value=" ${generic.declarations}"/> |
413 |
|
</filterreader> |
414 |
|
--> |
415 |
|
|
416 |
</filterchain> |
</filterchain> |
417 |
</copy> |
</copy> |
418 |
|
|
424 |
|
|
425 |
<mkdir dir="${build.testcases.dir}"/> |
<mkdir dir="${build.testcases.dir}"/> |
426 |
|
|
427 |
|
<!-- |
428 |
|
<echo>javac ${gjc.args}</echo> |
429 |
|
<echo>bootclasspath=${test.compile.bootclasspath}</echo> |
430 |
|
<echo>classpath="${test.classpath}"</echo> |
431 |
|
--> |
432 |
|
|
433 |
<javac srcdir="${test.src.dir}" |
<javac srcdir="${test.src.dir}" |
434 |
destdir="${build.testcases.dir}" |
destdir="${build.testcases.dir}" |
435 |
debug="${build.debug}" |
debug="${build.debug}" |
438 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
439 |
fork="true"> |
fork="true"> |
440 |
|
|
441 |
<classpath refid="test.classpath"/> |
<compilerarg line="${gjc.args}"/> |
442 |
<bootclasspath refid="javac.bootclasspath"/> |
<bootclasspath refid="test.compile.bootclasspath"/> |
443 |
<compilerarg line="${build.javac.args}"/> |
<classpath refid="test.classpath"/> |
444 |
|
|
445 |
</javac> |
</javac> |
446 |
|
|
462 |
dir="${build.reports.dir}" |
dir="${build.reports.dir}" |
463 |
fork="true"> |
fork="true"> |
464 |
|
|
465 |
<jvmarg value="${test.bootclasspath.arg}"/> |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
466 |
|
|
467 |
<formatter type="xml"/> |
<formatter type="xml"/> |
468 |
|
|
508 |
<property name="gjc.version" |
<property name="gjc.version" |
509 |
value="2.0"/> |
value="2.0"/> |
510 |
|
|
511 |
<condition property="build.novariance" value="-novariance"> |
<condition property="novariance.arg" value="-novariance"> |
512 |
<and> |
<and> |
513 |
<equals arg1="${gjc.version}" arg2="2.0"/> |
<equals arg1="${gjc.version}" arg2="2.0"/> |
514 |
<or> |
<or> |
518 |
</and> |
</and> |
519 |
</condition> |
</condition> |
520 |
|
|
521 |
<property name="build.novariance" |
<property name="novariance.arg" |
522 |
value=""/> |
value=""/> |
523 |
|
|
524 |
<property name="gjc.dir" |
<property name="gjc.dir" |
528 |
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
529 |
|
|
530 |
<property name="collect.jar" |
<property name="collect.jar" |
531 |
location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/> |
location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/> |
532 |
|
|
533 |
|
|
534 |
<condition property="build.warnunchecked" value="-warnunchecked"> |
<condition property="warnunchecked.arg" value="-warnunchecked"> |
535 |
<istrue value="${gjc.warnunchecked}"/> |
<istrue value="${gjc.warnunchecked}"/> |
536 |
</condition> |
</condition> |
537 |
|
|
538 |
<property name="build.warnunchecked" value=""/> |
<property name="warnunchecked.arg" value=""/> |
539 |
|
|
540 |
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
541 |
<or> |
<istrue value="${build.nothreads}"/> |
|
<and> |
|
|
<not><isset property="build.nothreads"/></not> |
|
|
<equals arg1="${gjc.version}" arg2="2.0"/> |
|
|
</and> |
|
|
<istrue value="${build.nothreads}"/> |
|
|
</or> |
|
542 |
</condition> |
</condition> |
543 |
|
|
544 |
|
|
546 |
! Bootclasspath munging for source compilation. |
! Bootclasspath munging for source compilation. |
547 |
--> |
--> |
548 |
|
|
549 |
<path id="javac.bootclasspath.prefix"> |
<path id="pre.bootclasspath"> |
|
<!-- <pathelement location="${src.dir}"/> --> |
|
550 |
<pathelement location="${javac.jar}"/> |
<pathelement location="${javac.jar}"/> |
551 |
</path> |
</path> |
552 |
|
|
553 |
<path id="javac.bootclasspath"> |
<path id="compile.bootclasspath"> |
554 |
<!-- <pathelement location="${src.dir}"/> --> |
<pathelement location="${build.classes.dir}"/> |
555 |
<pathelement location="${collect.jar}"/> |
<pathelement location="${collect.jar}"/> |
556 |
<pathelement location="${rt.jar}"/> |
<pathelement location="${rt.jar}"/> |
557 |
</path> |
</path> |
558 |
|
|
559 |
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
<!-- Flatten paths into platform-appropriate strings --> |
560 |
<property name="javac.bootclasspath.prefix" |
<property name="pre.bootclasspath" refid="pre.bootclasspath"/> |
561 |
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"/> |
|
562 |
|
|
|
<!-- Common options in javac invocations --> |
|
|
<property name="build.javac.args" |
|
|
value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/> |
|
563 |
|
|
564 |
<echo>javac ${build.javac.args}</echo> |
<!-- Common options in javac invocations --> |
565 |
<echo>bootclasspath=${javac.bootclasspath}</echo> |
<property name="gjc.args" |
566 |
|
value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}" |
567 |
|
/> |
568 |
|
|
569 |
</target> |
</target> |
570 |
|
|
600 |
</target> |
</target> |
601 |
|
|
602 |
|
|
603 |
<target name="configure-tests"> |
<target name="configure-tests" |
604 |
|
depends="configure-compiler"> |
605 |
|
|
606 |
<!-- 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 --> |
607 |
<available property="junit.available" |
<available property="junit.available" |
622 |
<pathelement location="${junit.jar}"/> |
<pathelement location="${junit.jar}"/> |
623 |
</path> |
</path> |
624 |
|
|
625 |
<!-- Flatten test classpath into a platform-appropriate string --> |
<path id="test.compile.bootclasspath"> |
626 |
<property name="test.classpath" refid="test.classpath"/> |
<pathelement location="${javac.jar}"/> |
627 |
|
<pathelement location="${collect.jar}"/> |
628 |
|
<pathelement location="${rt.jar}"/> |
629 |
|
</path> |
630 |
|
|
631 |
|
<path id="test.run.bootclasspath"> |
632 |
|
<pathelement location="${javac.jar}"/> |
633 |
|
<path refid="test.classpath"/> |
634 |
|
</path> |
635 |
|
|
636 |
<!-- Turn the flattened test classpath into a javac argument --> |
<!-- Flatten test classpaths into platform-appropriate strings --> |
637 |
<property name="test.bootclasspath.arg" |
<property name="test.classpath" refid="test.classpath"/> |
638 |
value='-Xbootclasspath/p:${test.classpath}'/> |
<property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/> |
639 |
|
<property name="test.run.bootclasspath" refid="test.run.bootclasspath"/> |
640 |
|
|
641 |
</target> |
</target> |
642 |
|
|