ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
Revision: 1.48
Committed: Fri Aug 1 19:41:06 2003 UTC (20 years, 9 months ago) by tim
Content type: text/xml
Branch: MAIN
Changes since 1.47: +2 -0 lines
Log Message:
Add message to show where doccheck output goes.

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