ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
Revision: 1.47
Committed: Fri Aug 1 19:34:05 2003 UTC (20 years, 9 months ago) by tim
Content type: text/xml
Branch: MAIN
Changes since 1.46: +32 -15 lines
Log Message:
doccheck target now working with new version 1.2b2

File Contents

# User Rev Content
1 tim 1.18 <project name="jsr166" default="usage">
2 tim 1.1
3     <description>
4 tim 1.29 ------------------------------------------------------------------------------
5     Build file for JSR-166
6 tim 1.18
7 tim 1.29 Usage: ant [target]
8    
9     User-specific settings are read from user.properties.
10 tim 1.32 See user.properties.sample for an explanation of some useful settings.
11 tim 1.29 ------------------------------------------------------------------------------
12 tim 1.18 </description>
13 tim 1.11
14 tim 1.29 <target name="usage" description="Advises user to run with -projecthelp">
15     <echo>Run "ant -projecthelp" for full usage information.</echo>
16     </target>
17 tim 1.3
18 tim 1.11
19 tim 1.27 <!-- User-specific settings -->
20 tim 1.23 <property file="user.properties"/>
21 tim 1.27
22 tim 1.1
23     <!-- Compilation options -->
24 tim 1.11 <property name="build.sourcelevel" value="1.5"/>
25 tim 1.25 <property name="build.docsourcelevel" value="1.4"/>
26 tim 1.1 <property name="build.debug" value="true"/>
27     <property name="build.debuglevel" value="source,lines,vars"/>
28 tim 1.13 <property name="build.deprecation" value="false"/>
29 tim 1.1
30     <!-- Build locations -->
31     <property name="build.dir" location="build"/>
32     <property name="build.classes.dir" location="${build.dir}/classes"/>
33 tim 1.27 <property name="build.emulation.dir" location="${build.dir}/emulation"/>
34 tim 1.1 <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 tim 1.9 <property name="build.javadocs.dir" location="${build.dir}/javadocs"/>
38 tim 1.16 <property name="build.stripped.dir" location="${build.dir}/stripped"/>
39 tim 1.1 <property name="build.reports.dir" location="${build.dir}/reports"/>
40 tim 1.16 <property name="build.doccheck.dir" location="${build.dir}/doccheck"/>
41 tim 1.1 <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
42 tim 1.47 <property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/>
43 tim 1.1
44     <!-- Source locations -->
45 tim 1.22 <property name="src.dir" location="${basedir}/src/main"/>
46 tim 1.27 <property name="emulation.src.dir" location="${basedir}/src/emulation"/>
47 tim 1.22 <property name="test.src.dir" location="${basedir}/src/test"/>
48 tim 1.1 <property name="ant.src.dir" location="${basedir}/etc/ant"/>
49     <property name="stylesheet.dir" location="${basedir}/etc/xsl"/>
50     <property name="lib.dir" location="${basedir}/lib"/>
51 tim 1.9 <property name="dist.dir" location="${basedir}/dist"/>
52    
53     <!-- Distribution locations -->
54     <property name="dist.javadocs.dir" location="${dist.dir}/docs"/>
55 tim 1.1
56     <!-- Jar locations -->
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    
61 tim 1.27
62 tim 1.28
63 tim 1.40 <!-- Files excluded from dist-docs and emulation jar -->
64     <patternset id="unsafe.exclusion">
65 tim 1.28 <exclude name="java/util/Random.*"/>
66     <exclude name="sun/misc/Unsafe.*"/>
67     </patternset>
68    
69 tim 1.40 <!-- Files excludes from emulation jar -->
70     <patternset id="atomic.exclusion">
71 tim 1.41 <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/>
72 tim 1.40 <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 tim 1.28
78    
79 tim 1.11 <!-- Main targets -->
80    
81 tim 1.28 <target name="compile"
82 tim 1.33 depends="init, configure-compiler, prepare-src"
83 tim 1.27 description="Compiles main sources to build folder">
84    
85 tim 1.33 <property name="prepare.src.dir" value="${src.dir}"/>
86    
87 tim 1.1 <mkdir dir="${build.classes.dir}"/>
88 tim 1.27
89 tim 1.37 <!--
90     <echo>javac ${gjc.args}</echo>
91     <echo>bootclasspath=${compile.bootclasspath}</echo>
92     -->
93    
94 tim 1.33 <javac srcdir="${prepare.src.dir}"
95 tim 1.1 destdir="${build.classes.dir}"
96     debug="${build.debug}"
97     debuglevel="${build.debuglevel}"
98     deprecation="${build.deprecation}"
99     source="${build.sourcelevel}"
100     fork="true">
101    
102 tim 1.37 <compilerarg line="${gjc.args}"/>
103     <bootclasspath refid="compile.bootclasspath"/>
104 tim 1.1
105     </javac>
106 tim 1.27
107 tim 1.1 </target>
108    
109    
110 tim 1.28 <target name="jar"
111 tim 1.32 depends="configure-emulation, init-jar, native-jar, emulation-jar"
112 tim 1.28 description="Builds library jar from compiled sources"/>
113 tim 1.1
114    
115 tim 1.28 <target name="test"
116 tim 1.32 depends="init, configure-tests, report-tests"
117 tim 1.29 description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
118 tim 1.1
119    
120 tim 1.28 <target name="checkstyle"
121     depends="filter-src"
122 tim 1.18 description="Reports on style errors in Java source (verbose, mostly chaff)">
123 tim 1.27
124 tim 1.15 <taskdef resource="checkstyletask.properties"
125     classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
126    
127     <checkstyle>
128 tim 1.16 <formatter type="plain"/> <!-- also available: type="xml" -->
129 tim 1.15 <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
130     </checkstyle>
131 tim 1.27
132 tim 1.15 </target>
133    
134 tim 1.16
135 tim 1.28 <target name="doccheck"
136 tim 1.47 depends="filter-doccheck"
137     description="Reports on javadoc style errors">
138 tim 1.27
139 tim 1.16 <delete dir="${build.doccheck.dir}"/>
140     <mkdir dir="${build.doccheck.dir}"/>
141 tim 1.27
142 tim 1.16 <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
143     docletpath="${lib.dir}/doccheck.jar"
144     destdir="${build.doccheck.dir}">
145 tim 1.47 <packageset dir="${build.filter.doccheck.dir}"/>
146 tim 1.16 </javadoc>
147 tim 1.27
148 tim 1.16 </target>
149    
150    
151 tim 1.28 <target name="docs"
152     depends="filter-src"
153 tim 1.9 description="Builds javadocs with custom tags to build folder">
154 tim 1.27
155 tim 1.9 <delete dir="${build.javadocs.dir}"/>
156     <mkdir dir="${build.javadocs.dir}"/>
157 tim 1.27
158 tim 1.9 <javadoc destdir="${build.javadocs.dir}"
159 tim 1.8 link="http://java.sun.com/j2se/1.4.1/docs/api"
160     overview="${src.dir}/intro.html"
161 dholmes 1.24 source="${build.docsourcelevel}">
162 tim 1.8
163 tim 1.9 <tag name="revised" description="Last revised:"/>
164 tim 1.29 <tag name="spec" description="Specified by:"/>
165     <tag name="editor" description="Last edited by:"/>
166     <tag name="fixme" description="FIX ME:"/>
167    
168 tim 1.22 <packageset dir="${build.filter.src.dir}"/>
169 tim 1.8
170     </javadoc>
171 tim 1.27
172 tim 1.8 </target>
173    
174    
175 tim 1.28 <target name="strip"
176 tim 1.32 depends="init, configure-compiler"
177 tim 1.31 description="Strip generics from java source (not working yet)">
178 tim 1.27
179 tim 1.16 <mkdir dir="${build.stripped.dir}"/>
180 tim 1.27
181 tim 1.31 <!--
182     # javac -s doesn't reliably generate compilable code. It generates
183     # bridge methods (marked as "synthetic") that can have identical
184     # signatures to existing methods except for the return value.
185     -->
186 tim 1.16 <javac srcdir="${src.dir}"
187     destdir="${build.stripped.dir}"
188     debug="${build.debug}"
189     debuglevel="${build.debuglevel}"
190     deprecation="${build.deprecation}"
191     source="${build.sourcelevel}"
192     fork="true">
193    
194 tim 1.37 <compilerarg line="${gjc.args} -s"/>
195     <bootclasspath refid="compile.bootclasspath"/>
196 tim 1.16
197     </javac>
198 tim 1.27
199 tim 1.16 </target>
200    
201    
202 tim 1.28 <target name="dist"
203     depends="init, dist-clean, dist-jar, dist-docs"
204 tim 1.16 description="Puts all distributable products in single hierarchy"/>
205 tim 1.1
206 tim 1.42 <target name="release"
207     depends="dist"
208     description="Puts entire CVS tree, plus distribution productions, in a jar">
209    
210 tim 1.46 <!--
211 dl 1.45 #keep build dir? - dl
212 tim 1.42 <delete dir="${build.dir}"/>
213 dl 1.45 -->
214 tim 1.42 <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
215    
216     <jar basedir="${basedir}" destfile="${release.jar}">
217     <exclude name="${release.jar}"/>
218     <exclude name="user.properties"/>
219     <exclude name="etc/notes/**"/>
220 tim 1.43 <exclude name="lib/gjc/2.1/**"/>
221 tim 1.44 <exclude name="**/SyntaxTest.java"/>
222 tim 1.42 </jar>
223    
224     </target>
225 tim 1.1
226 tim 1.11 <target name="clean"
227     description="Removes all build products">
228 tim 1.27
229 tim 1.11 <delete dir="${build.dir}"/>
230     <delete dir="${build.classes.dir}"/>
231     <delete dir="${build.lib.dir}"/>
232 tim 1.27
233 tim 1.1 </target>
234    
235    
236 tim 1.11 <target name="dist-clean"
237     description="Removes all build and distribution products">
238 tim 1.27
239 tim 1.11 <delete dir="${dist.dir}"/>
240 tim 1.27
241 tim 1.9 </target>
242 tim 1.10
243    
244 tim 1.28 <target name="dist-docs"
245     depends="filter-src"
246     description="Builds javadocs without custom tags to dist folder">
247    
248     <delete dir="${dist.javadocs.dir}"/>
249     <mkdir dir="${dist.javadocs.dir}"/>
250    
251     <javadoc destdir="${dist.javadocs.dir}"
252     link="http://java.sun.com/j2se/1.4.1/docs/api"
253     overview="${src.dir}/intro.html"
254     source="${build.docsourcelevel}">
255    
256     <packageset dir="${build.filter.src.dir}"/>
257 tim 1.14
258 tim 1.28 </javadoc>
259 tim 1.14
260     </target>
261    
262    
263 tim 1.28
264 tim 1.11 <!-- Internal targets -->
265 tim 1.9
266 tim 1.16
267 tim 1.32 <target name="init">
268 tim 1.27
269 tim 1.11 <!-- Version is kept in a separate file -->
270     <loadfile property="version" srcFile="version.properties"/>
271     <echo>Building JSR-166 version ${version}</echo>
272 tim 1.27
273     </target>
274    
275    
276 tim 1.28 <target name="init-jar">
277 tim 1.27
278     <mkdir dir="${build.lib.dir}"/>
279    
280 tim 1.28 </target>
281    
282    
283     <target name="native-jar"
284 tim 1.30 depends="compile"
285     unless="build.emulation.true">
286 tim 1.28
287 tim 1.27 <jar destfile="${product.jar}">
288     <fileset dir="${build.classes.dir}"/>
289     </jar>
290    
291     </target>
292    
293    
294 tim 1.28 <target name="compile-emulation"
295 tim 1.32 depends="init, configure-compiler"
296 tim 1.30 if="build.emulation.true">
297 tim 1.27
298     <mkdir dir="${build.emulation.dir}"/>
299    
300     <javac srcdir="${emulation.src.dir}"
301     destdir="${build.emulation.dir}"
302     debug="${build.debug}"
303     debuglevel="${build.debuglevel}"
304     deprecation="${build.deprecation}"
305     source="${build.sourcelevel}"
306     fork="true">
307    
308 tim 1.37 <compilerarg line="${gjc.args}"/>
309     <bootclasspath refid="compile.bootclasspath"/>
310 tim 1.27
311     </javac>
312    
313     </target>
314    
315    
316 tim 1.28 <target name="emulation-jar"
317 tim 1.30 depends="compile-emulation"
318     if="build.emulation.true">
319 tim 1.27
320 tim 1.29
321     <jar destfile="${product.jar}" duplicate="add">
322     <fileset dir="${build.classes.dir}">
323 tim 1.40 <patternset refid="atomic.exclusion"/>
324     <patternset refid="unsafe.exclusion"/>
325 tim 1.29 </fileset>
326 tim 1.27 <fileset dir="${build.emulation.dir}"/>
327     </jar>
328    
329 tim 1.9 </target>
330    
331    
332 tim 1.28 <target name="dist-jar"
333     depends="clean, jar">
334 tim 1.27
335 tim 1.11 <copy file="${product.jar}" todir="${dist.dir}"/>
336 tim 1.27
337 tim 1.11 </target>
338    
339    
340 tim 1.28 <target name="compile-ant-filter"
341     depends="init">
342 tim 1.27
343 tim 1.1 <mkdir dir="${build.ant.dir}"/>
344 tim 1.27
345 tim 1.1 <javac srcdir="${ant.src.dir}"
346     destdir="${build.ant.dir}"
347     source="1.4"
348     />
349 tim 1.27
350 tim 1.1 </target>
351    
352    
353 tim 1.28 <target name="filter-src"
354     depends="compile-ant-filter">
355 tim 1.27
356 tim 1.1 <mkdir dir="${build.filter.src.dir}"/>
357 tim 1.27
358 tim 1.1 <copy todir="${build.filter.src.dir}">
359     <fileset dir="${src.dir}">
360 tim 1.31 <include name="**/*.html"/>
361     </fileset>
362     </copy>
363    
364     <copy todir="${build.filter.src.dir}">
365     <fileset dir="${src.dir}">
366     <exclude name="**/*.html"/>
367 tim 1.40 <patternset refid="unsafe.exclusion"/>
368 tim 1.1 </fileset>
369     <filterchain>
370 tim 1.36
371     <!--
372     # This filter gets rid of angle-bracketed type parameters
373     # so that javadoc can run on the result. The following
374     # heuristic seems to work:
375     #
376     # For all lines not starting with space(s)-asterisk-space(s),
377     # replace <something> with a space, where there may be more
378     # than one right angle bracket at the end, and "something"
379     # must not contain parens or pipes. (This may need some
380     # tweaking.)
381     -->
382    
383 tim 1.1 <filterreader classname="jsr166.ant.filters.ReplaceFilter"
384     classpath="${build.ant.dir}">
385     <param name="notmatching" value="^\s+\*\s.*$"/>
386 tim 1.36 <param name="pattern" value="&lt;[^|>()]+?>+"/>
387 tim 1.1 <param name="replacement" value=" "/>
388     </filterreader>
389 tim 1.36
390    
391     <!--
392     # This filter uncomments lines beginning with "//@" so that
393     # javadoc can see imports that are needed to resolve links
394     # but that shouldn't be in the compiled code.
395     -->
396    
397 tim 1.1 <filterreader classname="jsr166.ant.filters.ReplaceFilter"
398     classpath="${build.ant.dir}">
399 tim 1.36 <param name="matching" value="^//@.*$"/>
400     <param name="pattern" value="^//@"/>
401 tim 1.1 <param name="replacement" value=""/>
402     </filterreader>
403 tim 1.47 </filterchain>
404     </copy>
405    
406     </target>
407    
408    
409    
410    
411     <target name="filter-doccheck"
412     depends="filter-src">
413 tim 1.36
414 tim 1.47 <mkdir dir="${build.filter.doccheck.dir}"/>
415 tim 1.36
416 tim 1.47 <copy todir="${build.filter.doccheck.dir}">
417     <fileset dir="${build.filter.src.dir}">
418     <include name="**/*.html"/>
419     </fileset>
420     </copy>
421    
422     <property name="generic.declarations"
423     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 {}"
424     />
425    
426     <copy todir="${build.filter.doccheck.dir}">
427     <fileset dir="${build.filter.src.dir}">
428     <exclude name="**/*.html"/>
429     </fileset>
430     <filterchain>
431 tim 1.36 <!--
432 tim 1.47 # These two filters try to make the source look like
433 tim 1.36 # something that doccheck can process. The first removes
434     # -source 1.4 assertions and the second adds in a bunch
435     # of single letter public nested marker interfaces so that
436     # the generic type parameters are recognized.
437     -->
438    
439     <filterreader classname="jsr166.ant.filters.ReplaceFilter"
440     classpath="${build.ant.dir}">
441     <param name="matching" value="^\s*assert[\s ].*$"/>
442     <param name="pattern" value="assert"/>
443     <param name="replacement" value="//assert"/>
444     </filterreader>
445    
446     <filterreader classname="jsr166.ant.filters.ReplaceFilter"
447     classpath="${build.ant.dir}">
448 tim 1.47 <param name="matching" value="^([^*]*(class|interface|implements) .*|)\{.*$"/>
449 tim 1.36 <param name="pattern" value="$"/>
450     <param name="replacement" value=" ${generic.declarations}"/>
451     </filterreader>
452    
453 tim 1.1 </filterchain>
454     </copy>
455 tim 1.27
456 tim 1.1 </target>
457    
458    
459 tim 1.28 <target name="compile-tests"
460     depends="jar">
461 tim 1.27
462 tim 1.1 <mkdir dir="${build.testcases.dir}"/>
463 tim 1.27
464 tim 1.37 <!--
465     <echo>javac ${gjc.args}</echo>
466     <echo>bootclasspath=${test.compile.bootclasspath}</echo>
467     <echo>classpath="${test.classpath}"</echo>
468     -->
469    
470 tim 1.1 <javac srcdir="${test.src.dir}"
471     destdir="${build.testcases.dir}"
472     debug="${build.debug}"
473     debuglevel="${build.debuglevel}"
474     deprecation="${build.deprecation}"
475     source="${build.sourcelevel}"
476     fork="true">
477    
478 tim 1.37 <compilerarg line="${gjc.args}"/>
479     <bootclasspath refid="test.compile.bootclasspath"/>
480     <classpath refid="test.classpath"/>
481 tim 1.1
482     </javac>
483 tim 1.27
484 tim 1.1 </target>
485 tim 1.11
486 tim 1.1
487 tim 1.28 <target name="run-tests"
488     depends="compile-tests">
489 tim 1.27
490     <!-- May be overridden by user.properties -->
491     <property name="testcase" value="*"/>
492    
493 tim 1.1 <mkdir dir="${build.reports.dir}"/>
494 tim 1.27
495 tim 1.1 <junit printsummary="true"
496     showoutput="true"
497     errorProperty="junit.failed"
498     failureProperty="junit.failed"
499 tim 1.12 dir="${build.reports.dir}"
500     fork="true">
501    
502 tim 1.37 <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
503 tim 1.1
504     <formatter type="xml"/>
505    
506     <batchtest todir="${build.reports.dir}">
507     <fileset dir="${test.src.dir}">
508 tim 1.23 <include name="**/${testcase}Test.java"/>
509 tim 1.1 </fileset>
510     </batchtest>
511    
512     </junit>
513 tim 1.27
514 tim 1.1 </target>
515    
516    
517 tim 1.28 <target name="report-tests"
518     depends="run-tests">
519    
520 tim 1.1 <!-- Sets junit.report.format to frames if Xalan is present,
521     otherwise sets it to noframes. -->
522     <available property="junit.report.format"
523     value="frames"
524     classname="org.apache.xalan.lib.Redirect"
525     />
526     <property name="junit.report.format" value="noframes"/>
527    
528     <junitreport todir="${build.reports.dir}">
529     <fileset dir="${build.reports.dir}">
530     <include name="TEST-*.xml"/>
531     </fileset>
532     <report styledir="${stylesheet.dir}"
533     format="${junit.report.format}"
534     todir="${build.reports.dir}"
535     />
536     </junitreport>
537    
538     <fail message="Test Cases Failed" if="junit.failed"/>
539 tim 1.28
540 tim 1.18 </target>
541    
542    
543 tim 1.32 <target name="configure-compiler">
544    
545     <property name="gjc.version"
546 tim 1.46 value="2.2"/>
547 tim 1.32
548 tim 1.37 <condition property="novariance.arg" value="-novariance">
549 tim 1.32 <and>
550     <equals arg1="${gjc.version}" arg2="2.0"/>
551     <or>
552     <not><isset property="gjc.novariance"/></not>
553     <istrue value="${gjc.novariance}"/>
554     </or>
555     </and>
556     </condition>
557    
558 tim 1.37 <property name="novariance.arg"
559 tim 1.32 value=""/>
560    
561     <property name="gjc.dir"
562     value="${lib.dir}/gjc"/>
563    
564     <property name="javac.jar"
565     location="${gjc.dir}/${gjc.version}/javac.jar"/>
566    
567     <property name="collect.jar"
568 tim 1.37 location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
569 tim 1.32
570    
571 tim 1.37 <condition property="warnunchecked.arg" value="-warnunchecked">
572 tim 1.32 <istrue value="${gjc.warnunchecked}"/>
573     </condition>
574    
575 tim 1.37 <property name="warnunchecked.arg" value=""/>
576 tim 1.32
577 tim 1.34 <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
578 tim 1.35 <istrue value="${build.nothreads}"/>
579 tim 1.34 </condition>
580    
581 tim 1.32
582     <!--
583     ! Bootclasspath munging for source compilation.
584     -->
585    
586 tim 1.37 <path id="pre.bootclasspath">
587 tim 1.32 <pathelement location="${javac.jar}"/>
588     </path>
589    
590 tim 1.37 <path id="compile.bootclasspath">
591 tim 1.39 <pathelement location="${build.classes.dir}"/>
592 tim 1.32 <pathelement location="${collect.jar}"/>
593     <pathelement location="${rt.jar}"/>
594     </path>
595    
596 tim 1.37 <!-- Flatten paths into platform-appropriate strings -->
597     <property name="pre.bootclasspath" refid="pre.bootclasspath"/>
598     <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
599    
600 tim 1.32
601     <!-- Common options in javac invocations -->
602 tim 1.37 <property name="gjc.args"
603     value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
604     />
605 tim 1.33
606     </target>
607    
608    
609     <target name="prepare-src"
610 tim 1.34 depends="configure-compiler"
611 tim 1.33 if="prepare.src.dir">
612    
613     <mkdir dir="${prepare.src.dir}"/>
614     <copy todir="${prepare.src.dir}">
615     <fileset dir="${src.dir}">
616     <exclude name="java/lang/**"/>
617     </fileset>
618     </copy>
619 tim 1.32
620     </target>
621    
622    
623     <target name="configure-emulation">
624    
625     <condition property="build.emulation.true">
626     <or>
627     <and>
628     <os family="windows"/>
629     <not>
630     <isset property="build.emulation"/>
631     </not>
632     </and>
633     <istrue value="${build.emulation}"/>
634     </or>
635     </condition>
636    
637     </target>
638    
639    
640 tim 1.37 <target name="configure-tests"
641     depends="configure-compiler">
642 tim 1.28
643     <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
644 tim 1.18 <available property="junit.available"
645 tim 1.28 classname="junit.framework.Protectable"/>
646    
647     <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
648     unless="junit.available"/>
649    
650 tim 1.30
651 tim 1.32 <!--
652     ! Bootclasspath munging for testing, so JUnit can test our local
653     ! modifications to java.*.
654     -->
655    
656     <path id="test.classpath">
657     <pathelement location="${product.jar}"/>
658     <pathelement location="${build.testcases.dir}"/>
659     <pathelement location="${junit.jar}"/>
660     </path>
661    
662 tim 1.37 <path id="test.compile.bootclasspath">
663     <pathelement location="${javac.jar}"/>
664     <pathelement location="${collect.jar}"/>
665     <pathelement location="${rt.jar}"/>
666     </path>
667    
668     <path id="test.run.bootclasspath">
669     <pathelement location="${javac.jar}"/>
670     <path refid="test.classpath"/>
671     </path>
672 tim 1.32
673 tim 1.37 <!-- Flatten test classpaths into platform-appropriate strings -->
674     <property name="test.classpath" refid="test.classpath"/>
675     <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
676     <property name="test.run.bootclasspath" refid="test.run.bootclasspath"/>
677 tim 1.30
678 tim 1.28 </target>
679    
680    
681    
682     <!-- Anthill targets -->
683    
684     <target name="anthill-build"
685     depends="jar, test, docs, dist-docs"/>
686    
687     <target name="anthill-publish">
688    
689     <copy todir="${deployDir}/docs/private">
690     <fileset dir="${build.javadocs.dir}"/>
691     </copy>
692    
693     <copy todir="${deployDir}/docs/public">
694     <fileset dir="${dist.javadocs.dir}"/>
695     </copy>
696    
697     <copy tofile="${deployDir}/index.html"
698     file="${basedir}/etc/anthill-index.html"/>
699    
700     <copy todir="${deployDir}/notes">
701     <fileset dir="${basedir}/etc/notes"/>
702     </copy>
703    
704 tim 1.43 </target>
705    
706    
707     <target name="ng" depends="test">
708     <java classname="SuperfluousAbstract" fork="true">
709    
710     <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
711    
712     </java>
713 tim 1.1 </target>
714    
715    
716     </project>