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

Diff of /jsr166/build.xml

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

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

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.39

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