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

Diff of /jsr166/build.xml

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

revision 1.27 by tim, Wed May 28 00:33:17 2003 UTC revision 1.58 by tim, Mon Sep 15 15:13:35 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 3.8 or better 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 -->    <!-- User-specific settings -->
20    <property file="user.properties"/>    <property file="user.properties"/>
21    
   <!-- Set build.warnings in user.properties to turn on -warnunchecked -->  
   <!-- <property name="build.warnings" value=""/> -->  
   
22    
23    <!-- Compilation options -->    <!-- Compilation options -->
24    <property name="build.sourcelevel"    value="1.5"/>    <property name="build.sourcelevel"    value="1.5"/>
# Line 44  ant [target], where target is one of: Line 30  ant [target], where target is one of:
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"/>
   <property name="build.emulation.dir"  location="${build.dir}/emulation"/>  
33    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
34    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.lib.dir"        location="${build.dir}/lib"/>
35    <property name="build.ant.dir"        location="${build.dir}/ant"/>    <property name="build.ant.dir"        location="${build.dir}/ant"/>
36    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>
37      <property name="build.sinjdocs.dir"   location="${build.dir}/sinjdocs"/>
38    <property name="build.stripped.dir"   location="${build.dir}/stripped"/>    <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"/>    <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      <property name="build.dc-filter.dir"  location="${build.dir}/filterdocchk"/>
43      <property name="build.checkstyle.dir" location="${build.dir}/checkstyle"/>
44    
45    <!-- Source locations -->    <!-- Source locations -->
46    <property name="src.dir"              location="${basedir}/src/main"/>    <property name="src.dir"              location="${basedir}/src/main"/>
   <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>  
47    <property name="test.src.dir"         location="${basedir}/src/test"/>    <property name="test.src.dir"         location="${basedir}/src/test"/>
48    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
49    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
# Line 68  ant [target], where target is one of: Line 55  ant [target], where target is one of:
55    
56    <!-- Jar locations -->    <!-- Jar locations -->
57    <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"/>  
58    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
59    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
60      <property name="sinjdoc.jar"          location="${lib.dir}/sinjdoc.jar"/>
61    
62    
63    <!--    <!-- Files excluded from dist-docs -->
64     ! Bootclasspath munging for source compilation.    <patternset id="docs.exclusion">
65     -->      <exclude name="java/util/Random.*"/>
66        <exclude name="sun/misc/Unsafe.*"/>
67    <path id="javac.bootclasspath.prepend">    </patternset>
     <!-- <pathelement location="${src.dir}"/> -->  
     <pathelement location="${javac.jar}"/>  
   </path>  
   
   <path id="javac.bootclasspath">  
     <!-- <pathelement location="${src.dir}"/> -->  
     <pathelement location="${collect.jar}"/>  
     <pathelement location="${rt.jar}"/>  
   </path>  
   
   <!-- Flatten bootclasspath prefix into a platform-appropriate string -->  
   <property name="javac.bootclasspath.prepend" refid="javac.bootclasspath.prepend"/>  
   
   <!-- Turn the flattened bootclasspath prefix into a javac argument -->  
   <property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prepend}'/>  
   
   
   <!--  
    ! Bootclasspath munging for testing, so JUnit can test our local  
    ! modifications to java.*.  
    -->  
   
   <path id="test.classpath">  
     <pathelement location="${product.jar}"/>  
     <pathelement location="${build.testcases.dir}"/>  
     <pathelement location="${junit.jar}"/>  
   </path>  
   
   <!-- Flatten test classpath into a platform-appropriate string -->  
   <property name="test.classpath" refid="test.classpath"/>  
   
   <!-- Turn the flattened test classpath into a javac argument -->  
   <property name="test.javac.args" value='-Xbootclasspath/p:${test.classpath}'/>  
68    
69    
70    
71    <!-- Main targets -->    <!-- Main targets -->
72    
73    <target name="compile" depends="init"    <target name="compile"
74              depends="init, configure-compiler, prepare-src"
75            description="Compiles main sources to build folder">            description="Compiles main sources to build folder">
76    
77        <property name="prepare.src.dir" value="${src.dir}"/>
78    
79      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
80    
81      <javac srcdir="${src.dir}"      <javac srcdir="${prepare.src.dir}"
82            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
83              debug="${build.debug}"              debug="${build.debug}"
84         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
# Line 130  ant [target], where target is one of: Line 86  ant [target], where target is one of:
86             source="${build.sourcelevel}"             source="${build.sourcelevel}"
87               fork="true">               fork="true">
88    
89        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg line="${build.args}"/>
       <compilerarg line="${javac.args} ${build.warnings.option}"/>  
90    
91      </javac>      </javac>
92    
93    </target>    </target>
94    
95    
96    <target name="jar" depends="native-jar, emulation-jar"/>    <target name="jar"
97              depends="init-jar, native-jar"
98              description="Builds library jar from compiled sources"/>
99    
100    
101    <target name="test" depends="init, check-junit, report-tests"    <target name="test"
102            description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)"            depends="init, configure-tests, report-tests"
103    />            description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
104    
105    
106    <target name="checkstyle" depends="filter-src"    <target name="checkstyle"
107              depends="filter-src"
108            description="Reports on style errors in Java source (verbose, mostly chaff)">            description="Reports on style errors in Java source (verbose, mostly chaff)">
109    
110      <taskdef resource="checkstyletask.properties"      <taskdef resource="checkstyletask.properties"
111              classpath="${lib.dir}/checkstyle-all-2.4.jar"/>              classpath="${lib.dir}/checkstyle-all-3.1.jar"/>
112    
113      <checkstyle>      <mkdir dir="${build.checkstyle.dir}"/>
114        <formatter type="plain"/>  <!-- also available: type="xml" -->      
115        <checkstyle config="etc/checkstyle/sun_checks.xml"
116           failOnViolation="false">
117          <formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/>
118        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
119      </checkstyle>      </checkstyle>
120        
121        <style in="${build.checkstyle.dir}/checkstyle-report.xml"
122              out="${build.checkstyle.dir}/checkstyle-report.html"
123            style="${stylesheet.dir}/checkstyle-frames.xsl"/>
124    
125    </target>    </target>
126    
127    
128    <target name="doccheck" depends="filter-src"    <target name="doccheck"
129            description="Reports on javadoc style errors (not working yet)">            depends="filter-doccheck"
130              description="Reports on javadoc style errors">
131    
132      <delete dir="${build.doccheck.dir}"/>      <delete dir="${build.doccheck.dir}"/>
133      <mkdir dir="${build.doccheck.dir}"/>      <mkdir dir="${build.doccheck.dir}"/>
# Line 169  ant [target], where target is one of: Line 135  ant [target], where target is one of:
135      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
136           docletpath="${lib.dir}/doccheck.jar"           docletpath="${lib.dir}/doccheck.jar"
137              destdir="${build.doccheck.dir}">              destdir="${build.doccheck.dir}">
138        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.dc-filter.dir}"/>
139      </javadoc>      </javadoc>
140    
141        <echo>DocCheck output is in ${build.doccheck.dir}</echo>
142    
143    </target>    </target>
144    
145    
146    <target name="docs" depends="filter-src"    <target name="docs"
147              depends="filter-src"
148            description="Builds javadocs with custom tags to build folder">            description="Builds javadocs with custom tags to build folder">
149    
150      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
# Line 187  ant [target], where target is one of: Line 156  ant [target], where target is one of:
156                source="${build.docsourcelevel}">                source="${build.docsourcelevel}">
157    
158        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
159        <tag name="spec" description="Specified by:"/>        <tag name="spec"    description="Specified by:"/>
160        <tag name="editor" description="Last edited by:"/>  
       <tag name="fixme" description="FIX ME:"/>  
161        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.src.dir}"/>
162    
163      </javadoc>      </javadoc>
# Line 197  ant [target], where target is one of: Line 165  ant [target], where target is one of:
165    </target>    </target>
166    
167    
168    <!--    <target name="sinjdocs"
169     # javac -s doesn't reliably generate compilable code. It generates            depends="configure-tests"
170     # bridge methods (marked as "synthetic") that can have identical            description="Builds javadocs with custom tags to build folder">
171     # signatures to existing methods except for the return value.  
172     -->      <delete dir="${build.sinjdocs.dir}"/>
173    <target name="strip" depends="init">      <mkdir dir="${build.sinjdocs.dir}"/>
174    
175      <mkdir dir="${build.stripped.dir}"/>      <java classname="net.cscott.sinjdoc.Main" fork="true">
176    
177      <javac srcdir="${src.dir}"        <jvmarg value="-Xbootclasspath/p:${test.bootclasspath}"/>
           destdir="${build.stripped.dir}"  
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
178    
179        <bootclasspath refid="javac.bootclasspath"/>        <classpath>
180        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>          <pathelement location="${sinjdoc.jar}"/>
181            <pathelement location="${lib.dir}/jutil.jar"/>
182            <pathelement location="${lib.dir}/cup.jar"/>
183            <path refid="test.classpath"/>
184          </classpath>
185    
186      </javac>        <!-- <arg value="-help"/> -->
187          <!-- <arg value="-verbose"/> -->
188          <!-- <arg value="-link"/>  <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> -->
189          
190          <arg value="-d"/>          <arg value="${build.sinjdocs.dir}"/>
191          <arg value="-sourcepath"/> <arg value="${src.dir}"/>
192          <arg value="-overview"/>   <arg value="${src.dir}/intro.html"/>
193          <arg value="-source"/>     <arg value="${build.sourcelevel}"/>
194          
195          <arg value="java.lang"/>
196          <arg value="java.util"/>
197          <arg value="java.util.concurrent"/>
198          <arg value="java.util.concurrent.atomic"/>
199          <arg value="java.util.concurrent.locks"/>
200    
201    
202        </java>
203    
204    </target>    </target>
205    
206    
207    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"    <target name="dist"
208              depends="init, dist-clean, dist-jar, dist-docs"
209            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
210    
211    
212      <target name="release"
213              depends="dist"
214              description="Puts entire CVS tree, plus distribution productions, in a jar">
215    
216        <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
217    
218        <jar basedir="${basedir}" destfile="${release.jar}">
219          <!-- <exclude name="build/**"/> -->
220          <exclude name="${release.jar}"/>
221          <exclude name="user.properties"/>
222          <exclude name="etc/notes/**"/>
223          <exclude name="src/emulation/**"/>
224          <exclude name="**/SyntaxTest.java"/>
225          <exclude name="**/SuperfluousAbstract.java"/>
226        </jar>
227    
228      </target>
229    
230    <target name="clean"    <target name="clean"
231            description="Removes all build products">            description="Removes all build products">
232    
# Line 244  ant [target], where target is one of: Line 245  ant [target], where target is one of:
245    </target>    </target>
246    
247    
248    <!-- Anthill targets -->    <target name="dist-docs"
249              depends="filter-src"
250    <!-- Should really run the tests instead of just the jar target -->            description="Builds javadocs without custom tags to dist folder">
   <target name="anthill-build" depends="jar, test, docs, dist-docs"/>  
   
   <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>  
     <copy tofile="${deployDir}/index.html"  
           file="${basedir}/etc/anthill-index.html"/>  
     <copy todir="${deployDir}/notes">  
       <fileset dir="${basedir}/etc/notes"/>  
     </copy>  
   </target>  
251    
252        <delete dir="${dist.javadocs.dir}"/>
253        <mkdir dir="${dist.javadocs.dir}"/>
254    
255    <!-- Internal targets -->      <javadoc destdir="${dist.javadocs.dir}"
256                    link="http://java.sun.com/j2se/1.4.1/docs/api"
257                overview="${src.dir}/intro.html"
258                  source="${build.docsourcelevel}">
259    
260    <target name="set-warnings-if" if="build.warnings">        <packageset dir="${build.filter.src.dir}"/>
261    
262      <property name="build.warnings.option" value="-warnunchecked"/>      </javadoc>
263    
264    </target>    </target>
265    
266    
   <target name="set-warnings-unless" unless="build.warnings">  
   
     <property name="build.warnings.option" value=""/>  
267    
268    </target>    <!-- Internal targets -->
269    
270    
271    <target name="init" depends="set-warnings-if, set-warnings-unless">    <target name="init">
272    
273      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
274      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
275      <echo>Building JSR-166 version ${version}</echo>      <echo>Building JSR-166 version ${version}</echo>
276        <echo>java.home is ${java.home}</echo>
277    
278    </target>    </target>
279    
280    
281    <target name="native-jar" depends="compile"    <target name="init-jar">
           description="Builds library jar from compiled sources">  
282    
283      <mkdir dir="${build.lib.dir}"/>      <mkdir dir="${build.lib.dir}"/>
284    
     <jar destfile="${product.jar}">  
       <fileset dir="${build.classes.dir}"/>  
     </jar>  
   
285    </target>    </target>
286    
287    
288    <target name="compile-emulation" depends="init"    <target name="native-jar"
289            if="build.emulation"            depends="compile">
           description="Compiles emulation sources to build folder">  
   
     <mkdir dir="${build.emulation.dir}"/>  
   
     <javac srcdir="${emulation.src.dir}"  
           destdir="${build.emulation.dir}"  
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
   
       <bootclasspath refid="javac.bootclasspath"/>  
       <compilerarg line="${javac.args} ${build.warnings.option}"/>  
290    
291      </javac>      <jar destfile="${product.jar}">
292          <fileset dir="${build.classes.dir}"/>
   </target>  
   
   
   <target name="emulation-jar" depends="native-jar, compile-emulation"  
           if="build.emulation">  
   
     <jar destfile="${product.jar}" update="true" duplicate="add">  
       <fileset dir="${build.emulation.dir}"/>  
293      </jar>      </jar>
294    
295    </target>    </target>
296    
297    
298    <target name="dist-jar" depends="clean, jar">    <target name="dist-jar"
299              depends="clean, jar">
300    
301      <copy file="${product.jar}" todir="${dist.dir}"/>      <copy file="${product.jar}" todir="${dist.dir}"/>
302    
303    </target>    </target>
304    
305    
306    <target name="dist-docs" depends="filter-src"    <target name="compile-ant-filter"
307            description="Builds javadocs without custom tags to dist folder">            depends="init">
   
     <delete dir="${dist.javadocs.dir}"/>  
     <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.docsourcelevel}">  
   
       <packageset dir="${build.filter.src.dir}"/>  
   
     </javadoc>  
   
   </target>  
   
   
   <target name="compile-ant-filter" depends="init">  
308    
309      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
310    
# Line 370  ant [target], where target is one of: Line 316  ant [target], where target is one of:
316    </target>    </target>
317    
318    
319    <target name="filter-src" depends="compile-ant-filter">    <target name="filter-src"
320              depends="compile-ant-filter">
321    
322      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
323    
324      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
325        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
326          <include name="**/*.java"/>          <include name="**/*.html"/>
327          <exclude name="**/Random.java"/>        </fileset>
328          <exclude name="**/Unsafe.java"/>      </copy>
329    
330        <copy todir="${build.filter.src.dir}">
331          <fileset dir="${src.dir}">
332            <exclude name="**/*.html"/>
333            <patternset refid="docs.exclusion"/>
334        </fileset>        </fileset>
335        <filterchain>        <filterchain>
336    
337            <!--
338             # This filter gets rid of angle-bracketed type parameters
339             # so that javadoc can run on the result. The following
340             # heuristic seems to work:
341             #
342             # For all lines not starting with space(s)-asterisk-space(s),
343             #   replace <something> with a space, where there may be more
344             #   than one right angle bracket at the end, and "something"
345             #   must not contain parens or pipes. (This may need some
346             #   tweaking.)
347             -->
348    
349          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
350                        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.)  
            -->  
351            <param name="notmatching" value="^\s+\*\s.*$"/>            <param name="notmatching" value="^\s+\*\s.*$"/>
352            <param name="pattern" value="&lt;[^|>()]+?>+"/>            <param name="pattern"     value="&lt;[^|>()]+?>+"/>
353            <param name="replacement" value=" "/>            <param name="replacement" value=" "/>
354          </filterreader>          </filterreader>
355    
356          </filterchain>
357        </copy>
358    
359      </target>
360    
361    
362      <target name="filter-doccheck"
363              depends="filter-src">
364    
365        <mkdir dir="${build.dc-filter.dir}"/>
366    
367        <copy todir="${build.dc-filter.dir}">
368          <fileset dir="${build.filter.src.dir}">
369            <include name="**/*.html"/>
370          </fileset>
371        </copy>
372    
373        <property name="generic.declarations"
374                 value="/** Fake type parameter. */ public interface E {} /** Fake type parameter. */ public interface T {} /** Fake type parameter. */ public interface K {} /** Fake type parameter. */ public interface V {}"
375        />
376    
377        <copy todir="${build.dc-filter.dir}">
378          <fileset dir="${build.filter.src.dir}">
379            <exclude name="**/*.html"/>
380          </fileset>
381          <filterchain>
382            <!--
383             # These 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    
390          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
391                        classpath="${build.ant.dir}">                        classpath="${build.ant.dir}">
392            <!--            <param name="matching"    value="^\s*assert[\s ].*$"/>
393             # These arguments are to uncomment lines beginning with            <param name="pattern"     value="assert"/>
394             # "//@" so that javadoc can see imports that are needed            <param name="replacement" value="//assert"/>
            # to resolve links but that shouldn't be in the compiled  
            # code.  
            -->  
           <param name="matching" value="^//@.*$"/>  
           <param name="pattern" value="^//@"/>  
           <param name="replacement" value=""/>  
395          </filterreader>          </filterreader>
396    
397            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
398                          classpath="${build.ant.dir}">
399              <param name="matching"    value="^([^*]*(class|interface|implements) .*|)\{.*$"/>
400              <param name="pattern"     value="$"/>
401              <param name="replacement" value=" ${generic.declarations}"/>
402            </filterreader>
403    
404        </filterchain>        </filterchain>
405      </copy>      </copy>
406    
407    </target>    </target>
408    
409    
410    <target name="compile-tests" depends="jar">    <target name="compile-tests"
411              depends="jar">
412    
413      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
414    
# Line 428  ant [target], where target is one of: Line 420  ant [target], where target is one of:
420             source="${build.sourcelevel}"             source="${build.sourcelevel}"
421               fork="true">               fork="true">
422    
423        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg line="${build.args}"/>
       <compilerarg line="${javac.args} ${build.warnings.option}"/>  
424        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
425          
426          <include name="java/**"/>
427          <include name="jsr166/**"/>
428    
429      </javac>      </javac>
430    
431    </target>    </target>
432    
433    
434    <target name="run-tests" depends="compile-tests">    <target name="run-tests"
435              depends="compile-tests">
436    
437      <!-- May be overridden by user.properties -->      <!-- May be overridden by user.properties -->
438      <property name="testcase" value="*"/>      <property name="testcase" value="*"/>
# Line 451  ant [target], where target is one of: Line 446  ant [target], where target is one of:
446                      dir="${build.reports.dir}"                      dir="${build.reports.dir}"
447                     fork="true">                     fork="true">
448    
449        <jvmarg value="${test.javac.args}"/>        <jvmarg value="-Xbootclasspath:${test.bootclasspath}"/>
450    
451        <formatter type="xml"/>        <formatter type="xml"/>
452    
453        <batchtest todir="${build.reports.dir}">        <batchtest todir="${build.reports.dir}">
454          <fileset dir="${test.src.dir}">          <fileset dir="${test.src.dir}">
455            <include name="**/${testcase}Test.java"/>            <include name="java/**/${testcase}Test.java"/>
456              <include name="jsr166/**/${testcase}Test.java"/>
457          </fileset>          </fileset>
458        </batchtest>        </batchtest>
459    
# Line 466  ant [target], where target is one of: Line 462  ant [target], where target is one of:
462    </target>    </target>
463    
464    
465    <target name="report-tests" depends="run-tests">    <target name="report-tests"
466      <!-- Sets junit.report.format to frames if Xalan is present,            depends="run-tests">
467    
468        <!-- Sets junit.report.format to frames if redirection is present,
469           otherwise sets it to noframes. -->           otherwise sets it to noframes. -->
470      <available property="junit.report.format"      <available property="junit.report.format"
471                    value="frames"                    value="frames"
# Line 486  ant [target], where target is one of: Line 484  ant [target], where target is one of:
484      </junitreport>      </junitreport>
485    
486      <fail message="Test Cases Failed" if="junit.failed"/>      <fail message="Test Cases Failed" if="junit.failed"/>
487    
488    </target>    </target>
489    
490    
491    <target name="check-junit">    <target name="configure-compiler">
492      <!-- FIXME: this test isn't specific enough -->  
493        <property name="unchecked.option" value="-Xlint:unchecked"/>
494    
495        <condition property="warnunchecked.arg" value="${unchecked.option}">
496          <istrue value="${build.warnunchecked}"/>
497        </condition>
498    
499        <property name="warnunchecked.arg" value=""/>
500        
501        <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
502          <istrue value="${build.nothreads}"/>
503        </condition>
504    
505    
506        <!-- Common options in javac invocations -->
507        <property name="build.args" value="${warnunchecked.arg}"/>
508    
509      </target>
510    
511    
512      <target name="prepare-src"
513              depends="configure-compiler"
514              if="prepare.src.dir">
515    
516        <mkdir dir="${prepare.src.dir}"/>
517        <copy todir="${prepare.src.dir}">
518          <fileset dir="${src.dir}">
519            <exclude name="java/lang/**"/>
520          </fileset>
521        </copy>
522    
523      </target>
524    
525    
526      <target name="configure-tests"
527           depends="configure-compiler">
528    
529        <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
530      <available property="junit.available"      <available property="junit.available"
531                 classname="junit.framework.TestCase"/>                 classname="junit.framework.Protectable"/>
532      <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>  
533        <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
534              unless="junit.available"/>
535    
536        <!-- Xalan -->
537        <available property="xalan.available"
538                   classname="org.apache.xalan.Version"/>
539    
540        <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
541              unless="xalan.available"/>
542    
543    
544        <!--
545         ! Bootclasspath munging for testing, so JUnit can test our local
546         ! modifications to java.*.
547         -->
548    
549        <path id="test.classpath">
550          <pathelement location="${product.jar}"/>
551          <pathelement location="${rt.jar}"/>
552          <pathelement location="${junit.jar}"/>
553          <pathelement location="${build.testcases.dir}"/>
554        </path>
555    
556        <path id="test.bootclasspath">
557          <path refid="test.classpath"/>
558        </path>
559    
560        <!-- Flatten test classpaths into platform-appropriate strings -->
561        <property name="test.classpath"         refid="test.classpath"/>
562        <property name="test.bootclasspath"     refid="test.bootclasspath"/>
563    
564      </target>
565    
566    
567    
568      <!-- Anthill targets -->
569    
570      <target name="anthill-build">
571      
572        <!-- Override this in user.properties -->
573        <property name="tiger.home" location="e:/j2sdk1.5.0"/>
574        
575        <exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java">
576          <arg value="-Xmx256000000"/>
577          <!-- classpath of new JVM -->
578          <arg value="-classpath"/> <arg path="${java.class.path}"/>
579          <!-- location of Ant home directory -->
580          <arg value="-Dant.home=${ant.home}"/>
581          <!-- the Ant main class -->
582          <arg value="org.apache.tools.ant.Main"/>
583          <!-- The build file -->
584          <arg value="-buildfile"/>  <arg value="build.xml"/>
585          <!-- the target to build on the new Ant instance -->
586          <arg value="-DJAVA_HOME=${tiger.home}"/>
587          <arg value="do-anthill-build"/>
588        </exec>
589      </target>
590      
591      <target name="do-anthill-build"
592              depends="jar, test, docs, dist-docs"/>
593    
594      <target name="anthill-publish">
595    
596        <copy todir="${deployDir}/docs/private">
597          <fileset dir="${build.javadocs.dir}"/>
598        </copy>
599    
600        <copy todir="${deployDir}/docs/public">
601          <fileset dir="${dist.javadocs.dir}"/>
602        </copy>
603    
604        <copy tofile="${deployDir}/index.html"
605              file="${basedir}/etc/anthill-index.html"/>
606    
607        <copy todir="${deployDir}/notes">
608          <fileset dir="${basedir}/etc/notes"/>
609        </copy>
610    
611      </target>
612    
613    
614      <target name="ng" depends="test">
615        <java classname="SuperfluousAbstract" fork="true">
616    
617          <jvmarg value="-Xbootclasspath/p:${test.bootclasspath}"/>
618    
619        </java>
620    </target>    </target>
621    
622    

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.58

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