39 |
|
<property name="build.reports.dir" location="${build.dir}/reports"/> |
40 |
|
<property name="build.doccheck.dir" location="${build.dir}/doccheck"/> |
41 |
|
<property name="build.filter.src.dir" location="${build.dir}/filtersrc"/> |
42 |
+ |
<property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/> |
43 |
|
|
44 |
|
<!-- Source locations --> |
45 |
|
<property name="src.dir" location="${basedir}/src/main"/> |
57 |
|
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
58 |
|
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
59 |
|
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
60 |
+ |
<property name="sinjdoc.jar" location="${lib.dir}/sinjdoc.jar"/> |
61 |
|
|
62 |
|
|
63 |
< |
|
64 |
< |
<!-- Files excluded from emulation and dist-docs --> |
63 |
< |
<patternset id="emulation.excludes"> |
63 |
> |
<!-- Files excluded from dist-docs and emulation jar --> |
64 |
> |
<patternset id="unsafe.exclusion"> |
65 |
|
<exclude name="java/util/Random.*"/> |
66 |
|
<exclude name="sun/misc/Unsafe.*"/> |
67 |
|
</patternset> |
68 |
|
|
69 |
+ |
<!-- Files excludes from emulation jar --> |
70 |
+ |
<patternset id="atomic.exclusion"> |
71 |
+ |
<exclude name="java/util/concurrent/atomic/AtomicBoolean*"/> |
72 |
+ |
<exclude name="java/util/concurrent/atomic/AtomicInteger*"/> |
73 |
+ |
<exclude name="java/util/concurrent/atomic/AtomicLong*"/> |
74 |
+ |
<exclude name="java/util/concurrent/atomic/AtomicReference*"/> |
75 |
+ |
</patternset> |
76 |
+ |
|
77 |
|
|
78 |
|
|
79 |
|
<!-- Main targets --> |
86 |
|
|
87 |
|
<mkdir dir="${build.classes.dir}"/> |
88 |
|
|
89 |
+ |
<!-- |
90 |
+ |
<echo>javac ${gjc.args}</echo> |
91 |
+ |
<echo>bootclasspath=${compile.bootclasspath}</echo> |
92 |
+ |
--> |
93 |
+ |
|
94 |
|
<javac srcdir="${prepare.src.dir}" |
95 |
|
destdir="${build.classes.dir}" |
96 |
|
debug="${build.debug}" |
99 |
|
source="${build.sourcelevel}" |
100 |
|
fork="true"> |
101 |
|
|
102 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
103 |
< |
<compilerarg line="${build.javac.args}"/> |
102 |
> |
<compilerarg line="${gjc.args}"/> |
103 |
> |
<bootclasspath refid="compile.bootclasspath"/> |
104 |
|
|
105 |
|
</javac> |
106 |
|
|
133 |
|
|
134 |
|
|
135 |
|
<target name="doccheck" |
136 |
< |
depends="filter-src" |
137 |
< |
description="Reports on javadoc style errors (not working yet)"> |
136 |
> |
depends="filter-doccheck" |
137 |
> |
description="Reports on javadoc style errors"> |
138 |
|
|
139 |
|
<delete dir="${build.doccheck.dir}"/> |
140 |
|
<mkdir dir="${build.doccheck.dir}"/> |
142 |
|
<javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
143 |
|
docletpath="${lib.dir}/doccheck.jar" |
144 |
|
destdir="${build.doccheck.dir}"> |
145 |
< |
<packageset dir="${build.filter.src.dir}"/> |
145 |
> |
<packageset dir="${build.filter.doccheck.dir}"/> |
146 |
|
</javadoc> |
147 |
|
|
148 |
+ |
<echo>DocCheck output is in ${build.doccheck.dir}</echo> |
149 |
+ |
|
150 |
|
</target> |
151 |
|
|
152 |
|
|
174 |
|
</target> |
175 |
|
|
176 |
|
|
177 |
+ |
<target name="sinjdocs" |
178 |
+ |
depends="configure-tests" |
179 |
+ |
description="Builds javadocs with custom tags to build folder"> |
180 |
+ |
|
181 |
+ |
<delete dir="${build.javadocs.dir}"/> |
182 |
+ |
<mkdir dir="${build.javadocs.dir}"/> |
183 |
+ |
|
184 |
+ |
<java classname="net.cscott.sinjdoc.Main" fork="true"> |
185 |
+ |
|
186 |
+ |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
187 |
+ |
|
188 |
+ |
<classpath> |
189 |
+ |
<pathelement location="${sinjdoc.jar}"/> |
190 |
+ |
<path refid="test.classpath"/> |
191 |
+ |
</classpath> |
192 |
+ |
|
193 |
+ |
<!-- <arg value="-link"/> <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> --> |
194 |
+ |
|
195 |
+ |
<arg value="-d"/> <arg value="${build.javadocs.dir}"/> |
196 |
+ |
<arg value="-sourcepath"/> <arg value="${src.dir}"/> |
197 |
+ |
<arg value="-overview"/> <arg value="${src.dir}/intro.html"/> |
198 |
+ |
<arg value="-source"/> <arg value="1.5"/> |
199 |
+ |
<arg value="-verbose"/> |
200 |
+ |
<arg value="java.util"/> |
201 |
+ |
|
202 |
+ |
<!-- |
203 |
+ |
<arg value="-help"/> |
204 |
+ |
--> |
205 |
+ |
|
206 |
+ |
</java> |
207 |
+ |
|
208 |
+ |
</target> |
209 |
+ |
|
210 |
+ |
|
211 |
|
<target name="strip" |
212 |
|
depends="init, configure-compiler" |
213 |
|
description="Strip generics from java source (not working yet)"> |
227 |
|
source="${build.sourcelevel}" |
228 |
|
fork="true"> |
229 |
|
|
230 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
231 |
< |
<compilerarg line="${build.javac.args} -s"/> |
230 |
> |
<compilerarg line="${gjc.args} -s"/> |
231 |
> |
<bootclasspath refid="compile.bootclasspath"/> |
232 |
|
|
233 |
|
</javac> |
234 |
|
|
239 |
|
depends="init, dist-clean, dist-jar, dist-docs" |
240 |
|
description="Puts all distributable products in single hierarchy"/> |
241 |
|
|
242 |
+ |
<target name="release" |
243 |
+ |
depends="dist" |
244 |
+ |
description="Puts entire CVS tree, plus distribution productions, in a jar"> |
245 |
+ |
|
246 |
+ |
<!-- |
247 |
+ |
#keep build dir? - dl |
248 |
+ |
<delete dir="${build.dir}"/> |
249 |
+ |
--> |
250 |
+ |
<property name="release.jar" value="dist/jsr166-${version}-dist.jar"/> |
251 |
+ |
|
252 |
+ |
<jar basedir="${basedir}" destfile="${release.jar}"> |
253 |
+ |
<exclude name="${release.jar}"/> |
254 |
+ |
<exclude name="user.properties"/> |
255 |
+ |
<exclude name="etc/notes/**"/> |
256 |
+ |
<exclude name="lib/gjc/2.1/**"/> |
257 |
+ |
<exclude name="**/SyntaxTest.java"/> |
258 |
+ |
</jar> |
259 |
+ |
|
260 |
+ |
</target> |
261 |
|
|
262 |
|
<target name="clean" |
263 |
|
description="Removes all build products"> |
341 |
|
source="${build.sourcelevel}" |
342 |
|
fork="true"> |
343 |
|
|
344 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
345 |
< |
<compilerarg line="${build.javac.args}"/> |
344 |
> |
<compilerarg line="${gjc.args}"/> |
345 |
> |
<bootclasspath refid="compile.bootclasspath"/> |
346 |
|
|
347 |
|
</javac> |
348 |
|
|
356 |
|
|
357 |
|
<jar destfile="${product.jar}" duplicate="add"> |
358 |
|
<fileset dir="${build.classes.dir}"> |
359 |
< |
<patternset refid="emulation.excludes"/> |
359 |
> |
<patternset refid="atomic.exclusion"/> |
360 |
> |
<patternset refid="unsafe.exclusion"/> |
361 |
|
</fileset> |
362 |
|
<fileset dir="${build.emulation.dir}"/> |
363 |
|
</jar> |
400 |
|
<copy todir="${build.filter.src.dir}"> |
401 |
|
<fileset dir="${src.dir}"> |
402 |
|
<exclude name="**/*.html"/> |
403 |
< |
<patternset refid="emulation.excludes"/> |
403 |
> |
<patternset refid="unsafe.exclusion"/> |
404 |
|
</fileset> |
405 |
|
<filterchain> |
406 |
+ |
|
407 |
+ |
<!-- |
408 |
+ |
# This filter gets rid of angle-bracketed type parameters |
409 |
+ |
# so that javadoc can run on the result. The following |
410 |
+ |
# heuristic seems to work: |
411 |
+ |
# |
412 |
+ |
# For all lines not starting with space(s)-asterisk-space(s), |
413 |
+ |
# replace <something> with a space, where there may be more |
414 |
+ |
# than one right angle bracket at the end, and "something" |
415 |
+ |
# must not contain parens or pipes. (This may need some |
416 |
+ |
# tweaking.) |
417 |
+ |
--> |
418 |
+ |
|
419 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
420 |
|
classpath="${build.ant.dir}"> |
338 |
– |
<!-- |
339 |
– |
# These arguments are to get rid of angle-bracketed type |
340 |
– |
# parameters so that javadoc can run on the result. The |
341 |
– |
# following heuristic that seems to work: |
342 |
– |
# |
343 |
– |
# For all lines not starting with space(s)-asterisk-space(s), |
344 |
– |
# replace <something> with a space, where there may be more |
345 |
– |
# than one right angle bracket at the end, and "something" |
346 |
– |
# must not contain parens or pipes. (This may need some |
347 |
– |
# tweaking.) |
348 |
– |
--> |
421 |
|
<param name="notmatching" value="^\s+\*\s.*$"/> |
422 |
< |
<param name="pattern" value="<[^|>()]+?>+"/> |
422 |
> |
<param name="pattern" value="<[^|>()]+?>+"/> |
423 |
|
<param name="replacement" value=" "/> |
424 |
|
</filterreader> |
425 |
+ |
|
426 |
+ |
|
427 |
+ |
<!-- |
428 |
+ |
# This filter uncomments lines beginning with "//@" so that |
429 |
+ |
# javadoc can see imports that are needed to resolve links |
430 |
+ |
# but that shouldn't be in the compiled code. |
431 |
+ |
--> |
432 |
+ |
|
433 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
434 |
|
classpath="${build.ant.dir}"> |
435 |
< |
<!-- |
436 |
< |
# These arguments are to uncomment lines beginning with |
357 |
< |
# "//@" so that javadoc can see imports that are needed |
358 |
< |
# to resolve links but that shouldn't be in the compiled |
359 |
< |
# code. |
360 |
< |
--> |
361 |
< |
<param name="matching" value="^//@.*$"/> |
362 |
< |
<param name="pattern" value="^//@"/> |
435 |
> |
<param name="matching" value="^//@.*$"/> |
436 |
> |
<param name="pattern" value="^//@"/> |
437 |
|
<param name="replacement" value=""/> |
438 |
|
</filterreader> |
439 |
|
</filterchain> |
442 |
|
</target> |
443 |
|
|
444 |
|
|
445 |
+ |
|
446 |
+ |
|
447 |
+ |
<target name="filter-doccheck" |
448 |
+ |
depends="filter-src"> |
449 |
+ |
|
450 |
+ |
<mkdir dir="${build.filter.doccheck.dir}"/> |
451 |
+ |
|
452 |
+ |
<copy todir="${build.filter.doccheck.dir}"> |
453 |
+ |
<fileset dir="${build.filter.src.dir}"> |
454 |
+ |
<include name="**/*.html"/> |
455 |
+ |
</fileset> |
456 |
+ |
</copy> |
457 |
+ |
|
458 |
+ |
<property name="generic.declarations" |
459 |
+ |
value="/** Fake type parameter. */ public interface E {} /** Fake type parameter. */ public interface T {} /** Fake type parameter. */ public interface K {} /** Fake type parameter. */ public interface V {}" |
460 |
+ |
/> |
461 |
+ |
|
462 |
+ |
<copy todir="${build.filter.doccheck.dir}"> |
463 |
+ |
<fileset dir="${build.filter.src.dir}"> |
464 |
+ |
<exclude name="**/*.html"/> |
465 |
+ |
</fileset> |
466 |
+ |
<filterchain> |
467 |
+ |
<!-- |
468 |
+ |
# These two filters try to make the source look like |
469 |
+ |
# something that doccheck can process. The first removes |
470 |
+ |
# -source 1.4 assertions and the second adds in a bunch |
471 |
+ |
# of single letter public nested marker interfaces so that |
472 |
+ |
# the generic type parameters are recognized. |
473 |
+ |
--> |
474 |
+ |
|
475 |
+ |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
476 |
+ |
classpath="${build.ant.dir}"> |
477 |
+ |
<param name="matching" value="^\s*assert[\s ].*$"/> |
478 |
+ |
<param name="pattern" value="assert"/> |
479 |
+ |
<param name="replacement" value="//assert"/> |
480 |
+ |
</filterreader> |
481 |
+ |
|
482 |
+ |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
483 |
+ |
classpath="${build.ant.dir}"> |
484 |
+ |
<param name="matching" value="^([^*]*(class|interface|implements) .*|)\{.*$"/> |
485 |
+ |
<param name="pattern" value="$"/> |
486 |
+ |
<param name="replacement" value=" ${generic.declarations}"/> |
487 |
+ |
</filterreader> |
488 |
+ |
|
489 |
+ |
</filterchain> |
490 |
+ |
</copy> |
491 |
+ |
|
492 |
+ |
</target> |
493 |
+ |
|
494 |
+ |
|
495 |
|
<target name="compile-tests" |
496 |
|
depends="jar"> |
497 |
|
|
498 |
|
<mkdir dir="${build.testcases.dir}"/> |
499 |
|
|
500 |
+ |
<!-- |
501 |
+ |
<echo>javac ${gjc.args}</echo> |
502 |
+ |
<echo>bootclasspath=${test.compile.bootclasspath}</echo> |
503 |
+ |
<echo>classpath="${test.classpath}"</echo> |
504 |
+ |
--> |
505 |
+ |
|
506 |
|
<javac srcdir="${test.src.dir}" |
507 |
|
destdir="${build.testcases.dir}" |
508 |
|
debug="${build.debug}" |
511 |
|
source="${build.sourcelevel}" |
512 |
|
fork="true"> |
513 |
|
|
514 |
< |
<classpath refid="test.classpath"/> |
515 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
516 |
< |
<compilerarg line="${build.javac.args}"/> |
514 |
> |
<compilerarg line="${gjc.args}"/> |
515 |
> |
<bootclasspath refid="test.compile.bootclasspath"/> |
516 |
> |
<classpath refid="test.classpath"/> |
517 |
|
|
518 |
|
</javac> |
519 |
|
|
535 |
|
dir="${build.reports.dir}" |
536 |
|
fork="true"> |
537 |
|
|
538 |
< |
<jvmarg value="${test.bootclasspath.arg}"/> |
538 |
> |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
539 |
|
|
540 |
|
<formatter type="xml"/> |
541 |
|
|
579 |
|
<target name="configure-compiler"> |
580 |
|
|
581 |
|
<property name="gjc.version" |
582 |
< |
value="1.3"/> |
582 |
> |
value="2.2"/> |
583 |
|
|
584 |
< |
<condition property="build.novariance" value="-novariance"> |
584 |
> |
<condition property="novariance.arg" value="-novariance"> |
585 |
|
<and> |
586 |
|
<equals arg1="${gjc.version}" arg2="2.0"/> |
587 |
|
<or> |
591 |
|
</and> |
592 |
|
</condition> |
593 |
|
|
594 |
< |
<property name="build.novariance" |
594 |
> |
<property name="novariance.arg" |
595 |
|
value=""/> |
596 |
|
|
597 |
|
<property name="gjc.dir" |
601 |
|
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
602 |
|
|
603 |
|
<property name="collect.jar" |
604 |
< |
location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/> |
604 |
> |
location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/> |
605 |
|
|
606 |
|
|
607 |
< |
<condition property="build.warnunchecked" value="-warnunchecked"> |
607 |
> |
<condition property="warnunchecked.arg" value="-warnunchecked"> |
608 |
|
<istrue value="${gjc.warnunchecked}"/> |
609 |
|
</condition> |
610 |
|
|
611 |
< |
<property name="build.warnunchecked" value=""/> |
611 |
> |
<property name="warnunchecked.arg" value=""/> |
612 |
> |
|
613 |
> |
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
614 |
> |
<istrue value="${build.nothreads}"/> |
615 |
> |
</condition> |
616 |
|
|
617 |
|
|
618 |
|
<!-- |
619 |
|
! Bootclasspath munging for source compilation. |
620 |
|
--> |
621 |
|
|
622 |
< |
<path id="javac.bootclasspath.prefix"> |
489 |
< |
<!-- <pathelement location="${src.dir}"/> --> |
622 |
> |
<path id="pre.bootclasspath"> |
623 |
|
<pathelement location="${javac.jar}"/> |
624 |
|
</path> |
625 |
|
|
626 |
< |
<path id="javac.bootclasspath"> |
627 |
< |
<!-- <pathelement location="${src.dir}"/> --> |
626 |
> |
<path id="compile.bootclasspath"> |
627 |
> |
<pathelement location="${build.classes.dir}"/> |
628 |
|
<pathelement location="${collect.jar}"/> |
629 |
|
<pathelement location="${rt.jar}"/> |
630 |
|
</path> |
631 |
|
|
632 |
< |
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
633 |
< |
<property name="javac.bootclasspath.prefix" |
634 |
< |
refid="javac.bootclasspath.prefix"/> |
502 |
< |
|
503 |
< |
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
504 |
< |
<property name="build.bootclasspath.arg" |
505 |
< |
value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
506 |
< |
|
507 |
< |
<!-- Flatten bootclasspath for trace message --> |
508 |
< |
<property name="javac.bootclasspath" |
509 |
< |
refid="javac.bootclasspath"/> |
632 |
> |
<!-- Flatten paths into platform-appropriate strings --> |
633 |
> |
<property name="pre.bootclasspath" refid="pre.bootclasspath"/> |
634 |
> |
<property name="compile.bootclasspath" refid="compile.bootclasspath"/> |
635 |
|
|
511 |
– |
<!-- Common options in javac invocations --> |
512 |
– |
<property name="build.javac.args" |
513 |
– |
value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/> |
636 |
|
|
637 |
< |
<echo>javac ${build.javac.args}</echo> |
638 |
< |
<echo>bootclasspath=${javac.bootclasspath}</echo> |
637 |
> |
<!-- Common options in javac invocations --> |
638 |
> |
<property name="gjc.args" |
639 |
> |
value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}" |
640 |
> |
/> |
641 |
|
|
642 |
|
</target> |
643 |
|
|
644 |
|
|
521 |
– |
<target name="configure-src"> |
522 |
– |
|
523 |
– |
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
524 |
– |
<istrue value="${build.nothreads}"/> |
525 |
– |
</condition> |
526 |
– |
|
527 |
– |
</target> |
528 |
– |
|
645 |
|
<target name="prepare-src" |
646 |
< |
depends="configure-src" |
646 |
> |
depends="configure-compiler" |
647 |
|
if="prepare.src.dir"> |
648 |
|
|
649 |
|
<mkdir dir="${prepare.src.dir}"/> |
673 |
|
</target> |
674 |
|
|
675 |
|
|
676 |
< |
<target name="configure-tests"> |
676 |
> |
<target name="configure-tests" |
677 |
> |
depends="configure-compiler"> |
678 |
|
|
679 |
|
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
680 |
|
<available property="junit.available" |
695 |
|
<pathelement location="${junit.jar}"/> |
696 |
|
</path> |
697 |
|
|
698 |
< |
<!-- Flatten test classpath into a platform-appropriate string --> |
699 |
< |
<property name="test.classpath" refid="test.classpath"/> |
698 |
> |
<path id="test.compile.bootclasspath"> |
699 |
> |
<pathelement location="${javac.jar}"/> |
700 |
> |
<pathelement location="${collect.jar}"/> |
701 |
> |
<pathelement location="${rt.jar}"/> |
702 |
> |
</path> |
703 |
> |
|
704 |
> |
<path id="test.run.bootclasspath"> |
705 |
> |
<pathelement location="${javac.jar}"/> |
706 |
> |
<path refid="test.classpath"/> |
707 |
> |
</path> |
708 |
|
|
709 |
< |
<!-- Turn the flattened test classpath into a javac argument --> |
710 |
< |
<property name="test.bootclasspath.arg" |
711 |
< |
value='-Xbootclasspath/p:${test.classpath}'/> |
709 |
> |
<!-- Flatten test classpaths into platform-appropriate strings --> |
710 |
> |
<property name="test.classpath" refid="test.classpath"/> |
711 |
> |
<property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/> |
712 |
> |
<property name="test.run.bootclasspath" refid="test.run.bootclasspath"/> |
713 |
|
|
714 |
|
</target> |
715 |
|
|
740 |
|
</target> |
741 |
|
|
742 |
|
|
743 |
+ |
<target name="ng" depends="test"> |
744 |
+ |
<java classname="SuperfluousAbstract" fork="true"> |
745 |
+ |
|
746 |
+ |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
747 |
+ |
|
748 |
+ |
</java> |
749 |
+ |
</target> |
750 |
+ |
|
751 |
+ |
|
752 |
|
</project> |