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

Diff of /jsr166/build.xml

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

revision 1.16 by tim, Fri Dec 13 06:34:04 2002 UTC revision 1.41 by tim, Fri Jun 6 20:48:55 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"/>
# Line 33  Line 41 
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 45  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 75  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"/>
112      <jar basedir="${build.classes.dir}"  
         destfile="${product.jar}"  
     />  
   </target>  
113    
114      <target name="test"
115              depends="init, configure-tests, report-tests"
116              description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
117    
   <target name="test" depends="init, report-tests"  
           description="Runs all tests"/>  
118    
119      <target name="checkstyle"
120              depends="filter-src"
121              description="Reports on style errors in Java source (verbose, mostly chaff)">
122    
   <target name="checkstyle" depends="filter-src"  
           description="Reports on style errors in Java source">  
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    
# Line 107  Line 127 
127        <formatter type="plain"/>  <!-- also available: type="xml" -->        <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    
134    <target name="doccheck" depends="filter-src"    <target name="doccheck"
135            description="Reports on javadoc style errors">            depends="filter-src"
136              description="Reports on javadoc style errors (not working yet)">
137    
138      <delete dir="${build.doccheck.dir}"/>      <delete dir="${build.doccheck.dir}"/>
139      <mkdir dir="${build.doccheck.dir}"/>      <mkdir dir="${build.doccheck.dir}"/>
140    
141      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
142           docletpath="${lib.dir}/doccheck.jar"           docletpath="${lib.dir}/doccheck.jar"
143              destdir="${build.doccheck.dir}">              destdir="${build.doccheck.dir}">
144        <packageset dir="${build.filter.src.dir}">        <packageset dir="${build.filter.src.dir}"/>
         <include name="java/**"/>  
       </packageset>  
145      </javadoc>      </javadoc>
146    
147    </target>    </target>
148    
149    
150    <target name="docs" depends="filter-src"    <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="strip" depends="init">    <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}"/>      <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}"      <javac srcdir="${src.dir}"
186            destdir="${build.stripped.dir}"            destdir="${build.stripped.dir}"
187              debug="${build.debug}"              debug="${build.debug}"
# Line 155  Line 190 
190             source="${build.sourcelevel}"             source="${build.sourcelevel}"
191               fork="true">               fork="true">
192    
193        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args} -s"/>
194        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>        <bootclasspath refid="compile.bootclasspath"/>
   
       <!-- need this because srcdir is basedir! -->  
       <include name="java/**/*.java"/>  
195    
196      </javac>      </javac>
197    
198    </target>    </target>
199    
200    
201    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"    <target name="dist"
202              depends="init, dist-clean, dist-jar, dist-docs"
203            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
204    
205    
206    <target name="clean"    <target name="clean"
207            description="Removes all build products">            description="Removes all build products">
208    
209      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
210      <delete dir="${build.classes.dir}"/>      <delete dir="${build.classes.dir}"/>
211      <delete dir="${build.lib.dir}"/>      <delete dir="${build.lib.dir}"/>
212    
213    </target>    </target>
214    
215    
216    <target name="dist-clean"    <target name="dist-clean"
217            description="Removes all build and distribution products">            description="Removes all build and distribution products">
218    
219      <delete dir="${dist.dir}"/>      <delete dir="${dist.dir}"/>
220    
221    </target>    </target>
222    
223    
224    <!-- Anthill targets -->    <target name="dist-docs"
225              depends="filter-src"
226              description="Builds javadocs without custom tags to dist folder">
227    
228    <!-- Should really run the tests instead of just the jar target -->      <delete dir="${dist.javadocs.dir}"/>
229    <target name="anthill-build" depends="jar, docs, dist-docs"      <mkdir dir="${dist.javadocs.dir}"/>
           description="Build the jar and both the external and internal docs"/>  
230    
231    <target name="anthill-publish">      <javadoc destdir="${dist.javadocs.dir}"
232      <copy todir="${deployDir}/docs/private">                  link="http://java.sun.com/j2se/1.4.1/docs/api"
233        <fileset dir="${build.javadocs.dir}"/>              overview="${src.dir}/intro.html"
234      </copy>                source="${build.docsourcelevel}">
     <copy todir="${deployDir}/docs/public">  
       <fileset dir="${dist.javadocs.dir}"/>  
     </copy>  
   </target>  
235    
236          <packageset dir="${build.filter.src.dir}"/>
237    
238    <!-- Internal targets -->      </javadoc>
239    
   <target name="set-warnings-if" if="build.warnings">  
     <property name="build.warnings.option" value="-warnunchecked"/>  
240    </target>    </target>
241    
242    
243    <target name="set-warnings-unless" unless="build.warnings">  
244      <property name="build.warnings.option" value=""/>    <!-- Internal targets -->
   </target>  
245    
246    
247    <target name="init" depends="set-warnings-if, set-warnings-unless">    <target name="init">
248    
249      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
250      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
251      <echo>Building JSR-166 version ${version}</echo>      <echo>Building JSR-166 version ${version}</echo>
252    
253    </target>    </target>
254    
255    
256    <target name="dist-jar" depends="clean, jar">    <target name="init-jar">
257      <copy file="${product.jar}" todir="${dist.dir}"/>  
258        <mkdir dir="${build.lib.dir}"/>
259    
260    </target>    </target>
261    
262    
263    <target name="dist-docs" depends="filter-src"    <target name="native-jar"
264            description="Builds javadocs without custom tags to dist folder">            depends="compile"
265      <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}">  
266    
267        <packageset dir="${build.filter.src.dir}">      <jar destfile="${product.jar}">
268          <include name="java/**"/>        <fileset dir="${build.classes.dir}"/>
269        </packageset>      </jar>
270    
271      </target>
272    
273    
274      <target name="compile-emulation"
275              depends="init, configure-compiler"
276              if="build.emulation.true">
277    
278        <mkdir dir="${build.emulation.dir}"/>
279    
280        <javac srcdir="${emulation.src.dir}"
281              destdir="${build.emulation.dir}"
282                debug="${build.debug}"
283           debuglevel="${build.debuglevel}"
284          deprecation="${build.deprecation}"
285               source="${build.sourcelevel}"
286                 fork="true">
287    
288          <compilerarg    line="${gjc.args}"/>
289          <bootclasspath refid="compile.bootclasspath"/>
290    
291        </javac>
292    
293      </target>
294    
295    
296      <target name="emulation-jar"
297              depends="compile-emulation"
298              if="build.emulation.true">
299    
300    
301        <jar destfile="${product.jar}" duplicate="add">
302          <fileset dir="${build.classes.dir}">
303            <patternset refid="atomic.exclusion"/>
304            <patternset refid="unsafe.exclusion"/>
305          </fileset>
306          <fileset dir="${build.emulation.dir}"/>
307        </jar>
308    
309      </target>
310    
311    
312      <target name="dist-jar"
313              depends="clean, jar">
314    
315        <copy file="${product.jar}" todir="${dist.dir}"/>
316    
     </javadoc>  
317    </target>    </target>
318    
319    
320    <target name="compile-ant-filter" depends="init">    <target name="compile-ant-filter"
321              depends="init">
322    
323      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
324    
325      <javac srcdir="${ant.src.dir}"      <javac srcdir="${ant.src.dir}"
326            destdir="${build.ant.dir}"            destdir="${build.ant.dir}"
327             source="1.4"             source="1.4"
328      />      />
329    
330    </target>    </target>
331    
332    
333    <target name="filter-src" depends="compile-ant-filter">    <target name="filter-src"
334              depends="compile-ant-filter">
335    
336      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
337    
338      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
339        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
340          <include name="java/**/*.java"/>          <include name="**/*.html"/>
341          </fileset>
342        </copy>
343    
344        <!-- Not needed now, used for doccheck filtering:
345        <property name="generic.declarations"
346                 value="public interface E {} public interface T {} public interface K {} public interface V {}"
347        />
348        -->
349    
350        <copy todir="${build.filter.src.dir}">
351          <fileset dir="${src.dir}">
352            <exclude name="**/*.html"/>
353            <patternset refid="unsafe.exclusion"/>
354        </fileset>        </fileset>
355        <filterchain>        <filterchain>
356    
357            <!--
358             # This filter gets rid of angle-bracketed type parameters
359             # so that javadoc can run on the result. The following
360             # heuristic seems to work:
361             #
362             # For all lines not starting with space(s)-asterisk-space(s),
363             #   replace <something> with a space, where there may be more
364             #   than one right angle bracket at the end, and "something"
365             #   must not contain parens or pipes. (This may need some
366             #   tweaking.)
367             -->
368    
369          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
370                        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.)  
            -->  
371            <param name="notmatching" value="^\s+\*\s.*$"/>            <param name="notmatching" value="^\s+\*\s.*$"/>
372            <param name="pattern" value="&lt;[^|>()]+?>+"/>            <param name="pattern"     value="&lt;[^|>()]+?>+"/>
373            <param name="replacement" value=" "/>            <param name="replacement" value=" "/>
374          </filterreader>          </filterreader>
375    
376    
377            <!--
378             # This filter uncomments lines beginning with "//@" so that
379             # javadoc can see imports that are needed to resolve links
380             # but that shouldn't be in the compiled code.
381             -->
382    
383          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
384                        classpath="${build.ant.dir}">                        classpath="${build.ant.dir}">
385            <!--            <param name="matching"    value="^//@.*$"/>
386             # 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="^//@"/>  
387            <param name="replacement" value=""/>            <param name="replacement" value=""/>
388          </filterreader>          </filterreader>
389    
390    
391            <!--
392             # The next two filters try to make the source look like
393             # something that doccheck can process. The first removes
394             # -source 1.4 assertions and the second adds in a bunch
395             # of single letter public nested marker interfaces so that
396             # the generic type parameters are recognized.
397             #
398             # Currently commented out because doccheck doesn't work. :-(
399             -->
400    
401            <!--
402            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
403                          classpath="${build.ant.dir}">
404              <param name="matching"    value="^\s*assert[\s ].*$"/>
405              <param name="pattern"     value="assert"/>
406              <param name="replacement" value="//assert"/>
407            </filterreader>
408    
409            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
410                          classpath="${build.ant.dir}">
411              <param name="matching"    value="^(.*(class|interface|implements) .*|)\{.*$"/>
412              <param name="pattern"     value="$"/>
413              <param name="replacement" value=" ${generic.declarations}"/>
414            </filterreader>
415            -->
416    
417        </filterchain>        </filterchain>
418      </copy>      </copy>
419    
420    </target>    </target>
421    
422    
423    <target name="compile-tests" depends="jar">    <target name="compile-tests"
424              depends="jar">
425    
426      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
427    
428    <!--
429        <echo>javac ${gjc.args}</echo>
430        <echo>bootclasspath=${test.compile.bootclasspath}</echo>
431        <echo>classpath="${test.classpath}"</echo>
432    -->
433    
434      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
435            destdir="${build.testcases.dir}"            destdir="${build.testcases.dir}"
436              debug="${build.debug}"              debug="${build.debug}"
# Line 300  Line 439 
439             source="${build.sourcelevel}"             source="${build.sourcelevel}"
440               fork="true">               fork="true">
441    
442        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args}"/>
443        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <bootclasspath refid="test.compile.bootclasspath"/>
444        <classpath refid="test.classpath"/>        <classpath     refid="test.classpath"/>
       <include name="**/*Test.java"/>  
445    
446      </javac>      </javac>
447    
448    </target>    </target>
449    
450    
451    <target name="run-tests" depends="compile-tests">    <target name="run-tests"
452              depends="compile-tests">
453    
454        <!-- May be overridden by user.properties -->
455        <property name="testcase" value="*"/>
456    
457      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.reports.dir}"/>
458    
459      <junit printsummary="true"      <junit printsummary="true"
460               showoutput="true"               showoutput="true"
461            errorProperty="junit.failed"            errorProperty="junit.failed"
# Line 318  Line 463 
463                      dir="${build.reports.dir}"                      dir="${build.reports.dir}"
464                     fork="true">                     fork="true">
465    
466        <jvmarg value="-Xbootclasspath/p:${product.jar}"/>        <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
   
       <classpath>  
         <!-- <path refid="test.classpath"/> -->  
         <pathelement location="${build.testcases.dir}"/>  
       </classpath>  
467    
468        <formatter type="xml"/>        <formatter type="xml"/>
469    
470        <batchtest todir="${build.reports.dir}">        <batchtest todir="${build.reports.dir}">
471          <fileset dir="${test.src.dir}">          <fileset dir="${test.src.dir}">
472            <include name="**/*Test.java"/>            <include name="**/${testcase}Test.java"/>
473          </fileset>          </fileset>
474        </batchtest>        </batchtest>
475    
476      </junit>      </junit>
477    
478    </target>    </target>
479    
480    
481    <target name="report-tests" depends="run-tests">    <target name="report-tests"
482              depends="run-tests">
483    
484      <!-- Sets junit.report.format to frames if Xalan is present,      <!-- Sets junit.report.format to frames if Xalan is present,
485           otherwise sets it to noframes. -->           otherwise sets it to noframes. -->
486      <available property="junit.report.format"      <available property="junit.report.format"
# Line 357  Line 500 
500      </junitreport>      </junitreport>
501    
502      <fail message="Test Cases Failed" if="junit.failed"/>      <fail message="Test Cases Failed" if="junit.failed"/>
503    
504      </target>
505    
506    
507      <target name="configure-compiler">
508    
509        <property name="gjc.version"
510                 value="2.0"/>
511    
512        <condition property="novariance.arg" value="-novariance">
513          <and>
514            <equals arg1="${gjc.version}" arg2="2.0"/>
515            <or>
516              <not><isset property="gjc.novariance"/></not>
517              <istrue value="${gjc.novariance}"/>
518            </or>
519          </and>
520        </condition>
521    
522        <property name="novariance.arg"
523                 value=""/>
524    
525        <property name="gjc.dir"
526                 value="${lib.dir}/gjc"/>
527    
528        <property name="javac.jar"
529              location="${gjc.dir}/${gjc.version}/javac.jar"/>
530    
531        <property name="collect.jar"
532              location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
533    
534    
535        <condition property="warnunchecked.arg" value="-warnunchecked">
536          <istrue value="${gjc.warnunchecked}"/>
537        </condition>
538    
539        <property name="warnunchecked.arg" value=""/>
540    
541        <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
542          <istrue value="${build.nothreads}"/>
543        </condition>
544    
545    
546        <!--
547         ! Bootclasspath munging for source compilation.
548         -->
549    
550        <path id="pre.bootclasspath">
551          <pathelement location="${javac.jar}"/>
552        </path>
553    
554        <path id="compile.bootclasspath">
555          <pathelement location="${build.classes.dir}"/>
556          <pathelement location="${collect.jar}"/>
557          <pathelement location="${rt.jar}"/>
558        </path>
559    
560        <!-- Flatten paths into platform-appropriate strings -->
561        <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
562        <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
563    
564    
565        <!-- Common options in javac invocations -->
566        <property name="gjc.args"
567                 value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
568        />
569    
570      </target>
571    
572    
573      <target name="prepare-src"
574              depends="configure-compiler"
575              if="prepare.src.dir">
576    
577        <mkdir dir="${prepare.src.dir}"/>
578        <copy todir="${prepare.src.dir}">
579          <fileset dir="${src.dir}">
580            <exclude name="java/lang/**"/>
581          </fileset>
582        </copy>
583    
584      </target>
585    
586    
587      <target name="configure-emulation">
588    
589        <condition property="build.emulation.true">
590          <or>
591            <and>
592              <os family="windows"/>
593              <not>
594                <isset property="build.emulation"/>
595              </not>
596            </and>
597            <istrue value="${build.emulation}"/>
598          </or>
599        </condition>
600    
601      </target>
602    
603    
604      <target name="configure-tests"
605           depends="configure-compiler">
606    
607        <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
608        <available property="junit.available"
609                   classname="junit.framework.Protectable"/>
610    
611        <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
612              unless="junit.available"/>
613    
614    
615        <!--
616         ! Bootclasspath munging for testing, so JUnit can test our local
617         ! modifications to java.*.
618         -->
619    
620        <path id="test.classpath">
621          <pathelement location="${product.jar}"/>
622          <pathelement location="${build.testcases.dir}"/>
623          <pathelement location="${junit.jar}"/>
624        </path>
625    
626        <path id="test.compile.bootclasspath">
627          <pathelement location="${javac.jar}"/>
628          <pathelement location="${collect.jar}"/>
629          <pathelement location="${rt.jar}"/>
630        </path>
631    
632        <path id="test.run.bootclasspath">
633          <pathelement location="${javac.jar}"/>
634          <path refid="test.classpath"/>
635        </path>
636    
637        <!-- Flatten test classpaths into platform-appropriate strings -->
638        <property name="test.classpath"             refid="test.classpath"/>
639        <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
640        <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
641    
642      </target>
643    
644    
645    
646      <!-- Anthill targets -->
647    
648      <target name="anthill-build"
649              depends="jar, test, docs, dist-docs"/>
650    
651      <target name="anthill-publish">
652    
653        <copy todir="${deployDir}/docs/private">
654          <fileset dir="${build.javadocs.dir}"/>
655        </copy>
656    
657        <copy todir="${deployDir}/docs/public">
658          <fileset dir="${dist.javadocs.dir}"/>
659        </copy>
660    
661        <copy tofile="${deployDir}/index.html"
662              file="${basedir}/etc/anthill-index.html"/>
663    
664        <copy todir="${deployDir}/notes">
665          <fileset dir="${basedir}/etc/notes"/>
666        </copy>
667    
668    </target>    </target>
669    
670    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.41

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