/[cvs]/jsr166/build.xml
ViewVC logotype

Annotation of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.52 - (hide annotations)
Tue Aug 19 15:10:45 2003 UTC (16 years, 1 month ago) by tim
Branch: MAIN
Changes since 1.51: +4 -3 lines
File MIME type: text/xml
Separate output directory for sinjdocs target.

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

dl@cs.oswego.edu
ViewVC Help
Powered by ViewVC 1.1.27