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

Diff of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.44

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