30 |
|
<!-- Build locations --> |
31 |
|
<property name="build.dir" location="build"/> |
32 |
|
<property name="build.classes.dir" location="${build.dir}/classes"/> |
33 |
– |
<property name="build.emulation.dir" location="${build.dir}/emulation"/> |
33 |
|
<property name="build.testcases.dir" location="${build.dir}/testcases"/> |
34 |
|
<property name="build.lib.dir" location="${build.dir}/lib"/> |
35 |
|
<property name="build.ant.dir" location="${build.dir}/ant"/> |
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"/> |
42 |
> |
<property name="build.dc-filter.dir" location="${build.dir}/filterdocchk"/> |
43 |
> |
<property name="build.checkstyle.dir" location="${build.dir}/checkstyle"/> |
44 |
|
|
45 |
|
<!-- Source locations --> |
46 |
|
<property name="src.dir" location="${basedir}/src/main"/> |
47 |
– |
<property name="emulation.src.dir" location="${basedir}/src/emulation"/> |
47 |
|
<property name="test.src.dir" location="${basedir}/src/test"/> |
48 |
|
<property name="ant.src.dir" location="${basedir}/etc/ant"/> |
49 |
|
<property name="stylesheet.dir" location="${basedir}/etc/xsl"/> |
60 |
|
<property name="sinjdoc.jar" location="${lib.dir}/sinjdoc.jar"/> |
61 |
|
|
62 |
|
|
63 |
< |
<!-- Files excluded from dist-docs and emulation jar --> |
64 |
< |
<patternset id="unsafe.exclusion"> |
63 |
> |
<!-- Files excluded from dist-docs --> |
64 |
> |
<patternset id="docs.exclusion"> |
65 |
|
<exclude name="java/util/Random.*"/> |
66 |
|
<exclude name="sun/misc/Unsafe.*"/> |
67 |
|
</patternset> |
68 |
|
|
70 |
– |
<!-- Files excludes from emulation jar --> |
71 |
– |
<patternset id="atomic.exclusion"> |
72 |
– |
<exclude name="java/util/concurrent/atomic/AtomicBoolean*"/> |
73 |
– |
<exclude name="java/util/concurrent/atomic/AtomicInteger*"/> |
74 |
– |
<exclude name="java/util/concurrent/atomic/AtomicLong*"/> |
75 |
– |
<exclude name="java/util/concurrent/atomic/AtomicReference*"/> |
76 |
– |
<exclude name="java/util/concurrent/locks/LockSupport*"/> |
77 |
– |
<exclude name="java/util/concurrent/locks/ReentrantLock*"/> |
78 |
– |
</patternset> |
79 |
– |
|
69 |
|
|
70 |
|
|
71 |
|
<!-- Main targets --> |
78 |
|
|
79 |
|
<mkdir dir="${build.classes.dir}"/> |
80 |
|
|
92 |
– |
<!-- |
93 |
– |
<echo>javac ${gjc.args}</echo> |
94 |
– |
<echo>bootclasspath=${compile.bootclasspath}</echo> |
95 |
– |
--> |
96 |
– |
|
81 |
|
<javac srcdir="${prepare.src.dir}" |
82 |
|
destdir="${build.classes.dir}" |
83 |
|
debug="${build.debug}" |
86 |
|
source="${build.sourcelevel}" |
87 |
|
fork="true"> |
88 |
|
|
89 |
< |
<compilerarg line="${gjc.args}"/> |
106 |
< |
<!-- |
107 |
< |
<bootclasspath refid="compile.bootclasspath"/> |
108 |
< |
--> |
89 |
> |
<compilerarg line="${build.args}"/> |
90 |
|
|
91 |
|
</javac> |
92 |
|
|
94 |
|
|
95 |
|
|
96 |
|
<target name="jar" |
97 |
< |
depends="configure-emulation, init-jar, native-jar, emulation-jar" |
97 |
> |
depends="init-jar, native-jar" |
98 |
|
description="Builds library jar from compiled sources"/> |
99 |
|
|
100 |
|
|
108 |
|
description="Reports on style errors in Java source (verbose, mostly chaff)"> |
109 |
|
|
110 |
|
<taskdef resource="checkstyletask.properties" |
111 |
< |
classpath="${lib.dir}/checkstyle-all-2.4.jar"/> |
111 |
> |
classpath="${lib.dir}/checkstyle-all-3.1.jar"/> |
112 |
|
|
113 |
< |
<checkstyle> |
114 |
< |
<formatter type="plain"/> <!-- also available: type="xml" --> |
113 |
> |
<mkdir dir="${build.checkstyle.dir}"/> |
114 |
> |
|
115 |
> |
<checkstyle config="etc/checkstyle/sun_checks.xml" |
116 |
> |
failOnViolation="false"> |
117 |
> |
<formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/> |
118 |
|
<fileset dir="${build.filter.src.dir}" includes="**/*.java"/> |
119 |
|
</checkstyle> |
120 |
+ |
|
121 |
+ |
<style in="${build.checkstyle.dir}/checkstyle-report.xml" |
122 |
+ |
out="${build.checkstyle.dir}/checkstyle-report.html" |
123 |
+ |
style="${stylesheet.dir}/checkstyle-frames.xsl"/> |
124 |
|
|
125 |
|
</target> |
126 |
|
|
135 |
|
<javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
136 |
|
docletpath="${lib.dir}/doccheck.jar" |
137 |
|
destdir="${build.doccheck.dir}"> |
138 |
< |
<packageset dir="${build.filter.doccheck.dir}"/> |
138 |
> |
<packageset dir="${build.dc-filter.dir}"/> |
139 |
|
</javadoc> |
140 |
|
|
141 |
|
<echo>DocCheck output is in ${build.doccheck.dir}</echo> |
157 |
|
|
158 |
|
<tag name="revised" description="Last revised:"/> |
159 |
|
<tag name="spec" description="Specified by:"/> |
172 |
– |
<tag name="editor" description="Last edited by:"/> |
173 |
– |
<tag name="fixme" description="FIX ME:"/> |
160 |
|
|
161 |
|
<packageset dir="${build.filter.src.dir}"/> |
162 |
|
|
174 |
|
|
175 |
|
<java classname="net.cscott.sinjdoc.Main" fork="true"> |
176 |
|
|
177 |
< |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
177 |
> |
<jvmarg value="-Xbootclasspath/p:${test.bootclasspath}"/> |
178 |
|
|
179 |
|
<classpath> |
180 |
|
<pathelement location="${sinjdoc.jar}"/> |
183 |
|
<path refid="test.classpath"/> |
184 |
|
</classpath> |
185 |
|
|
186 |
< |
|
186 |
> |
<!-- <arg value="-help"/> --> |
187 |
> |
<!-- <arg value="-verbose"/> --> |
188 |
> |
<!-- <arg value="-link"/> <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> --> |
189 |
> |
|
190 |
|
<arg value="-d"/> <arg value="${build.sinjdocs.dir}"/> |
191 |
|
<arg value="-sourcepath"/> <arg value="${src.dir}"/> |
192 |
|
<arg value="-overview"/> <arg value="${src.dir}/intro.html"/> |
193 |
|
<arg value="-source"/> <arg value="${build.sourcelevel}"/> |
194 |
< |
<!-- <arg value="-verbose"/> --> |
206 |
< |
<!-- <arg value="-link"/> <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> --> |
194 |
> |
|
195 |
|
<arg value="java.lang"/> |
196 |
|
<arg value="java.util"/> |
197 |
|
<arg value="java.util.concurrent"/> |
198 |
|
<arg value="java.util.concurrent.atomic"/> |
199 |
|
<arg value="java.util.concurrent.locks"/> |
200 |
|
|
213 |
– |
<!-- |
214 |
– |
<arg value="-help"/> |
215 |
– |
--> |
201 |
|
|
202 |
|
</java> |
203 |
|
|
204 |
|
</target> |
205 |
|
|
206 |
|
|
222 |
– |
<target name="strip" |
223 |
– |
depends="init, configure-compiler" |
224 |
– |
description="Strip generics from java source (not working yet)"> |
225 |
– |
|
226 |
– |
<mkdir dir="${build.stripped.dir}"/> |
227 |
– |
|
228 |
– |
<!-- |
229 |
– |
# javac -s doesn't reliably generate compilable code. It generates |
230 |
– |
# bridge methods (marked as "synthetic") that can have identical |
231 |
– |
# signatures to existing methods except for the return value. |
232 |
– |
--> |
233 |
– |
<javac srcdir="${src.dir}" |
234 |
– |
destdir="${build.stripped.dir}" |
235 |
– |
debug="${build.debug}" |
236 |
– |
debuglevel="${build.debuglevel}" |
237 |
– |
deprecation="${build.deprecation}" |
238 |
– |
source="${build.sourcelevel}" |
239 |
– |
fork="true"> |
240 |
– |
|
241 |
– |
<compilerarg line="${gjc.args} -s"/> |
242 |
– |
<!-- |
243 |
– |
<bootclasspath refid="compile.bootclasspath"/> |
244 |
– |
--> |
245 |
– |
|
246 |
– |
</javac> |
247 |
– |
|
248 |
– |
</target> |
249 |
– |
|
250 |
– |
|
207 |
|
<target name="dist" |
208 |
|
depends="init, dist-clean, dist-jar, dist-docs" |
209 |
|
description="Puts all distributable products in single hierarchy"/> |
210 |
|
|
211 |
+ |
|
212 |
|
<target name="release" |
213 |
|
depends="dist" |
214 |
|
description="Puts entire CVS tree, plus distribution productions, in a jar"> |
215 |
|
|
259 |
– |
<!-- |
260 |
– |
#keep build dir? - dl |
261 |
– |
<delete dir="${build.dir}"/> |
262 |
– |
--> |
216 |
|
<property name="release.jar" value="dist/jsr166-${version}-dist.jar"/> |
217 |
|
|
218 |
|
<jar basedir="${basedir}" destfile="${release.jar}"> |
219 |
+ |
<!-- <exclude name="build/**"/> --> |
220 |
|
<exclude name="${release.jar}"/> |
221 |
|
<exclude name="user.properties"/> |
222 |
|
<exclude name="etc/notes/**"/> |
223 |
< |
<exclude name="lib/gjc/2.1/**"/> |
223 |
> |
<exclude name="src/emulation/**"/> |
224 |
|
<exclude name="**/SyntaxTest.java"/> |
225 |
+ |
<exclude name="**/SuperfluousAbstract.java"/> |
226 |
|
</jar> |
227 |
|
|
228 |
|
</target> |
286 |
|
|
287 |
|
|
288 |
|
<target name="native-jar" |
289 |
< |
depends="compile" |
335 |
< |
unless="build.emulation.true"> |
289 |
> |
depends="compile"> |
290 |
|
|
291 |
|
<jar destfile="${product.jar}"> |
292 |
|
<fileset dir="${build.classes.dir}"/> |
295 |
|
</target> |
296 |
|
|
297 |
|
|
344 |
– |
<target name="compile-emulation" |
345 |
– |
depends="init, configure-compiler" |
346 |
– |
if="build.emulation.true"> |
347 |
– |
|
348 |
– |
<mkdir dir="${build.emulation.dir}"/> |
349 |
– |
|
350 |
– |
<javac srcdir="${emulation.src.dir}" |
351 |
– |
destdir="${build.emulation.dir}" |
352 |
– |
debug="${build.debug}" |
353 |
– |
debuglevel="${build.debuglevel}" |
354 |
– |
deprecation="${build.deprecation}" |
355 |
– |
source="${build.sourcelevel}" |
356 |
– |
fork="true"> |
357 |
– |
|
358 |
– |
<compilerarg line="${gjc.args}"/> |
359 |
– |
<!-- |
360 |
– |
<bootclasspath refid="compile.bootclasspath"/> |
361 |
– |
--> |
362 |
– |
|
363 |
– |
</javac> |
364 |
– |
|
365 |
– |
</target> |
366 |
– |
|
367 |
– |
|
368 |
– |
<target name="emulation-jar" |
369 |
– |
depends="compile-emulation" |
370 |
– |
if="build.emulation.true"> |
371 |
– |
|
372 |
– |
|
373 |
– |
<jar destfile="${product.jar}" duplicate="add"> |
374 |
– |
<fileset dir="${build.classes.dir}"> |
375 |
– |
<patternset refid="atomic.exclusion"/> |
376 |
– |
<patternset refid="unsafe.exclusion"/> |
377 |
– |
</fileset> |
378 |
– |
<fileset dir="${build.emulation.dir}"/> |
379 |
– |
</jar> |
380 |
– |
|
381 |
– |
</target> |
382 |
– |
|
383 |
– |
|
298 |
|
<target name="dist-jar" |
299 |
|
depends="clean, jar"> |
300 |
|
|
330 |
|
<copy todir="${build.filter.src.dir}"> |
331 |
|
<fileset dir="${src.dir}"> |
332 |
|
<exclude name="**/*.html"/> |
333 |
< |
<patternset refid="unsafe.exclusion"/> |
333 |
> |
<patternset refid="docs.exclusion"/> |
334 |
|
</fileset> |
335 |
|
<filterchain> |
336 |
|
|
353 |
|
<param name="replacement" value=" "/> |
354 |
|
</filterreader> |
355 |
|
|
442 |
– |
|
443 |
– |
<!-- |
444 |
– |
# This filter uncomments lines beginning with "//@" so that |
445 |
– |
# javadoc can see imports that are needed to resolve links |
446 |
– |
# but that shouldn't be in the compiled code. |
447 |
– |
--> |
448 |
– |
|
449 |
– |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
450 |
– |
classpath="${build.ant.dir}"> |
451 |
– |
<param name="matching" value="^//@.*$"/> |
452 |
– |
<param name="pattern" value="^//@"/> |
453 |
– |
<param name="replacement" value=""/> |
454 |
– |
</filterreader> |
356 |
|
</filterchain> |
357 |
|
</copy> |
358 |
|
|
359 |
|
</target> |
360 |
|
|
361 |
|
|
461 |
– |
|
462 |
– |
|
362 |
|
<target name="filter-doccheck" |
363 |
|
depends="filter-src"> |
364 |
|
|
365 |
< |
<mkdir dir="${build.filter.doccheck.dir}"/> |
365 |
> |
<mkdir dir="${build.dc-filter.dir}"/> |
366 |
|
|
367 |
< |
<copy todir="${build.filter.doccheck.dir}"> |
367 |
> |
<copy todir="${build.dc-filter.dir}"> |
368 |
|
<fileset dir="${build.filter.src.dir}"> |
369 |
|
<include name="**/*.html"/> |
370 |
|
</fileset> |
374 |
|
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 {}" |
375 |
|
/> |
376 |
|
|
377 |
< |
<copy todir="${build.filter.doccheck.dir}"> |
377 |
> |
<copy todir="${build.dc-filter.dir}"> |
378 |
|
<fileset dir="${build.filter.src.dir}"> |
379 |
|
<exclude name="**/*.html"/> |
380 |
|
</fileset> |
412 |
|
|
413 |
|
<mkdir dir="${build.testcases.dir}"/> |
414 |
|
|
516 |
– |
<!-- |
517 |
– |
<echo>javac ${gjc.args}</echo> |
518 |
– |
<echo>bootclasspath=${test.compile.bootclasspath}</echo> |
519 |
– |
<echo>classpath="${test.classpath}"</echo> |
520 |
– |
--> |
521 |
– |
|
415 |
|
<javac srcdir="${test.src.dir}" |
416 |
|
destdir="${build.testcases.dir}" |
417 |
|
debug="${build.debug}" |
420 |
|
source="${build.sourcelevel}" |
421 |
|
fork="true"> |
422 |
|
|
423 |
< |
<compilerarg line="${gjc.args}"/> |
424 |
< |
<!-- |
532 |
< |
<bootclasspath refid="test.compile.bootclasspath"/> |
533 |
< |
--> |
534 |
< |
<classpath refid="test.classpath"/> |
423 |
> |
<compilerarg line="${build.args}"/> |
424 |
> |
<classpath refid="test.classpath"/> |
425 |
|
|
426 |
|
<include name="java/**"/> |
427 |
|
<include name="jsr166/**"/> |
446 |
|
dir="${build.reports.dir}" |
447 |
|
fork="true"> |
448 |
|
|
449 |
< |
<jvmarg value="-Xbootclasspath:${test.run.bootclasspath}"/> |
449 |
> |
<jvmarg value="-Xbootclasspath:${test.bootclasspath}"/> |
450 |
|
|
451 |
|
<formatter type="xml"/> |
452 |
|
|
490 |
|
|
491 |
|
<target name="configure-compiler"> |
492 |
|
|
603 |
– |
<property name="gjc.version" |
604 |
– |
value="2.2"/> |
605 |
– |
|
606 |
– |
<condition property="novariance.arg" value="-novariance"> |
607 |
– |
<and> |
608 |
– |
<equals arg1="${gjc.version}" arg2="2.0"/> |
609 |
– |
<or> |
610 |
– |
<not><isset property="gjc.novariance"/></not> |
611 |
– |
<istrue value="${gjc.novariance}"/> |
612 |
– |
</or> |
613 |
– |
</and> |
614 |
– |
</condition> |
615 |
– |
|
616 |
– |
<property name="novariance.arg" |
617 |
– |
value=""/> |
618 |
– |
|
619 |
– |
<property name="gjc.dir" |
620 |
– |
value="${lib.dir}/gjc"/> |
621 |
– |
|
622 |
– |
<property name="javac.jar" |
623 |
– |
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
624 |
– |
|
625 |
– |
<property name="collect.jar" |
626 |
– |
location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/> |
627 |
– |
|
628 |
– |
<!-- |
629 |
– |
<property name="unchecked.option" value="-warnunchecked"/> |
630 |
– |
--> |
631 |
– |
|
493 |
|
<property name="unchecked.option" value="-Xlint:unchecked"/> |
494 |
|
|
495 |
|
<condition property="warnunchecked.arg" value="${unchecked.option}"> |
496 |
< |
<istrue value="${gjc.warnunchecked}"/> |
496 |
> |
<istrue value="${build.warnunchecked}"/> |
497 |
|
</condition> |
498 |
|
|
499 |
|
<property name="warnunchecked.arg" value=""/> |
503 |
|
</condition> |
504 |
|
|
505 |
|
|
645 |
– |
<!-- |
646 |
– |
! Bootclasspath munging for source compilation. |
647 |
– |
--> |
648 |
– |
|
649 |
– |
<path id="pre.bootclasspath"> |
650 |
– |
<!-- |
651 |
– |
<pathelement location="${javac.jar}"/> |
652 |
– |
--> |
653 |
– |
</path> |
654 |
– |
|
655 |
– |
<path id="compile.bootclasspath"> |
656 |
– |
<pathelement location="${build.classes.dir}"/> |
657 |
– |
<!-- |
658 |
– |
<pathelement location="${collect.jar}"/> |
659 |
– |
--> |
660 |
– |
<pathelement location="${rt.jar}"/> |
661 |
– |
</path> |
662 |
– |
|
663 |
– |
<!-- Flatten paths into platform-appropriate strings --> |
664 |
– |
<property name="pre.bootclasspath" refid="pre.bootclasspath"/> |
665 |
– |
<property name="compile.bootclasspath" refid="compile.bootclasspath"/> |
666 |
– |
|
667 |
– |
|
506 |
|
<!-- Common options in javac invocations --> |
507 |
< |
<!-- |
670 |
< |
<property name="gjc.args" |
671 |
< |
value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}" |
672 |
< |
/> |
673 |
< |
--> |
674 |
< |
<property name="gjc.args" value="${warnunchecked.arg} ${novariance.arg}"/> |
507 |
> |
<property name="build.args" value="${warnunchecked.arg}"/> |
508 |
|
|
509 |
|
</target> |
510 |
|
|
523 |
|
</target> |
524 |
|
|
525 |
|
|
693 |
– |
<target name="configure-emulation"> |
694 |
– |
|
695 |
– |
<condition property="build.emulation.true"> |
696 |
– |
<or> |
697 |
– |
<and> |
698 |
– |
<os family="windows"/> |
699 |
– |
<not> |
700 |
– |
<isset property="build.emulation"/> |
701 |
– |
</not> |
702 |
– |
</and> |
703 |
– |
<istrue value="${build.emulation}"/> |
704 |
– |
</or> |
705 |
– |
</condition> |
706 |
– |
|
707 |
– |
</target> |
708 |
– |
|
709 |
– |
|
526 |
|
<target name="configure-tests" |
527 |
|
depends="configure-compiler"> |
528 |
|
|
549 |
|
<path id="test.classpath"> |
550 |
|
<pathelement location="${product.jar}"/> |
551 |
|
<pathelement location="${rt.jar}"/> |
736 |
– |
<pathelement location="${build.testcases.dir}"/> |
552 |
|
<pathelement location="${junit.jar}"/> |
553 |
+ |
<pathelement location="${build.testcases.dir}"/> |
554 |
|
</path> |
555 |
|
|
556 |
< |
<path id="test.compile.bootclasspath"> |
741 |
< |
<pathelement location="${javac.jar}"/> |
742 |
< |
<pathelement location="${collect.jar}"/> |
743 |
< |
<pathelement location="${rt.jar}"/> |
744 |
< |
</path> |
745 |
< |
|
746 |
< |
<path id="test.run.bootclasspath"> |
747 |
< |
<!-- |
748 |
< |
<pathelement location="${javac.jar}"/> |
749 |
< |
--> |
556 |
> |
<path id="test.bootclasspath"> |
557 |
|
<path refid="test.classpath"/> |
558 |
|
</path> |
559 |
|
|
560 |
|
<!-- Flatten test classpaths into platform-appropriate strings --> |
561 |
< |
<property name="test.classpath" refid="test.classpath"/> |
562 |
< |
<property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/> |
756 |
< |
<property name="test.run.bootclasspath" refid="test.run.bootclasspath"/> |
561 |
> |
<property name="test.classpath" refid="test.classpath"/> |
562 |
> |
<property name="test.bootclasspath" refid="test.bootclasspath"/> |
563 |
|
|
564 |
|
</target> |
565 |
|
|
614 |
|
<target name="ng" depends="test"> |
615 |
|
<java classname="SuperfluousAbstract" fork="true"> |
616 |
|
|
617 |
< |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
617 |
> |
<jvmarg value="-Xbootclasspath/p:${test.bootclasspath}"/> |
618 |
|
|
619 |
|
</java> |
620 |
|
</target> |