ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
Revision: 1.50
Committed: Tue Aug 5 04:03:38 2003 UTC (20 years, 8 months ago) by tim
Content type: text/xml
Branch: MAIN
CVS Tags: JSR166_CR1
Changes since 1.49: +2 -0 lines
Log Message:
Need emulation version of ReentrantLock.

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