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

Diff of /jsr166/build.xml

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

revision 1.25, Mon May 19 11:33:20 2003 UTC revision 1.84, Thu Nov 25 12:48:45 2010 UTC
# Line 1  Line 1 
1  <project name="jsr166" default="usage">  <project name="jsr166" default="usage">
2    
3    <description>    <description>
4    ------------------------------------------------------------------------------
5      Build file for JSR-166      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"/>    <property file="user.properties"/>
21    <property name="testcase" value="*"/>  
22    
23    <!-- Compilation options -->    <!-- Compilation options -->
24    <property name="build.sourcelevel"    value="1.5"/>    <property name="build.sourcelevel"    value="1.6"/>
   <property name="build.docsourcelevel" value="1.4"/>  
25    <property name="build.debug"          value="true"/>    <property name="build.debug"          value="true"/>
26    <property name="build.debuglevel"     value="source,lines,vars"/>    <property name="build.debuglevel"     value="source,lines,vars"/>
27    <property name="build.deprecation"    value="false"/>    <property name="build.deprecation"    value="false"/>
   <!--  
   <property name="build.warnings"       value="true"/>  
   -->  
28    
29    <!-- Build locations -->    <!-- Build locations -->
30    <property name="build.dir"            location="build"/>    <property name="build.dir"            location="build"/>
31    <property name="build.classes.dir"    location="${build.dir}/classes"/>    <property name="build.classes.dir"    location="${build.dir}/classes"/>
32    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
33      <property name="build.loops.dir"             location="${build.dir}/loops"/>
34    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.lib.dir"        location="${build.dir}/lib"/>
   <property name="build.ant.dir"        location="${build.dir}/ant"/>  
35    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>
   <property name="build.stripped.dir"   location="${build.dir}/stripped"/>  
36    <property name="build.reports.dir"    location="${build.dir}/reports"/>    <property name="build.reports.dir"    location="${build.dir}/reports"/>
37    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>    <property name="build.jsr166x.dir"           location="${build.dir}/jsr166x"/>
38    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>    <property name="build.jsr166xlib.dir"        location="${build.dir}/jsr166xlib"/>
39      <property name="build.jsr166xjavadocs.dir"   location="${build.dir}/jsr166xjavadocs"/>
40    
41      <property name="build.jsr166y.dir"           location="${build.dir}/jsr166y"/>
42      <property name="build.jsr166ylib.dir"        location="${build.dir}/jsr166ylib"/>
43      <property name="build.jsr166yjavadocs.dir"   location="${build.dir}/jsr166yjavadocs"/>
44    
45      <property name="build.extra166y.dir"         location="${build.dir}/extra166y"/>
46      <property name="build.extra166ylib.dir"      location="${build.dir}/extra166ylib"/>
47      <property name="build.extra166yjavadocs.dir" location="${build.dir}/extra166yjavadocs"/>
48    
49    <!-- Source locations -->    <!-- Source locations -->
50    <property name="src.dir"              location="${basedir}/src/main"/>    <property name="src.dir"              location="${basedir}/src/main"/>
51    <property name="test.src.dir"         location="${basedir}/src/test"/>    <property name="test.src.dir"         location="${basedir}/src/test"/>
52    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="loops.src.dir"        location="${basedir}/src/loops"/>
53    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
54      <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>
55    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
56    <property name="dist.dir"             location="${basedir}/dist"/>    <property name="dist.dir"             location="${basedir}/dist"/>
57      <property name="topsrc.dir"           location="${basedir}/src"/>
58      <property name="jsr166xsrc.dir"       location="${basedir}/src/jsr166x"/>
59      <property name="jsr166ysrc.dir"       location="${basedir}/src/jsr166y"/>
60      <property name="extra166ysrc.dir"     location="${basedir}/src/extra166y"/>
61      <property name="jdksrc.dir"           location="/home/dl/1.6.0/j2se/martin/j2se/src/share/classes"/>
62    <!-- Distribution locations -->    <!-- Distribution locations -->
63    <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>    <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>
64      <property name="dist.jsr166xjavadocs.dir"    location="${dist.dir}/jsr166xdocs"/>
65      <property name="dist.jsr166yjavadocs.dir"    location="${dist.dir}/jsr166ydocs"/>
66      <property name="dist.extra166yjavadocs.dir"  location="${dist.dir}/extra166ydocs"/>
67    
68    <!-- Jar locations -->    <!-- Jar locations -->
69    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
70    <property name="javac.jar"            location="${lib.dir}/javac.jar"/>    <property name="jsr166xproduct.jar"   location="${build.jsr166xlib.dir}/jsr166x.jar"/>
71    <property name="collect.jar"          location="${lib.dir}/collect.jar"/>    <property name="jsr166yproduct.jar"   location="${build.jsr166ylib.dir}/jsr166y.jar"/>
72      <property name="extra166yproduct.jar" location="${build.extra166ylib.dir}/extra166y.jar"/>
73    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
   <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>  
74    
75    <property name="javac.args"           value='-J-Xbootclasspath/p:${javac.jar}'/>    <!-- Bootclasspath argument -->
76      <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>
77    
78    <path id="javac.bootclasspath">    <!-- Test classpath -->
79      <pathelement location="${collect.jar}"/>    <path id="test.classpath">
80      <pathelement location="${rt.jar}"/>      <pathelement location="${build.testcases.dir}"/>
81        <pathelement location="${junit.jar}"/>
82    </path>    </path>
83    
84    <path id="test.classpath">    <!-- ALoops classpath -->
85      <pathelement location="${product.jar}"/>    <path id="loops.classpath">
86        <pathelement location="${build.loops.dir}"/>
87    </path>    </path>
88    
89    
90    <!-- Main targets -->    <!-- Main targets -->
91    
92    <target name="compile" depends="init"    <target name="dists"
93            description="Compiles all sources to build folder">            depends="dist, jsr166xdist, jsr166ydist, extra166ydist"
94              description="Builds all public jars and docs"/>
95    
96      <target name="compile"
97              depends="init, configure-compiler"
98              description="Compiles main sources to build folder">
99    
100      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
101    
102      <javac srcdir="${src.dir}"      <javac srcdir="${src.dir}"
103            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
104              debug="${build.debug}"              debug="${build.debug}"
# Line 95  Line 107 
107             source="${build.sourcelevel}"             source="${build.sourcelevel}"
108               fork="true">               fork="true">
109    
110        <bootclasspath refid="javac.bootclasspath"/>        <include name="**/*.java"/>
111        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <compilerarg value="-XDignore.symbol.file=true"/>
112    
113    <!--
114          <exclude name="java/lang/**"/>
115          <compilerarg line="${build.args}"/>
116          <compilerarg line="-Xlint -Xmaxwarns 1000"/>
117    -->
118    
119      </javac>      </javac>
120    
121    </target>    </target>
122    
123    
124    <target name="jar" depends="compile"  
125      <target name="jar"
126              depends="compile"
127            description="Builds library jar from compiled sources">            description="Builds library jar from compiled sources">
128    
129      <mkdir dir="${build.lib.dir}"/>      <mkdir dir="${build.lib.dir}"/>
     <jar basedir="${build.classes.dir}"  
         destfile="${product.jar}"  
     />  
   </target>  
130    
131        <jar destfile="${product.jar}">
132          <fileset dir="${build.classes.dir}"/>
133        </jar>
134    
135    <target name="test" depends="init, check-junit, report-tests"    </target>
           description="Runs all tests (requires JUnit 1.8 in ${ant.home}/lib)"/>  
136    
137    
   <target name="checkstyle" depends="filter-src"  
           description="Reports on style errors in Java source (verbose, mostly chaff)">  
     <taskdef resource="checkstyletask.properties"  
             classpath="${lib.dir}/checkstyle-all-2.4.jar"/>  
   
     <checkstyle>  
       <formatter type="plain"/>  <!-- also available: type="xml" -->  
       <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>  
     </checkstyle>  
   </target>  
138    
139      <target name="test"
140              depends="init, configure-tests, report-tests"
141              description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
142    
   <target name="doccheck" depends="filter-src"  
           description="Reports on javadoc style errors (not working yet)">  
     <delete dir="${build.doccheck.dir}"/>  
     <mkdir dir="${build.doccheck.dir}"/>  
     <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"  
          docletpath="${lib.dir}/doccheck.jar"  
             destdir="${build.doccheck.dir}">  
       <packageset dir="${build.filter.src.dir}"/>  
     </javadoc>  
   </target>  
143    
144    
145    <target name="docs" depends="filter-src"    <target name="docs"
146            description="Builds javadocs with custom tags to build folder">            description="Builds javadocs with custom tags to build folder">
147    
148      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
149      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${build.javadocs.dir}"/>
150    
151      <javadoc destdir="${build.javadocs.dir}"      <javadoc destdir="${build.javadocs.dir}"
152                  link="http://java.sun.com/j2se/1.4.1/docs/api"                  link="http://download.oracle.com/javase/6/docs/api/"
153              overview="${src.dir}/intro.html"              overview="${src.dir}/intro.html"
154                source="${build.docsourcelevel}">              sourcepath="${src.dir}:${jdksrc.dir}"
155        >
156    
157        <tag name="revised" description="Last revised:"/>        <packageset dir="${src.dir}"/>
       <tag name="spec" description="Specified by:"/>  
       <tag name="editor" description="Last edited by:"/>  
       <tag name="fixme" description="FIX ME:"/>  
       <packageset dir="${build.filter.src.dir}"/>  
158    
159      </javadoc>      </javadoc>
160    
161    </target>    </target>
162    
163    
   <!--  
    # javac -s doesn't reliably generate compilable code. It generates  
    # bridge methods (marked as "synthetic") that can have identical  
    # signatures to existing methods except for the return value.  
    -->  
   <target name="strip" depends="init">  
     <mkdir dir="${build.stripped.dir}"/>  
     <javac srcdir="${src.dir}"  
           destdir="${build.stripped.dir}"  
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
164    
165        <bootclasspath refid="javac.bootclasspath"/>    <target name="dist"
166        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>            depends="init, dist-clean, dist-jar, dist-docs"
167              description="Puts all distributable products in single hierarchy"/>
168    
     </javac>  
   </target>  
169    
170      <target name="release"
171              depends="dist"
172              description="Puts entire CVS tree, plus distribution productions, in a jar">
173    
174        <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
175    
176        <jar basedir="${basedir}" destfile="${release.jar}">
177          <!-- <exclude name="build/**"/> -->
178          <exclude name="${release.jar}"/>
179          <exclude name="user.properties"/>
180          <exclude name="etc/notes/**"/>
181          <exclude name="src/emulation/**"/>
182          <exclude name="**/SyntaxTest.java"/>
183          <exclude name="**/SuperfluousAbstract.java"/>
184        </jar>
185    
186      </target>
187    
   <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"  
           description="Puts all distributable products in single hierarchy"/>  
188    
189    
190    <target name="clean"    <target name="clean"
191            description="Removes all build products">            description="Removes all build products">
192    
193      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
194      <delete dir="${build.classes.dir}"/>      <delete dir="${build.classes.dir}"/>
195      <delete dir="${build.lib.dir}"/>      <delete dir="${build.lib.dir}"/>
196    
197    </target>    </target>
198    
199    
200    
201    <target name="dist-clean"    <target name="dist-clean"
202            description="Removes all build and distribution products">            description="Removes all build and distribution products">
203    
204      <delete dir="${dist.dir}"/>      <delete dir="${dist.dir}"/>
205    
206    </target>    </target>
207    
208    
   <!-- Anthill targets -->  
209    
210    <!-- Should really run the tests instead of just the jar target -->    <target name="dist-docs"
211    <target name="anthill-build" depends="jar, docs, dist-docs"/>            description="Builds javadocs without custom tags to dist folder">
212    
213    <target name="anthill-publish">      <delete dir="${dist.javadocs.dir}"/>
214      <copy todir="${deployDir}/docs/private">      <mkdir dir="${dist.javadocs.dir}"/>
       <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>  
215    
216        <javadoc destdir="${dist.javadocs.dir}"
217                link="http://download.oracle.com/javase/6/docs/api/"
218                overview="${src.dir}/intro.html"
219    
220    <!-- Internal targets -->              sourcepath="${src.dir}:${jdksrc.dir}"
221         >
222    <!--
223          <packageset dir="${src.dir}" defaultexcludes="yes">
224          <include name="java/util/concurrent"/>
225          <include name="java/util/concurrent/atomic"/>
226          <include name="java/util/concurrent/locks"/>
227          </packageset>
228    -->
229          <fileset dir="${topsrc.dir}" defaultexcludes="yes">
230          <include name="main/java/util/concurrent/*.java"/>
231          <include name="main/java/util/concurrent/atomic/*.java"/>
232          <include name="main/java/util/concurrent/locks/*.java"/>
233          <include name="main/java/util/*.java"/>
234    <!--
235          <include name="main/java/util/concurrent/*.html"/>
236          <include name="main/java/util/concurrent/atomic/*.html"/>
237          <include name="main/java/util/concurrent/locks/*.html"/>
238          <include name="main/java/util/*.html"/>
239    -->
240    <!--      <include name="jsr166x/*.java"/> -->
241          </fileset>
242        </javadoc>
243    
   <target name="set-warnings-if" if="build.warnings">  
     <property name="build.warnings.option" value="-warnunchecked"/>  
244    </target>    </target>
245    
246    
247    <target name="set-warnings-unless" unless="build.warnings">  
248      <property name="build.warnings.option" value=""/>    <!-- Internal targets -->
   </target>  
249    
250    
251    <target name="init" depends="set-warnings-if, set-warnings-unless">    <target name="init">
252    
253      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
254      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
255      <echo>Building JSR-166 version ${version}</echo>      <echo>Building JSR-166 version ${version}</echo>
256        <echo>java.home is ${java.home}</echo>
257    
258    </target>    </target>
259    
260    
261    <target name="dist-jar" depends="clean, jar">    <target name="dist-jar"
262              depends="clean, jar">
263    
264      <copy file="${product.jar}" todir="${dist.dir}"/>      <copy file="${product.jar}" todir="${dist.dir}"/>
265    
266    </target>    </target>
267    
268    
269    <target name="dist-docs" depends="filter-src"    <target name="compile-tests"
270            description="Builds javadocs without custom tags to dist folder">            depends="jar">
     <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}">  
271    
272        <packageset dir="${build.filter.src.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
273    
274      </javadoc>      <javac srcdir="${tck.src.dir}"
275    </target>            destdir="${build.testcases.dir}"
276                debug="${build.debug}"
277           debuglevel="${build.debuglevel}"
278          deprecation="${build.deprecation}"
279               source="${build.sourcelevel}"
280                 fork="true">
281    
282          <compilerarg value="${bootclasspath.args}"/>
283          <compilerarg line="${build.args}"/>
284          <compilerarg value="-XDignore.symbol.file=true"/>
285    
286    <target name="compile-ant-filter" depends="init">        <classpath refid="test.classpath"/>
     <mkdir dir="${build.ant.dir}"/>  
     <javac srcdir="${ant.src.dir}"  
           destdir="${build.ant.dir}"  
            source="1.4"  
     />  
   </target>  
287    
288        </javac>
289    
290    <target name="filter-src" depends="compile-ant-filter">      <javac srcdir="${test.src.dir}"
291      <mkdir dir="${build.filter.src.dir}"/>            destdir="${build.testcases.dir}"
292      <copy todir="${build.filter.src.dir}">              debug="${build.debug}"
293        <fileset dir="${src.dir}">         debuglevel="${build.debuglevel}"
294          <include name="**/*.java"/>        deprecation="${build.deprecation}"
295        </fileset>             source="${build.sourcelevel}"
296        <filterchain>               fork="true">
         <filterreader classname="jsr166.ant.filters.ReplaceFilter"  
                       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.)  
            -->  
           <param name="notmatching" value="^\s+\*\s.*$"/>  
           <param name="pattern" value="&lt;[^|>()]+?>+"/>  
           <param name="replacement" value=" "/>  
         </filterreader>  
         <filterreader classname="jsr166.ant.filters.ReplaceFilter"  
                       classpath="${build.ant.dir}">  
           <!--  
            # These arguments are to uncomment lines beginning with  
            # "//@" 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="^//@"/>  
           <param name="replacement" value=""/>  
         </filterreader>  
       </filterchain>  
     </copy>  
   </target>  
297    
298          <include name="jsr166/test/**"/>
299    
300    <target name="compile-tests" depends="jar">        <compilerarg value="${bootclasspath.args}"/>
301      <mkdir dir="${build.testcases.dir}"/>        <compilerarg line="${build.args}"/>
302      <javac srcdir="${test.src.dir}"        <compilerarg value="-XDignore.symbol.file=true"/>
303    
304          <classpath refid="test.classpath"/>
305    
306        </javac>
307    
308    <!--
309        <javac srcdir="${jtreg.src.dir}"
310            destdir="${build.testcases.dir}"            destdir="${build.testcases.dir}"
311              debug="${build.debug}"              debug="${build.debug}"
312         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
# Line 317  Line 314 
314             source="${build.sourcelevel}"             source="${build.sourcelevel}"
315               fork="true">               fork="true">
316    
317        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg value="${bootclasspath.args}"/>
318        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <compilerarg line="${build.args}"/>
319          <compilerarg value="-XDignore.symbol.file=true"/>
320    
321        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
322    
323      </javac>      </javac>
324    -->
325    
326    </target>    </target>
327    
328    
329    <target name="run-tests" depends="compile-tests">    <target name="run-tests"
330              depends="compile-tests">
331    
332        <!-- May be overridden by user.properties -->
333        <property name="testcase" value="*"/>
334    
335      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.reports.dir}"/>
336    
337      <junit printsummary="true"      <junit printsummary="true"
338               showoutput="true"               showoutput="true"
339            errorProperty="junit.failed"            errorProperty="junit.failed"
# Line 334  Line 341 
341                      dir="${build.reports.dir}"                      dir="${build.reports.dir}"
342                     fork="true">                     fork="true">
343    
344        <!--        <jvmarg value="${bootclasspath.args}"/>
345         ! This nastiness is so JUnit can test classes we are inserting        <jvmarg value="-server"/>
346         ! into the java.* packages.        <jvmarg value="-showversion"/>
347         -->  
348        <jvmarg value="-Xbootclasspath/p:${product.jar};${build.testcases.dir};${junit.jar}"/>        <classpath refid="test.classpath"/>
349    
350        <formatter type="xml"/>        <formatter type="xml"/>
351    
352        <batchtest todir="${build.reports.dir}">        <batchtest todir="${build.reports.dir}" unless="no.test.tck">
353            <fileset dir="${tck.src.dir}">
354              <include name="**/${testcase}Test.java"/>
355            </fileset>
356          </batchtest>
357    
358          <batchtest todir="${build.reports.dir}" if="do.test.old">
359          <fileset dir="${test.src.dir}">          <fileset dir="${test.src.dir}">
360              <include name="jsr166/test/**/${testcase}Test.java"/>
361            </fileset>
362          </batchtest>
363    
364    <!--
365          <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
366            <fileset dir="${jtreg.src.dir}">
367            <include name="**/${testcase}Test.java"/>            <include name="**/${testcase}Test.java"/>
368          </fileset>          </fileset>
369        </batchtest>        </batchtest>
370    -->
371    
372      </junit>      </junit>
373    
374    </target>    </target>
375    
376    
377    <target name="report-tests" depends="run-tests">    <target name="report-tests"
378      <!-- Sets junit.report.format to frames if Xalan is present,            depends="run-tests">
379    
380        <!-- Sets junit.report.format to frames if redirection is present,
381           otherwise sets it to noframes. -->           otherwise sets it to noframes. -->
382      <available property="junit.report.format"      <available property="junit.report.format"
383                    value="frames"                    value="frames"
# Line 365  Line 389 
389        <fileset dir="${build.reports.dir}">        <fileset dir="${build.reports.dir}">
390          <include name="TEST-*.xml"/>          <include name="TEST-*.xml"/>
391        </fileset>        </fileset>
392        <report styledir="${stylesheet.dir}"        <report format="${junit.report.format}" todir="${build.reports.dir}"
                 format="${junit.report.format}"  
                  todir="${build.reports.dir}"  
393        />        />
394      </junitreport>      </junitreport>
395    
396      <fail message="Test Cases Failed" if="junit.failed"/>      <fail message="Test Cases Failed" if="junit.failed"/>
397    
398      </target>
399    
400    
401      <target name="configure-compiler">
402    
403        <property name="unchecked.option" value="-Xlint:unchecked"/>
404    
405        <condition property="warnunchecked.arg" value="${unchecked.option}">
406          <istrue value="${build.warnunchecked}"/>
407        </condition>
408    
409        <property name="warnunchecked.arg" value=""/>
410    
411    
412        <!-- Common options in javac invocations -->
413        <property name="build.args" value="${warnunchecked.arg}"/>
414    
415    </target>    </target>
416    
417    
418    <target name="check-junit">    <target name="configure-tests"
419      <!-- FIXME: this test isn't specific enough -->         depends="configure-compiler">
420    
421        <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
422      <available property="junit.available"      <available property="junit.available"
423                 classname="junit.framework.TestCase"/>                 classname="junit.framework.Protectable"/>
424      <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>  
425        <!-- Xalan -->
426        <available property="xalan.available"
427                   classname="org.apache.xalan.Version"/>
428    
429    
430        <!-- Ant 1.6beta and later don't need or want this check -->
431        <!--
432        <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
433              unless="junit.available"/>
434    
435        <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
436              unless="xalan.available"/>
437        -->
438    
439    </target>    </target>
440    
441    
442      <!-- Various demos and test programs -->
443    
444    
445      <target name="loops" depends="init, configure-compiler"
446              description="Benchmark from Doug Lea's AQS paper">
447    
448        <mkdir dir="${build.loops.dir}"/>
449    
450        <javac srcdir="${loops.src.dir}"
451              destdir="${build.loops.dir}"
452                debug="${build.debug}"
453           debuglevel="${build.debuglevel}"
454          deprecation="${build.deprecation}"
455               source="${build.sourcelevel}"
456                 fork="true">
457    
458          <compilerarg line="${build.args}"/>
459          <classpath refid="loops.classpath"/>
460          <compilerarg value="-XDignore.symbol.file=true"/>
461    
462        </javac>
463    
464        <java classname="ALoops" fork="true">
465          <classpath refid="loops.classpath"/>
466        </java>
467    
468      </target>
469    
470    
471      <!-- jsr166x -->
472    
473    
474      <target name="jsr166xcompile"
475              depends="init, configure-compiler"
476              description="Compiles jsr166x sources">
477    
478        <mkdir dir="${build.jsr166x.dir}"/>
479    
480        <javac srcdir="${jsr166xsrc.dir}"
481              destdir="${build.jsr166x.dir}"
482                debug="${build.debug}"
483           debuglevel="${build.debuglevel}"
484          deprecation="${build.deprecation}"
485               source="${build.sourcelevel}"
486                 fork="true">
487    
488          <include name="**/*.java"/>
489          <compilerarg line="${build.args}"/>
490          <compilerarg value="-XDignore.symbol.file=true"/>
491    
492        </javac>
493    
494      </target>
495    
496    
497    
498      <target name="jsr166xjar"
499              depends="jsr166xcompile"
500              description="Builds library jar from compiled sources">
501    
502        <mkdir dir="${build.jsr166xlib.dir}"/>
503    
504        <jar destfile="${jsr166xproduct.jar}">
505          <fileset dir="${build.jsr166x.dir}"/>
506        </jar>
507    
508      </target>
509    
510    
511    
512      <target name="jsr166xdocs"
513              description="Builds javadocs with custom tags to build folder">
514    
515        <delete dir="${build.jsr166xjavadocs.dir}"/>
516        <mkdir dir="${build.jsr166xjavadocs.dir}"/>
517    
518        <javadoc destdir="${build.jsr166xjavadocs.dir}"
519                 link="http://download.oracle.com/javase/6/docs/api/"
520                sourcepath="${topsrc.dir}:${jdksrc.dir}"
521        >
522          <packageset dir="${topsrc.dir}" defaultexcludes="yes">
523          <include name="jsr166x"/>
524          </packageset>
525    
526    
527        </javadoc>
528    
529      </target>
530    
531    
532      <target name="jsr166xdist"
533              depends="jsr166xdist-clean, jsr166xdist-jar, jsr166xdist-docs"
534              description="Puts all distributable products in single hierarchy"/>
535    
536    
537    
538      <target name="jsr166xclean"
539              description="Removes all build products">
540    
541        <delete dir="${build.jsr166x.dir}"/>
542        <delete dir="${build.jsr166xlib.dir}"/>
543    
544      </target>
545    
546    
547    
548      <target name="jsr166xdist-clean"
549              description="Removes all build and distribution products">
550    
551      </target>
552    
553    
554    
555      <target name="jsr166xdist-docs"
556              description="Builds javadocs without custom tags to dist folder">
557    
558        <delete dir="${dist.jsr166xjavadocs.dir}"/>
559        <mkdir dir="${dist.jsr166xjavadocs.dir}"/>
560    
561        <javadoc destdir="${dist.jsr166xjavadocs.dir}"
562                    link="http://download.oracle.com/javase/6/docs/api/"
563                  source="${build.sourcelevel}">
564    
565          <packageset dir="${topsrc.dir}" defaultexcludes="yes">
566          <include name="jsr166x"/>
567          </packageset>
568    
569        </javadoc>
570    
571      </target>
572    
573      <target name="jsr166xdist-jar"
574              depends="jsr166xclean, jsr166xjar">
575    
576        <copy file="${jsr166xproduct.jar}" todir="${dist.dir}"/>
577    
578      </target>
579    
580      <!-- jsr166y -->
581    
582    
583      <target name="jsr166ycompile"
584              depends="init, configure-compiler"
585              description="Compiles jsr166y sources">
586    
587        <mkdir dir="${build.jsr166y.dir}"/>
588    
589        <javac srcdir="${jsr166ysrc.dir}"
590              destdir="${build.jsr166y.dir}"
591                debug="${build.debug}"
592           debuglevel="${build.debuglevel}"
593          deprecation="${build.deprecation}"
594               source="${build.sourcelevel}"
595                 fork="true">
596    
597          <include name="**/*.java"/>
598          <compilerarg line="${build.args}"/>
599          <compilerarg value="-XDignore.symbol.file=true"/>
600          <compilerarg value="${bootclasspath.args}"/>
601    
602    <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
603    
604        </javac>
605    
606      </target>
607    
608    
609    
610      <target name="jsr166yjar"
611              depends="jsr166ycompile"
612              description="Builds library jar from compiled sources">
613    
614        <mkdir dir="${build.jsr166ylib.dir}"/>
615    
616        <jar destfile="${jsr166yproduct.jar}" index="true">
617          <fileset dir="${build.jsr166y.dir}"/>
618        </jar>
619    
620      </target>
621    
622    
623    
624      <target name="jsr166ydocs"
625              description="Builds javadocs with custom tags to build folder">
626    
627        <delete dir="${build.jsr166yjavadocs.dir}"/>
628        <mkdir dir="${build.jsr166yjavadocs.dir}"/>
629    
630        <javadoc destdir="${build.jsr166yjavadocs.dir}"
631                    link="http://download.oracle.com/javase/6/docs/api/"
632                sourcepath="${topsrc.dir}:${jdksrc.dir}"
633        >
634          <packageset dir="${topsrc.dir}" defaultexcludes="no">
635          <include name="jsr166y"/>
636          </packageset>
637    
638    
639        </javadoc>
640    
641      </target>
642    
643    
644      <target name="jsr166ydist"
645              depends="jsr166ydist-clean, jsr166ydist-jar, jsr166ydist-docs"
646              description="Puts all distributable products in single hierarchy"/>
647    
648    
649    
650      <target name="jsr166yclean"
651              description="Removes all build products">
652    
653        <delete dir="${build.jsr166y.dir}"/>
654        <delete dir="${build.jsr166ylib.dir}"/>
655    
656      </target>
657    
658    
659    
660      <target name="jsr166ydist-clean"
661              description="Removes all build and distribution products">
662    
663      </target>
664    
665      <target name="jsr166ydist-docs"
666              description="Builds javadocs without custom tags to dist folder">
667    
668        <delete dir="${dist.jsr166yjavadocs.dir}"/>
669        <mkdir dir="${dist.jsr166yjavadocs.dir}"/>
670    
671        <javadoc destdir="${dist.jsr166yjavadocs.dir}"
672                    link="http://download.oracle.com/javase/6/docs/api/"
673                  source="${build.sourcelevel}"
674                sourcepath="${topsrc.dir}:${jdksrc.dir}"
675                >
676          <fileset dir="${topsrc.dir}" defaultexcludes="yes">
677          <include name="jsr166y/*.java"/>
678                </fileset>
679        </javadoc>
680    
681      </target>
682    
683      <target name="jsr166ydist-jar"
684              depends="jsr166yclean, jsr166yjar">
685    
686        <copy file="${jsr166yproduct.jar}" todir="${dist.dir}"/>
687    
688      </target>
689    
690      <!-- extra166y -->
691    
692    
693      <target name="extra166ycompile"
694              depends="init, configure-compiler, jsr166ycompile"
695              description="Compiles extra166y sources">
696    
697        <mkdir dir="${build.extra166y.dir}"/>
698    
699        <javac srcdir="${extra166ysrc.dir}"
700              destdir="${build.extra166y.dir}"
701                debug="${build.debug}"
702                classpath="${jsr166yproduct.jar}"
703           debuglevel="${build.debuglevel}"
704          deprecation="${build.deprecation}"
705               source="${build.sourcelevel}"
706                 fork="true">
707    
708          <include name="**/*.java"/>
709          <compilerarg line="${build.args}"/>
710          <compilerarg value="-XDignore.symbol.file=true"/>
711          <compilerarg value="${bootclasspath.args}"/>
712    
713    <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
714    
715        </javac>
716    
717      </target>
718    
719    
720    
721      <target name="extra166yjar"
722              depends="extra166ycompile"
723              description="Builds library jar from compiled sources">
724    
725        <mkdir dir="${build.extra166ylib.dir}"/>
726    
727        <jar destfile="${extra166yproduct.jar}" index="true">
728          <fileset dir="${build.extra166y.dir}"/>
729        </jar>
730    
731      </target>
732    
733    
734    
735      <target name="extra166ydocs"
736              description="Builds javadocs with custom tags to build folder">
737    
738        <delete dir="${build.extra166yjavadocs.dir}"/>
739        <mkdir dir="${build.extra166yjavadocs.dir}"/>
740    
741        <javadoc destdir="${build.extra166yjavadocs.dir}"
742                    link="http://download.oracle.com/javase/6/docs/api/"
743                sourcepath="${topsrc.dir}:${jdksrc.dir}"
744        >
745          <packageset dir="${topsrc.dir}" defaultexcludes="no">
746          <include name="extra166y"/>
747          </packageset>
748    
749    
750        </javadoc>
751    
752      </target>
753    
754    
755      <target name="extra166ydist"
756              depends="extra166ydist-clean, extra166ydist-jar, extra166ydist-docs"
757              description="Puts all distributable products in single hierarchy"/>
758    
759    
760    
761      <target name="extra166yclean"
762              description="Removes all build products">
763    
764        <delete dir="${build.extra166y.dir}"/>
765        <delete dir="${build.extra166ylib.dir}"/>
766    
767      </target>
768    
769    
770    
771      <target name="extra166ydist-clean"
772              description="Removes all build and distribution products">
773    
774      </target>
775    
776      <target name="extra166ydist-docs"
777              description="Builds javadocs without custom tags to dist folder">
778    
779        <delete dir="${dist.extra166yjavadocs.dir}"/>
780        <mkdir dir="${dist.extra166yjavadocs.dir}"/>
781    
782        <javadoc destdir="${dist.extra166yjavadocs.dir}"
783                    link="http://download.oracle.com/javase/6/docs/api/"
784                  source="${build.sourcelevel}"
785                sourcepath="${topsrc.dir}:${jdksrc.dir}"
786                >
787          <fileset dir="${topsrc.dir}" defaultexcludes="yes">
788          <include name="extra166y/*.java"/>
789                </fileset>
790        </javadoc>
791    
792      </target>
793    
794      <target name="extra166ydist-jar"
795              depends="extra166yclean, extra166yjar">
796    
797        <copy file="${extra166yproduct.jar}" todir="${dist.dir}"/>
798    
799      </target>
800    
801  </project>  </project>

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.84

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8