1 |
< |
<project name="jsr166" default="jar"> |
1 |
> |
<project name="jsr166" default="usage"> |
2 |
|
|
3 |
|
<description> |
4 |
+ |
------------------------------------------------------------------------------ |
5 |
+ |
Build file for JSR-166 |
6 |
|
|
7 |
< |
Build file for JSR-166 |
6 |
< |
|
7 |
< |
Note that junit.jar must be in ${ant.home}/lib for the |
8 |
< |
test target to work. [FIXME: This should be automatically |
9 |
< |
enforced by this build file by failing with a message if |
10 |
< |
junit.jar is not in the right place.] |
7 |
> |
Usage: ant [target] |
8 |
|
|
9 |
+ |
User-specific settings are read from user.properties. |
10 |
+ |
See user.properties.sample for an explanation of some useful settings. |
11 |
+ |
------------------------------------------------------------------------------ |
12 |
|
</description> |
13 |
|
|
14 |
+ |
<target name="usage" description="Advises user to run with -projecthelp"> |
15 |
+ |
<echo>Run "ant -projecthelp" for full usage information.</echo> |
16 |
+ |
</target> |
17 |
+ |
|
18 |
+ |
|
19 |
+ |
<!-- User-specific settings --> |
20 |
+ |
<property file="user.properties"/> |
21 |
+ |
|
22 |
+ |
|
23 |
|
<!-- Compilation options --> |
24 |
|
<property name="build.sourcelevel" value="1.5"/> |
25 |
+ |
<property name="build.docsourcelevel" value="1.4"/> |
26 |
|
<property name="build.debug" value="true"/> |
27 |
|
<property name="build.debuglevel" value="source,lines,vars"/> |
28 |
|
<property name="build.deprecation" value="false"/> |
19 |
– |
<!-- |
20 |
– |
<property name="build.warnings" value="true"/> |
21 |
– |
--> |
29 |
|
|
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"/> |
34 |
|
<property name="build.testcases.dir" location="${build.dir}/testcases"/> |
35 |
|
<property name="build.lib.dir" location="${build.dir}/lib"/> |
36 |
|
<property name="build.ant.dir" location="${build.dir}/ant"/> |
37 |
|
<property name="build.javadocs.dir" location="${build.dir}/javadocs"/> |
38 |
+ |
<property name="build.sinjdocs.dir" location="${build.dir}/sinjdocs"/> |
39 |
+ |
<property name="build.stripped.dir" location="${build.dir}/stripped"/> |
40 |
|
<property name="build.reports.dir" location="${build.dir}/reports"/> |
41 |
+ |
<property name="build.doccheck.dir" location="${build.dir}/doccheck"/> |
42 |
|
<property name="build.filter.src.dir" location="${build.dir}/filtersrc"/> |
43 |
+ |
<property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/> |
44 |
|
|
45 |
|
<!-- Source locations --> |
46 |
< |
<property name="src.dir" location="${basedir}"/> |
47 |
< |
<property name="test.src.dir" location="${basedir}/etc/testcases"/> |
46 |
> |
<property name="src.dir" location="${basedir}/src/main"/> |
47 |
> |
<property name="emulation.src.dir" location="${basedir}/src/emulation"/> |
48 |
> |
<property name="test.src.dir" location="${basedir}/src/test"/> |
49 |
|
<property name="ant.src.dir" location="${basedir}/etc/ant"/> |
50 |
|
<property name="stylesheet.dir" location="${basedir}/etc/xsl"/> |
51 |
|
<property name="lib.dir" location="${basedir}/lib"/> |
56 |
|
|
57 |
|
<!-- Jar locations --> |
58 |
|
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
46 |
– |
<property name="javac.jar" location="${lib.dir}/javac.jar"/> |
47 |
– |
<property name="collect.jar" location="${lib.dir}/collect.jar"/> |
59 |
|
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
60 |
|
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
61 |
+ |
<property name="sinjdoc.jar" location="${lib.dir}/sinjdoc.jar"/> |
62 |
|
|
51 |
– |
<property name="javac.args" value='-J-Xbootclasspath/p:${javac.jar}'/> |
63 |
|
|
64 |
< |
<path id="javac.bootclasspath"> |
65 |
< |
<pathelement location="${collect.jar}"/> |
66 |
< |
<pathelement location="${rt.jar}"/> |
67 |
< |
</path> |
68 |
< |
|
69 |
< |
<path id="test.classpath"> |
70 |
< |
<pathelement location="${product.jar}"/> |
71 |
< |
</path> |
64 |
> |
<!-- Files excluded from dist-docs and emulation jar --> |
65 |
> |
<patternset id="unsafe.exclusion"> |
66 |
> |
<exclude name="java/util/Random.*"/> |
67 |
> |
<exclude name="sun/misc/Unsafe.*"/> |
68 |
> |
</patternset> |
69 |
> |
|
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 |
> |
|
80 |
|
|
81 |
|
|
82 |
|
<!-- Main targets --> |
83 |
|
|
84 |
< |
<target name="compile" depends="init" |
85 |
< |
description="Compiles all sources to build folder"> |
84 |
> |
<target name="compile" |
85 |
> |
depends="init, configure-compiler, prepare-src" |
86 |
> |
description="Compiles main sources to build folder"> |
87 |
> |
|
88 |
> |
<property name="prepare.src.dir" value="${src.dir}"/> |
89 |
> |
|
90 |
|
<mkdir dir="${build.classes.dir}"/> |
91 |
< |
<javac srcdir="${src.dir}" |
91 |
> |
|
92 |
> |
<!-- |
93 |
> |
<echo>javac ${gjc.args}</echo> |
94 |
> |
<echo>bootclasspath=${compile.bootclasspath}</echo> |
95 |
> |
--> |
96 |
> |
|
97 |
> |
<javac srcdir="${prepare.src.dir}" |
98 |
|
destdir="${build.classes.dir}" |
99 |
|
debug="${build.debug}" |
100 |
|
debuglevel="${build.debuglevel}" |
102 |
|
source="${build.sourcelevel}" |
103 |
|
fork="true"> |
104 |
|
|
105 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
106 |
< |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
107 |
< |
|
108 |
< |
<!-- need this because srcdir is basedir! --> |
80 |
< |
<include name="java/**/*.java"/> |
105 |
> |
<compilerarg line="${gjc.args}"/> |
106 |
> |
<!-- |
107 |
> |
<bootclasspath refid="compile.bootclasspath"/> |
108 |
> |
--> |
109 |
|
|
110 |
|
</javac> |
111 |
+ |
|
112 |
|
</target> |
113 |
|
|
114 |
|
|
115 |
< |
<target name="jar" depends="compile" |
116 |
< |
description="Builds library jar from compiled sources"> |
117 |
< |
<mkdir dir="${build.lib.dir}"/> |
118 |
< |
<jar basedir="${build.classes.dir}" |
119 |
< |
destfile="${product.jar}" |
120 |
< |
/> |
115 |
> |
<target name="jar" |
116 |
> |
depends="configure-emulation, init-jar, native-jar, emulation-jar" |
117 |
> |
description="Builds library jar from compiled sources"/> |
118 |
> |
|
119 |
> |
|
120 |
> |
<target name="test" |
121 |
> |
depends="init, configure-tests, report-tests" |
122 |
> |
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
123 |
> |
|
124 |
> |
|
125 |
> |
<target name="checkstyle" |
126 |
> |
depends="filter-src" |
127 |
> |
description="Reports on style errors in Java source (verbose, mostly chaff)"> |
128 |
> |
|
129 |
> |
<taskdef resource="checkstyletask.properties" |
130 |
> |
classpath="${lib.dir}/checkstyle-all-2.4.jar"/> |
131 |
> |
|
132 |
> |
<checkstyle> |
133 |
> |
<formatter type="plain"/> <!-- also available: type="xml" --> |
134 |
> |
<fileset dir="${build.filter.src.dir}" includes="**/*.java"/> |
135 |
> |
</checkstyle> |
136 |
> |
|
137 |
|
</target> |
138 |
|
|
139 |
|
|
140 |
< |
<target name="test" depends="init, report-tests" |
141 |
< |
description="Runs all tests"/> |
140 |
> |
<target name="doccheck" |
141 |
> |
depends="filter-doccheck" |
142 |
> |
description="Reports on javadoc style errors"> |
143 |
> |
|
144 |
> |
<delete dir="${build.doccheck.dir}"/> |
145 |
> |
<mkdir dir="${build.doccheck.dir}"/> |
146 |
> |
|
147 |
> |
<javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
148 |
> |
docletpath="${lib.dir}/doccheck.jar" |
149 |
> |
destdir="${build.doccheck.dir}"> |
150 |
> |
<packageset dir="${build.filter.doccheck.dir}"/> |
151 |
> |
</javadoc> |
152 |
> |
|
153 |
> |
<echo>DocCheck output is in ${build.doccheck.dir}</echo> |
154 |
> |
|
155 |
> |
</target> |
156 |
|
|
157 |
|
|
158 |
< |
<target name="docs" depends="init, clean-filtered-src, filter-src" |
158 |
> |
<target name="docs" |
159 |
> |
depends="filter-src" |
160 |
|
description="Builds javadocs with custom tags to build folder"> |
161 |
+ |
|
162 |
|
<delete dir="${build.javadocs.dir}"/> |
163 |
|
<mkdir dir="${build.javadocs.dir}"/> |
164 |
+ |
|
165 |
|
<javadoc destdir="${build.javadocs.dir}" |
166 |
|
link="http://java.sun.com/j2se/1.4.1/docs/api" |
167 |
|
overview="${src.dir}/intro.html" |
168 |
< |
source="${build.sourcelevel}"> |
168 |
> |
source="${build.docsourcelevel}"> |
169 |
|
|
170 |
|
<tag name="revised" description="Last revised:"/> |
171 |
< |
<tag name="spec" description="Specified by:"/> |
172 |
< |
<tag name="editor" description="Last edited by:"/> |
173 |
< |
<tag name="fixme" description="FIX ME:"/> |
174 |
< |
<packageset dir="${build.filter.src.dir}"> |
175 |
< |
<include name="java/**"/> |
114 |
< |
</packageset> |
171 |
> |
<tag name="spec" description="Specified by:"/> |
172 |
> |
<tag name="editor" description="Last edited by:"/> |
173 |
> |
<tag name="fixme" description="FIX ME:"/> |
174 |
> |
|
175 |
> |
<packageset dir="${build.filter.src.dir}"/> |
176 |
|
|
177 |
|
</javadoc> |
178 |
+ |
|
179 |
|
</target> |
180 |
|
|
181 |
|
|
182 |
< |
<target name="dist" depends="init, dist-clean, dist-jar, dist-docs"/> |
182 |
> |
<target name="sinjdocs" |
183 |
> |
depends="configure-tests" |
184 |
> |
description="Builds javadocs with custom tags to build folder"> |
185 |
> |
|
186 |
> |
<delete dir="${build.sinjdocs.dir}"/> |
187 |
> |
<mkdir dir="${build.sinjdocs.dir}"/> |
188 |
> |
|
189 |
> |
<java classname="net.cscott.sinjdoc.Main" fork="true"> |
190 |
> |
|
191 |
> |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
192 |
> |
|
193 |
> |
<classpath> |
194 |
> |
<pathelement location="${sinjdoc.jar}"/> |
195 |
> |
<pathelement location="${lib.dir}/jutil.jar"/> |
196 |
> |
<pathelement location="${lib.dir}/cup.jar"/> |
197 |
> |
<path refid="test.classpath"/> |
198 |
> |
</classpath> |
199 |
> |
|
200 |
> |
|
201 |
> |
<arg value="-d"/> <arg value="${build.sinjdocs.dir}"/> |
202 |
> |
<arg value="-sourcepath"/> <arg value="${src.dir}"/> |
203 |
> |
<arg value="-overview"/> <arg value="${src.dir}/intro.html"/> |
204 |
> |
<arg value="-source"/> <arg value="${build.sourcelevel}"/> |
205 |
> |
<!-- <arg value="-verbose"/> --> |
206 |
> |
<!-- <arg value="-link"/> <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> --> |
207 |
> |
<arg value="java.lang"/> |
208 |
> |
<arg value="java.util"/> |
209 |
> |
<arg value="java.util.concurrent"/> |
210 |
> |
<arg value="java.util.concurrent.atomic"/> |
211 |
> |
<arg value="java.util.concurrent.locks"/> |
212 |
> |
|
213 |
> |
<!-- |
214 |
> |
<arg value="-help"/> |
215 |
> |
--> |
216 |
> |
|
217 |
> |
</java> |
218 |
> |
|
219 |
> |
</target> |
220 |
> |
|
221 |
> |
|
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 |
|
|
251 |
+ |
<target name="dist" |
252 |
+ |
depends="init, dist-clean, dist-jar, dist-docs" |
253 |
+ |
description="Puts all distributable products in single hierarchy"/> |
254 |
+ |
|
255 |
+ |
<target name="release" |
256 |
+ |
depends="dist" |
257 |
+ |
description="Puts entire CVS tree, plus distribution productions, in a jar"> |
258 |
+ |
|
259 |
+ |
<!-- |
260 |
+ |
#keep build dir? - dl |
261 |
+ |
<delete dir="${build.dir}"/> |
262 |
+ |
--> |
263 |
+ |
<property name="release.jar" value="dist/jsr166-${version}-dist.jar"/> |
264 |
+ |
|
265 |
+ |
<jar basedir="${basedir}" destfile="${release.jar}"> |
266 |
+ |
<exclude name="${release.jar}"/> |
267 |
+ |
<exclude name="user.properties"/> |
268 |
+ |
<exclude name="etc/notes/**"/> |
269 |
+ |
<exclude name="lib/gjc/2.1/**"/> |
270 |
+ |
<exclude name="**/SyntaxTest.java"/> |
271 |
+ |
</jar> |
272 |
+ |
|
273 |
+ |
</target> |
274 |
|
|
275 |
|
<target name="clean" |
276 |
|
description="Removes all build products"> |
277 |
+ |
|
278 |
|
<delete dir="${build.dir}"/> |
279 |
|
<delete dir="${build.classes.dir}"/> |
280 |
|
<delete dir="${build.lib.dir}"/> |
281 |
+ |
|
282 |
|
</target> |
283 |
|
|
284 |
|
|
285 |
|
<target name="dist-clean" |
286 |
|
description="Removes all build and distribution products"> |
287 |
+ |
|
288 |
|
<delete dir="${dist.dir}"/> |
289 |
+ |
|
290 |
|
</target> |
291 |
|
|
292 |
|
|
293 |
< |
<!-- Internal targets --> |
293 |
> |
<target name="dist-docs" |
294 |
> |
depends="filter-src" |
295 |
> |
description="Builds javadocs without custom tags to dist folder"> |
296 |
|
|
297 |
< |
<target name="set-warnings-if" if="build.warnings"> |
298 |
< |
<property name="build.warnings.option" value="-warnunchecked"/> |
299 |
< |
</target> |
297 |
> |
<delete dir="${dist.javadocs.dir}"/> |
298 |
> |
<mkdir dir="${dist.javadocs.dir}"/> |
299 |
> |
|
300 |
> |
<javadoc destdir="${dist.javadocs.dir}" |
301 |
> |
link="http://java.sun.com/j2se/1.4.1/docs/api" |
302 |
> |
overview="${src.dir}/intro.html" |
303 |
> |
source="${build.docsourcelevel}"> |
304 |
> |
|
305 |
> |
<packageset dir="${build.filter.src.dir}"/> |
306 |
> |
|
307 |
> |
</javadoc> |
308 |
|
|
143 |
– |
<target name="set-warnings-unless" unless="build.warnings"> |
144 |
– |
<property name="build.warnings.option" value=""/> |
309 |
|
</target> |
310 |
|
|
311 |
< |
<target name="init" depends="set-warnings-if, set-warnings-unless"> |
311 |
> |
|
312 |
> |
|
313 |
> |
<!-- Internal targets --> |
314 |
> |
|
315 |
> |
|
316 |
> |
<target name="init"> |
317 |
> |
|
318 |
|
<!-- Version is kept in a separate file --> |
319 |
|
<loadfile property="version" srcFile="version.properties"/> |
320 |
|
<echo>Building JSR-166 version ${version}</echo> |
321 |
+ |
<echo>java.home is ${java.home}</echo> |
322 |
+ |
|
323 |
|
</target> |
324 |
|
|
325 |
|
|
326 |
< |
<target name="clean-filtered-src"> |
327 |
< |
<delete dir="${build.filter.src.dir}"/> |
326 |
> |
<target name="init-jar"> |
327 |
> |
|
328 |
> |
<mkdir dir="${build.lib.dir}"/> |
329 |
> |
|
330 |
|
</target> |
331 |
|
|
332 |
|
|
333 |
< |
<target name="dist-jar" depends="clean, jar"> |
334 |
< |
<copy file="${product.jar}" todir="${dist.dir}"/> |
333 |
> |
<target name="native-jar" |
334 |
> |
depends="compile" |
335 |
> |
unless="build.emulation.true"> |
336 |
> |
|
337 |
> |
<jar destfile="${product.jar}"> |
338 |
> |
<fileset dir="${build.classes.dir}"/> |
339 |
> |
</jar> |
340 |
> |
|
341 |
|
</target> |
342 |
|
|
343 |
|
|
344 |
< |
<target name="dist-docs" depends="clean-filtered-src, filter-src" |
345 |
< |
description="Builds javadocs without custom tags to dist folder"> |
346 |
< |
<delete dir="${dist.javadocs.dir}"/> |
167 |
< |
<mkdir dir="${dist.javadocs.dir}"/> |
168 |
< |
<javadoc destdir="${dist.javadocs.dir}" |
169 |
< |
link="http://java.sun.com/j2se/1.4.1/docs/api" |
170 |
< |
overview="${src.dir}/intro.html" |
171 |
< |
source="${build.sourcelevel}"> |
344 |
> |
<target name="compile-emulation" |
345 |
> |
depends="init, configure-compiler" |
346 |
> |
if="build.emulation.true"> |
347 |
|
|
348 |
< |
<packageset dir="${build.filter.src.dir}"> |
349 |
< |
<include name="java/**"/> |
350 |
< |
</packageset> |
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 |
|
|
177 |
– |
</javadoc> |
381 |
|
</target> |
382 |
|
|
383 |
|
|
384 |
< |
<target name="compile-ant-filter"> |
384 |
> |
<target name="dist-jar" |
385 |
> |
depends="clean, jar"> |
386 |
> |
|
387 |
> |
<copy file="${product.jar}" todir="${dist.dir}"/> |
388 |
> |
|
389 |
> |
</target> |
390 |
> |
|
391 |
> |
|
392 |
> |
<target name="compile-ant-filter" |
393 |
> |
depends="init"> |
394 |
> |
|
395 |
|
<mkdir dir="${build.ant.dir}"/> |
396 |
+ |
|
397 |
|
<javac srcdir="${ant.src.dir}" |
398 |
|
destdir="${build.ant.dir}" |
399 |
|
source="1.4" |
400 |
|
/> |
401 |
+ |
|
402 |
|
</target> |
403 |
|
|
404 |
|
|
405 |
< |
<target name="filter-src" depends="compile-ant-filter"> |
405 |
> |
<target name="filter-src" |
406 |
> |
depends="compile-ant-filter"> |
407 |
> |
|
408 |
|
<mkdir dir="${build.filter.src.dir}"/> |
409 |
+ |
|
410 |
|
<copy todir="${build.filter.src.dir}"> |
411 |
|
<fileset dir="${src.dir}"> |
412 |
< |
<include name="**/*.java"/> |
412 |
> |
<include name="**/*.html"/> |
413 |
> |
</fileset> |
414 |
> |
</copy> |
415 |
> |
|
416 |
> |
<copy todir="${build.filter.src.dir}"> |
417 |
> |
<fileset dir="${src.dir}"> |
418 |
> |
<exclude name="**/*.html"/> |
419 |
> |
<patternset refid="unsafe.exclusion"/> |
420 |
|
</fileset> |
421 |
|
<filterchain> |
422 |
+ |
|
423 |
+ |
<!-- |
424 |
+ |
# This filter gets rid of angle-bracketed type parameters |
425 |
+ |
# so that javadoc can run on the result. The following |
426 |
+ |
# heuristic seems to work: |
427 |
+ |
# |
428 |
+ |
# For all lines not starting with space(s)-asterisk-space(s), |
429 |
+ |
# replace <something> with a space, where there may be more |
430 |
+ |
# than one right angle bracket at the end, and "something" |
431 |
+ |
# must not contain parens or pipes. (This may need some |
432 |
+ |
# tweaking.) |
433 |
+ |
--> |
434 |
+ |
|
435 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
436 |
|
classpath="${build.ant.dir}"> |
199 |
– |
<!-- |
200 |
– |
# These arguments are to get rid of angle-bracketed type |
201 |
– |
# parameters so that javadoc can run on the result. The |
202 |
– |
# following heuristic that seems to work: |
203 |
– |
# |
204 |
– |
# For all lines not starting with space(s)-asterisk-space(s), |
205 |
– |
# replace <something> with a space, where there may be more |
206 |
– |
# than one right angle bracket at the end, and "something" |
207 |
– |
# must not contain parens or pipes. (This may need some |
208 |
– |
# tweaking.) |
209 |
– |
--> |
437 |
|
<param name="notmatching" value="^\s+\*\s.*$"/> |
438 |
< |
<param name="pattern" value="<[^|>()]+?>+"/> |
438 |
> |
<param name="pattern" value="<[^|>()]+?>+"/> |
439 |
|
<param name="replacement" value=" "/> |
440 |
|
</filterreader> |
441 |
+ |
|
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 |
< |
<!-- |
452 |
< |
# These arguments are to uncomment lines beginning with |
218 |
< |
# "//@" so that javadoc can see imports that are needed |
219 |
< |
# to resolve links but that shouldn't be in the compiled |
220 |
< |
# code. |
221 |
< |
--> |
222 |
< |
<param name="matching" value="^//@.*$"/> |
223 |
< |
<param name="pattern" value="^//@"/> |
451 |
> |
<param name="matching" value="^//@.*$"/> |
452 |
> |
<param name="pattern" value="^//@"/> |
453 |
|
<param name="replacement" value=""/> |
454 |
|
</filterreader> |
455 |
|
</filterchain> |
456 |
|
</copy> |
457 |
+ |
|
458 |
+ |
</target> |
459 |
+ |
|
460 |
+ |
|
461 |
+ |
|
462 |
+ |
|
463 |
+ |
<target name="filter-doccheck" |
464 |
+ |
depends="filter-src"> |
465 |
+ |
|
466 |
+ |
<mkdir dir="${build.filter.doccheck.dir}"/> |
467 |
+ |
|
468 |
+ |
<copy todir="${build.filter.doccheck.dir}"> |
469 |
+ |
<fileset dir="${build.filter.src.dir}"> |
470 |
+ |
<include name="**/*.html"/> |
471 |
+ |
</fileset> |
472 |
+ |
</copy> |
473 |
+ |
|
474 |
+ |
<property name="generic.declarations" |
475 |
+ |
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 {}" |
476 |
+ |
/> |
477 |
+ |
|
478 |
+ |
<copy todir="${build.filter.doccheck.dir}"> |
479 |
+ |
<fileset dir="${build.filter.src.dir}"> |
480 |
+ |
<exclude name="**/*.html"/> |
481 |
+ |
</fileset> |
482 |
+ |
<filterchain> |
483 |
+ |
<!-- |
484 |
+ |
# These two filters try to make the source look like |
485 |
+ |
# something that doccheck can process. The first removes |
486 |
+ |
# -source 1.4 assertions and the second adds in a bunch |
487 |
+ |
# of single letter public nested marker interfaces so that |
488 |
+ |
# the generic type parameters are recognized. |
489 |
+ |
--> |
490 |
+ |
|
491 |
+ |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
492 |
+ |
classpath="${build.ant.dir}"> |
493 |
+ |
<param name="matching" value="^\s*assert[\s ].*$"/> |
494 |
+ |
<param name="pattern" value="assert"/> |
495 |
+ |
<param name="replacement" value="//assert"/> |
496 |
+ |
</filterreader> |
497 |
+ |
|
498 |
+ |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
499 |
+ |
classpath="${build.ant.dir}"> |
500 |
+ |
<param name="matching" value="^([^*]*(class|interface|implements) .*|)\{.*$"/> |
501 |
+ |
<param name="pattern" value="$"/> |
502 |
+ |
<param name="replacement" value=" ${generic.declarations}"/> |
503 |
+ |
</filterreader> |
504 |
+ |
|
505 |
+ |
</filterchain> |
506 |
+ |
</copy> |
507 |
+ |
|
508 |
|
</target> |
509 |
|
|
510 |
|
|
511 |
< |
<target name="compile-tests" depends="jar"> |
511 |
> |
<target name="compile-tests" |
512 |
> |
depends="jar"> |
513 |
> |
|
514 |
|
<mkdir dir="${build.testcases.dir}"/> |
515 |
+ |
|
516 |
+ |
<!-- |
517 |
+ |
<echo>javac ${gjc.args}</echo> |
518 |
+ |
<echo>bootclasspath=${test.compile.bootclasspath}</echo> |
519 |
+ |
<echo>classpath="${test.classpath}"</echo> |
520 |
+ |
--> |
521 |
+ |
|
522 |
|
<javac srcdir="${test.src.dir}" |
523 |
|
destdir="${build.testcases.dir}" |
524 |
|
debug="${build.debug}" |
527 |
|
source="${build.sourcelevel}" |
528 |
|
fork="true"> |
529 |
|
|
530 |
< |
<bootclasspath refid="javac.bootclasspath"/> |
531 |
< |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
532 |
< |
<classpath refid="test.classpath"/> |
533 |
< |
<include name="**/*Test.java"/> |
530 |
> |
<compilerarg line="${gjc.args}"/> |
531 |
> |
<!-- |
532 |
> |
<bootclasspath refid="test.compile.bootclasspath"/> |
533 |
> |
--> |
534 |
> |
<classpath refid="test.classpath"/> |
535 |
> |
|
536 |
> |
<include name="java/**"/> |
537 |
> |
<include name="jsr166/**"/> |
538 |
|
|
539 |
|
</javac> |
540 |
+ |
|
541 |
|
</target> |
542 |
|
|
543 |
|
|
544 |
< |
<target name="run-tests" depends="compile-tests"> |
544 |
> |
<target name="run-tests" |
545 |
> |
depends="compile-tests"> |
546 |
> |
|
547 |
> |
<!-- May be overridden by user.properties --> |
548 |
> |
<property name="testcase" value="*"/> |
549 |
> |
|
550 |
|
<mkdir dir="${build.reports.dir}"/> |
551 |
+ |
|
552 |
|
<junit printsummary="true" |
553 |
|
showoutput="true" |
554 |
|
errorProperty="junit.failed" |
556 |
|
dir="${build.reports.dir}" |
557 |
|
fork="true"> |
558 |
|
|
559 |
< |
<jvmarg value="-Xbootclasspath/p:${product.jar}"/> |
260 |
< |
|
261 |
< |
<classpath> |
262 |
< |
<!-- <path refid="test.classpath"/> --> |
263 |
< |
<pathelement location="${build.testcases.dir}"/> |
264 |
< |
</classpath> |
559 |
> |
<jvmarg value="-Xbootclasspath:${test.run.bootclasspath}"/> |
560 |
|
|
561 |
|
<formatter type="xml"/> |
562 |
|
|
563 |
|
<batchtest todir="${build.reports.dir}"> |
564 |
|
<fileset dir="${test.src.dir}"> |
565 |
< |
<include name="**/*Test.java"/> |
565 |
> |
<include name="java/**/${testcase}Test.java"/> |
566 |
> |
<include name="jsr166/**/${testcase}Test.java"/> |
567 |
|
</fileset> |
568 |
|
</batchtest> |
569 |
|
|
570 |
|
</junit> |
571 |
+ |
|
572 |
|
</target> |
573 |
|
|
574 |
|
|
575 |
< |
<target name="report-tests" depends="run-tests"> |
576 |
< |
<!-- Sets junit.report.format to frames if Xalan is present, |
575 |
> |
<target name="report-tests" |
576 |
> |
depends="run-tests"> |
577 |
> |
|
578 |
> |
<!-- Sets junit.report.format to frames if redirection is present, |
579 |
|
otherwise sets it to noframes. --> |
580 |
|
<available property="junit.report.format" |
581 |
|
value="frames" |
594 |
|
</junitreport> |
595 |
|
|
596 |
|
<fail message="Test Cases Failed" if="junit.failed"/> |
597 |
+ |
|
598 |
+ |
</target> |
599 |
+ |
|
600 |
+ |
|
601 |
+ |
<target name="configure-compiler"> |
602 |
+ |
|
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 |
+ |
|
632 |
+ |
<property name="unchecked.option" value="-Xlint:unchecked"/> |
633 |
+ |
|
634 |
+ |
<condition property="warnunchecked.arg" value="${unchecked.option}"> |
635 |
+ |
<istrue value="${gjc.warnunchecked}"/> |
636 |
+ |
</condition> |
637 |
+ |
|
638 |
+ |
<property name="warnunchecked.arg" value=""/> |
639 |
+ |
|
640 |
+ |
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
641 |
+ |
<istrue value="${build.nothreads}"/> |
642 |
+ |
</condition> |
643 |
+ |
|
644 |
+ |
|
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 |
+ |
|
668 |
+ |
<!-- Common options in javac invocations --> |
669 |
+ |
<!-- |
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}"/> |
675 |
+ |
|
676 |
+ |
</target> |
677 |
+ |
|
678 |
+ |
|
679 |
+ |
<target name="prepare-src" |
680 |
+ |
depends="configure-compiler" |
681 |
+ |
if="prepare.src.dir"> |
682 |
+ |
|
683 |
+ |
<mkdir dir="${prepare.src.dir}"/> |
684 |
+ |
<copy todir="${prepare.src.dir}"> |
685 |
+ |
<fileset dir="${src.dir}"> |
686 |
+ |
<exclude name="java/lang/**"/> |
687 |
+ |
</fileset> |
688 |
+ |
</copy> |
689 |
+ |
|
690 |
+ |
</target> |
691 |
+ |
|
692 |
+ |
|
693 |
+ |
<target name="configure-emulation"> |
694 |
+ |
|
695 |
+ |
<condition property="build.emulation.true"> |
696 |
+ |
<istrue value="${build.emulation}"/> |
697 |
+ |
</condition> |
698 |
+ |
|
699 |
+ |
</target> |
700 |
+ |
|
701 |
+ |
|
702 |
+ |
<target name="configure-tests" |
703 |
+ |
depends="configure-compiler"> |
704 |
+ |
|
705 |
+ |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
706 |
+ |
<available property="junit.available" |
707 |
+ |
classname="junit.framework.Protectable"/> |
708 |
+ |
|
709 |
+ |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
710 |
+ |
unless="junit.available"/> |
711 |
+ |
|
712 |
+ |
<!-- Xalan --> |
713 |
+ |
<available property="xalan.available" |
714 |
+ |
classname="org.apache.xalan.Version"/> |
715 |
+ |
|
716 |
+ |
<fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests" |
717 |
+ |
unless="xalan.available"/> |
718 |
+ |
|
719 |
+ |
|
720 |
+ |
<!-- |
721 |
+ |
! Bootclasspath munging for testing, so JUnit can test our local |
722 |
+ |
! modifications to java.*. |
723 |
+ |
--> |
724 |
+ |
|
725 |
+ |
<path id="test.classpath"> |
726 |
+ |
<pathelement location="${product.jar}"/> |
727 |
+ |
<pathelement location="${rt.jar}"/> |
728 |
+ |
<pathelement location="${build.testcases.dir}"/> |
729 |
+ |
<pathelement location="${junit.jar}"/> |
730 |
+ |
</path> |
731 |
+ |
|
732 |
+ |
<path id="test.compile.bootclasspath"> |
733 |
+ |
<pathelement location="${javac.jar}"/> |
734 |
+ |
<pathelement location="${collect.jar}"/> |
735 |
+ |
<pathelement location="${rt.jar}"/> |
736 |
+ |
</path> |
737 |
+ |
|
738 |
+ |
<path id="test.run.bootclasspath"> |
739 |
+ |
<!-- |
740 |
+ |
<pathelement location="${javac.jar}"/> |
741 |
+ |
--> |
742 |
+ |
<path refid="test.classpath"/> |
743 |
+ |
</path> |
744 |
+ |
|
745 |
+ |
<!-- Flatten test classpaths into platform-appropriate strings --> |
746 |
+ |
<property name="test.classpath" refid="test.classpath"/> |
747 |
+ |
<property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/> |
748 |
+ |
<property name="test.run.bootclasspath" refid="test.run.bootclasspath"/> |
749 |
+ |
|
750 |
+ |
</target> |
751 |
+ |
|
752 |
+ |
|
753 |
+ |
|
754 |
+ |
<!-- Anthill targets --> |
755 |
+ |
|
756 |
+ |
<target name="anthill-build"> |
757 |
+ |
|
758 |
+ |
<!-- Override this in user.properties --> |
759 |
+ |
<property name="tiger.home" location="e:/j2sdk1.5.0"/> |
760 |
+ |
|
761 |
+ |
<exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java"> |
762 |
+ |
<arg value="-Xmx256000000"/> |
763 |
+ |
<!-- classpath of new JVM --> |
764 |
+ |
<arg value="-classpath"/> <arg path="${java.class.path}"/> |
765 |
+ |
<!-- location of Ant home directory --> |
766 |
+ |
<arg value="-Dant.home=${ant.home}"/> |
767 |
+ |
<!-- the Ant main class --> |
768 |
+ |
<arg value="org.apache.tools.ant.Main"/> |
769 |
+ |
<!-- The build file --> |
770 |
+ |
<arg value="-buildfile"/> <arg value="build.xml"/> |
771 |
+ |
<!-- the target to build on the new Ant instance --> |
772 |
+ |
<arg value="-DJAVA_HOME=${tiger.home}"/> |
773 |
+ |
<arg value="do-anthill-build"/> |
774 |
+ |
</exec> |
775 |
+ |
</target> |
776 |
+ |
|
777 |
+ |
<target name="do-anthill-build" |
778 |
+ |
depends="jar, test, docs, dist-docs"/> |
779 |
+ |
|
780 |
+ |
<target name="anthill-publish"> |
781 |
+ |
|
782 |
+ |
<copy todir="${deployDir}/docs/private"> |
783 |
+ |
<fileset dir="${build.javadocs.dir}"/> |
784 |
+ |
</copy> |
785 |
+ |
|
786 |
+ |
<copy todir="${deployDir}/docs/public"> |
787 |
+ |
<fileset dir="${dist.javadocs.dir}"/> |
788 |
+ |
</copy> |
789 |
+ |
|
790 |
+ |
<copy tofile="${deployDir}/index.html" |
791 |
+ |
file="${basedir}/etc/anthill-index.html"/> |
792 |
+ |
|
793 |
+ |
<copy todir="${deployDir}/notes"> |
794 |
+ |
<fileset dir="${basedir}/etc/notes"/> |
795 |
+ |
</copy> |
796 |
+ |
|
797 |
+ |
</target> |
798 |
+ |
|
799 |
+ |
|
800 |
+ |
<target name="ng" depends="test"> |
801 |
+ |
<java classname="SuperfluousAbstract" fork="true"> |
802 |
+ |
|
803 |
+ |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
804 |
+ |
|
805 |
+ |
</java> |
806 |
|
</target> |
807 |
|
|
808 |
|
|