/[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.60 by tim, Mon Dec 8 03:10:54 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"/>
   <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"/>
# Line 44  ant [target], where target is one of: Line 29  ant [target], where target is one of:
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"/>
   <property name="build.emulation.dir"  location="${build.dir}/emulation"/>  
32    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
33    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.lib.dir"        location="${build.dir}/lib"/>
34    <property name="build.ant.dir"        location="${build.dir}/ant"/>    <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.checkstyle.dir" location="${build.dir}/checkstyle"/>
38    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
39    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
40      <property name="build.dc-filter.dir"  location="${build.dir}/filterdocchk"/>
41    
42    <!-- Source locations -->    <!-- Source locations -->
43    <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"/>  
44    <property name="test.src.dir"         location="${basedir}/src/test"/>    <property name="test.src.dir"         location="${basedir}/src/test"/>
45      <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
46    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
47    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
48    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
# Line 68  ant [target], where target is one of: Line 53  ant [target], where target is one of:
53    
54    <!-- Jar locations -->    <!-- Jar locations -->
55    <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"/>  
56    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
57    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    
58      <!-- Bootclasspath argument -->
59      <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>
   <!--  
    ! Bootclasspath munging for source compilation.  
    -->  
   
   <path id="javac.bootclasspath.prepend">  
     <!-- <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.*.  
    -->  
60    
61      <!-- Test classpath -->
62    <path id="test.classpath">    <path id="test.classpath">
     <pathelement location="${product.jar}"/>  
63      <pathelement location="${build.testcases.dir}"/>      <pathelement location="${build.testcases.dir}"/>
64      <pathelement location="${junit.jar}"/>      <pathelement location="${junit.jar}"/>
65    </path>    </path>
66    
   <!-- 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}'/>  
   
67    
68    
69    <!-- Main targets -->    <!-- Main targets -->
70    
71    <target name="compile" depends="init"  
72      <target name="compile"
73              depends="init, configure-compiler"
74            description="Compiles main sources to build folder">            description="Compiles main sources to build folder">
75    
76      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
# Line 130  ant [target], where target is one of: Line 83  ant [target], where target is one of:
83             source="${build.sourcelevel}"             source="${build.sourcelevel}"
84               fork="true">               fork="true">
85    
86        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg line="${build.args}"/>
       <compilerarg line="${javac.args} ${build.warnings.option}"/>  
87    
88      </javac>      </javac>
89    
90    </target>    </target>
91    
92    
   <target name="jar" depends="native-jar, emulation-jar"/>  
   
   
   <target name="test" depends="init, check-junit, report-tests"  
           description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)"  
   />  
   
93    
94    <target name="checkstyle" depends="filter-src"    <target name="jar"
95            description="Reports on style errors in Java source (verbose, mostly chaff)">            depends="compile"
96              description="Builds library jar from compiled sources">
97    
98      <taskdef resource="checkstyletask.properties"      <mkdir dir="${build.lib.dir}"/>
             classpath="${lib.dir}/checkstyle-all-2.4.jar"/>  
99    
100      <checkstyle>      <jar destfile="${product.jar}">
101        <formatter type="plain"/>  <!-- also available: type="xml" -->        <fileset dir="${build.classes.dir}"/>
102        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>      </jar>
     </checkstyle>  
103    
104    </target>    </target>
105    
106    
   <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}"/>  
107    
108      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"    <target name="test"
109           docletpath="${lib.dir}/doccheck.jar"            depends="init, configure-tests, report-tests"
110              destdir="${build.doccheck.dir}">            description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
       <packageset dir="${build.filter.src.dir}"/>  
     </javadoc>  
111    
   </target>  
112    
113    
114    <target name="docs" depends="filter-src"    <target name="docs"
115            description="Builds javadocs with custom tags to build folder">            description="Builds javadocs with custom tags to build folder">
116    
117      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
# Line 184  ant [target], where target is one of: Line 120  ant [target], where target is one of:
120      <javadoc destdir="${build.javadocs.dir}"      <javadoc destdir="${build.javadocs.dir}"
121                  link="http://java.sun.com/j2se/1.4.1/docs/api"                  link="http://java.sun.com/j2se/1.4.1/docs/api"
122              overview="${src.dir}/intro.html"              overview="${src.dir}/intro.html"
123                source="${build.docsourcelevel}">                source="${build.sourcelevel}">
124    
125        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
126        <tag name="spec" description="Specified by:"/>        <tag name="spec"    description="Specified by:"/>
127        <tag name="editor" description="Last edited by:"/>  
128        <tag name="fixme" description="FIX ME:"/>        <packageset dir="${src.dir}"/>
       <packageset dir="${build.filter.src.dir}"/>  
129    
130      </javadoc>      </javadoc>
131    
132    </target>    </target>
133    
134    
   <!--  
    # 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">  
135    
136      <mkdir dir="${build.stripped.dir}"/>    <target name="doccheck"
137              depends="filter-doccheck"
138              description="Reports on javadoc style errors">
139    
140      <javac srcdir="${src.dir}"      <delete dir="${build.doccheck.dir}"/>
141            destdir="${build.stripped.dir}"      <mkdir dir="${build.doccheck.dir}"/>
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
142    
143        <bootclasspath refid="javac.bootclasspath"/>      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
144        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>           docletpath="${lib.dir}/doccheck.jar"
145                destdir="${build.doccheck.dir}">
146          <packageset dir="${build.dc-filter.dir}"/>
147        </javadoc>
148    
149      </javac>      <echo>DocCheck output is in ${build.doccheck.dir}</echo>
150    
151    </target>    </target>
152    
153    
   <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"  
           description="Puts all distributable products in single hierarchy"/>  
154    
155      <target name="checkstyle"
156              depends="filter-src"
157              description="Reports on style errors in Java source (verbose, mostly chaff)">
158    
159    <target name="clean"      <taskdef resource="checkstyletask.properties"
160            description="Removes all build products">              classpath="${lib.dir}/checkstyle-all-3.1.jar"/>
161    
162      <delete dir="${build.dir}"/>      <mkdir dir="${build.checkstyle.dir}"/>
163      <delete dir="${build.classes.dir}"/>      
164      <delete dir="${build.lib.dir}"/>      <checkstyle config="etc/checkstyle/sun_checks.xml"
165           failOnViolation="false">
166          <formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/>
167          <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
168        </checkstyle>
169        
170        <style in="${build.checkstyle.dir}/checkstyle-report.xml"
171              out="${build.checkstyle.dir}/checkstyle-report.html"
172            style="${stylesheet.dir}/checkstyle-frames.xsl"/>
173    
174    </target>    </target>
175    
176      
177    
178    <target name="dist-clean"    <target name="dist"
179            description="Removes all build and distribution products">            depends="init, dist-clean, dist-jar, dist-docs"
180              description="Puts all distributable products in single hierarchy"/>
     <delete dir="${dist.dir}"/>  
   
   </target>  
181    
182    
   <!-- Anthill targets -->  
183    
184    <!-- Should really run the tests instead of just the jar target -->    <target name="release"
185    <target name="anthill-build" depends="jar, test, docs, dist-docs"/>            depends="dist"
186              description="Puts entire CVS tree, plus distribution productions, in a jar">
187    
188        <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
189    
190        <jar basedir="${basedir}" destfile="${release.jar}">
191          <!-- <exclude name="build/**"/> -->
192          <exclude name="${release.jar}"/>
193          <exclude name="user.properties"/>
194          <exclude name="etc/notes/**"/>
195          <exclude name="src/emulation/**"/>
196          <exclude name="**/SyntaxTest.java"/>
197          <exclude name="**/SuperfluousAbstract.java"/>
198        </jar>
199    
   <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>  
200    </target>    </target>
201    
202    
   <!-- Internal targets -->  
203    
204    <target name="set-warnings-if" if="build.warnings">    <target name="clean"
205              description="Removes all build products">
206    
207      <property name="build.warnings.option" value="-warnunchecked"/>      <delete dir="${build.dir}"/>
208        <delete dir="${build.classes.dir}"/>
209        <delete dir="${build.lib.dir}"/>
210    
211    </target>    </target>
212    
213    
   <target name="set-warnings-unless" unless="build.warnings">  
214    
215      <property name="build.warnings.option" value=""/>    <target name="dist-clean"
216              description="Removes all build and distribution products">
   </target>  
   
   
   <target name="init" depends="set-warnings-if, set-warnings-unless">  
217    
218      <!-- Version is kept in a separate file -->      <delete dir="${dist.dir}"/>
     <loadfile property="version" srcFile="version.properties"/>  
     <echo>Building JSR-166 version ${version}</echo>  
219    
220    </target>    </target>
221    
222    
   <target name="native-jar" depends="compile"  
           description="Builds library jar from compiled sources">  
   
     <mkdir dir="${build.lib.dir}"/>  
   
     <jar destfile="${product.jar}">  
       <fileset dir="${build.classes.dir}"/>  
     </jar>  
   
   </target>  
   
223    
224    <target name="compile-emulation" depends="init"    <target name="dist-docs"
225            if="build.emulation"            description="Builds javadocs without custom tags to dist folder">
           description="Compiles emulation sources to build folder">  
226    
227      <mkdir dir="${build.emulation.dir}"/>      <delete dir="${dist.javadocs.dir}"/>
228        <mkdir dir="${dist.javadocs.dir}"/>
229    
230      <javac srcdir="${emulation.src.dir}"      <javadoc destdir="${dist.javadocs.dir}"
231            destdir="${build.emulation.dir}"                  link="http://java.sun.com/j2se/1.4.2/docs/api"
232              debug="${build.debug}"              overview="${src.dir}/intro.html"
233         debuglevel="${build.debuglevel}"                source="${build.sourcelevel}">
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
234    
235        <bootclasspath refid="javac.bootclasspath"/>        <packageset dir="${src.dir}"/>
       <compilerarg line="${javac.args} ${build.warnings.option}"/>  
236    
237      </javac>      </javadoc>
238    
239    </target>    </target>
240    
241    
   <target name="emulation-jar" depends="native-jar, compile-emulation"  
           if="build.emulation">  
242    
243      <jar destfile="${product.jar}" update="true" duplicate="add">    <!-- Internal targets -->
       <fileset dir="${build.emulation.dir}"/>  
     </jar>  
   
   </target>  
244    
245    
246    <target name="dist-jar" depends="clean, jar">    <target name="init">
247    
248      <copy file="${product.jar}" todir="${dist.dir}"/>      <!-- Version is kept in a separate file -->
249        <loadfile property="version" srcFile="version.properties"/>
250        <echo>Building JSR-166 version ${version}</echo>
251        <echo>java.home is ${java.home}</echo>
252    
253    </target>    </target>
254    
255    
256    <target name="dist-docs" depends="filter-src"    <target name="dist-jar"
257            description="Builds javadocs without custom tags to dist folder">            depends="clean, 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}">  
258    
259        <packageset dir="${build.filter.src.dir}"/>      <copy file="${product.jar}" todir="${dist.dir}"/>
   
     </javadoc>  
260    
261    </target>    </target>
262    
263    
264    <target name="compile-ant-filter" depends="init">    <target name="compile-ant-filter"
265              depends="init">
266    
267      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
268    
# Line 370  ant [target], where target is one of: Line 274  ant [target], where target is one of:
274    </target>    </target>
275    
276    
277    <target name="filter-src" depends="compile-ant-filter">    <target name="filter-src"
278              depends="compile-ant-filter">
279    
280      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
281    
282      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
283        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
284          <include name="**/*.java"/>          <include name="**/*.html"/>
285          <exclude name="**/Random.java"/>        </fileset>
286          <exclude name="**/Unsafe.java"/>      </copy>
287    
288        <copy todir="${build.filter.src.dir}">
289          <fileset dir="${src.dir}">
290            <exclude name="**/*.html"/>
291            <!-- Files excluded from dist-docs -->
292            <exclude name="java/util/Random.*"/>
293            <exclude name="sun/misc/Unsafe.*"/>
294        </fileset>        </fileset>
295          <!--
296        <filterchain>        <filterchain>
297          -->
298    
299            <!--
300             # This filter gets rid of angle-bracketed type parameters
301             # so that javadoc can run on the result. The following
302             # heuristic seems to work:
303             #
304             # For all lines not starting with space(s)-asterisk-space(s),
305             #   replace <something> with a space, where there may be more
306             #   than one right angle bracket at the end, and "something"
307             #   must not contain parens or pipes. (This may need some
308             #   tweaking.)
309             -->
310    
311            <!--
312          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
313                        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.)  
            -->  
314            <param name="notmatching" value="^\s+\*\s.*$"/>            <param name="notmatching" value="^\s+\*\s.*$"/>
315            <param name="pattern" value="&lt;[^|>()]+?>+"/>            <param name="pattern"     value="&lt;[^|>()]+?>+"/>
316            <param name="replacement" value=" "/>            <param name="replacement" value=" "/>
317          </filterreader>          </filterreader>
318            -->
319    
320          <!--
321          </filterchain>
322          -->
323        </copy>
324    
325      </target>
326    
327    
328      <target name="filter-doccheck"
329              depends="filter-src">
330    
331        <mkdir dir="${build.dc-filter.dir}"/>
332    
333        <copy todir="${build.dc-filter.dir}">
334          <fileset dir="${build.filter.src.dir}">
335            <include name="**/*.html"/>
336          </fileset>
337        </copy>
338    
339        <property name="generic.declarations"
340                 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 {}"
341        />
342    
343        <copy todir="${build.dc-filter.dir}">
344          <fileset dir="${build.filter.src.dir}">
345            <exclude name="**/*.html"/>
346          </fileset>
347          <filterchain>
348            <!--
349             # These two filters try to make the source look like
350             # something that doccheck can process. The first removes
351             # -source 1.4 assertions and the second adds in a bunch
352             # of single letter public nested marker interfaces so that
353             # the generic type parameters are recognized.
354             -->
355    
356            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
357                          classpath="${build.ant.dir}">
358              <param name="matching"    value="^\s*assert[\s ].*$"/>
359              <param name="pattern"     value="assert"/>
360              <param name="replacement" value="//assert"/>
361            </filterreader>
362    
363          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
364                        classpath="${build.ant.dir}">                        classpath="${build.ant.dir}">
365            <!--            <param name="matching"    value="^([^*]*(class|interface|implements) .*|)\{.*$"/>
366             # These arguments are to uncomment lines beginning with            <param name="pattern"     value="$"/>
367             # "//@" so that javadoc can see imports that are needed            <param name="replacement" value=" ${generic.declarations}"/>
            # to resolve links but that shouldn't be in the compiled  
            # code.  
            -->  
           <param name="matching" value="^//@.*$"/>  
           <param name="pattern" value="^//@"/>  
           <param name="replacement" value=""/>  
368          </filterreader>          </filterreader>
369    
370        </filterchain>        </filterchain>
371      </copy>      </copy>
372    
373    </target>    </target>
374    
375    
376    <target name="compile-tests" depends="jar">    <target name="compile-tests"
377              depends="jar">
378    
379      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
380    
381        <javac srcdir="${tck.src.dir}"
382              destdir="${build.testcases.dir}"
383                debug="${build.debug}"
384           debuglevel="${build.debuglevel}"
385          deprecation="${build.deprecation}"
386               source="${build.sourcelevel}"
387                 fork="true">
388    
389          <compilerarg value="${bootclasspath.args}"/>
390          <compilerarg line="${build.args}"/>
391          
392          <classpath refid="test.classpath"/>
393    
394        </javac>
395    
396      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
397            destdir="${build.testcases.dir}"            destdir="${build.testcases.dir}"
398              debug="${build.debug}"              debug="${build.debug}"
# Line 428  ant [target], where target is one of: Line 401  ant [target], where target is one of:
401             source="${build.sourcelevel}"             source="${build.sourcelevel}"
402               fork="true">               fork="true">
403    
404        <bootclasspath refid="javac.bootclasspath"/>        <include name="jsr166/test/**"/>
405        <compilerarg line="${javac.args} ${build.warnings.option}"/>        
406          <compilerarg value="${bootclasspath.args}"/>
407          <compilerarg line="${build.args}"/>
408          
409        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
410    
411      </javac>      </javac>
# Line 437  ant [target], where target is one of: Line 413  ant [target], where target is one of:
413    </target>    </target>
414    
415    
416    <target name="run-tests" depends="compile-tests">    <target name="run-tests"
417              depends="compile-tests">
418    
419      <!-- May be overridden by user.properties -->      <!-- May be overridden by user.properties -->
420      <property name="testcase" value="*"/>      <property name="testcase" value="*"/>
# Line 451  ant [target], where target is one of: Line 428  ant [target], where target is one of:
428                      dir="${build.reports.dir}"                      dir="${build.reports.dir}"
429                     fork="true">                     fork="true">
430    
431        <jvmarg value="${test.javac.args}"/>        <jvmarg value="${bootclasspath.args}"/>
432          
433          <classpath refid="test.classpath"/>
434    
435        <formatter type="xml"/>        <formatter type="xml"/>
436    
437        <batchtest todir="${build.reports.dir}">        <batchtest todir="${build.reports.dir}">
438          <fileset dir="${test.src.dir}">          <fileset dir="${tck.src.dir}">
439            <include name="**/${testcase}Test.java"/>            <include name="**/${testcase}Test.java"/>
440          </fileset>          </fileset>
441            <fileset dir="${test.src.dir}">
442              <include name="jsr166/test/**/${testcase}Test.java"/>
443            </fileset>
444        </batchtest>        </batchtest>
445    
446      </junit>      </junit>
# Line 466  ant [target], where target is one of: Line 448  ant [target], where target is one of:
448    </target>    </target>
449    
450    
451    <target name="report-tests" depends="run-tests">    <target name="report-tests"
452      <!-- Sets junit.report.format to frames if Xalan is present,            depends="run-tests">
453    
454        <!-- Sets junit.report.format to frames if redirection is present,
455           otherwise sets it to noframes. -->           otherwise sets it to noframes. -->
456      <available property="junit.report.format"      <available property="junit.report.format"
457                    value="frames"                    value="frames"
# Line 486  ant [target], where target is one of: Line 470  ant [target], where target is one of:
470      </junitreport>      </junitreport>
471    
472      <fail message="Test Cases Failed" if="junit.failed"/>      <fail message="Test Cases Failed" if="junit.failed"/>
473    
474      </target>
475    
476    
477      <target name="configure-compiler">
478    
479        <property name="unchecked.option" value="-Xlint:unchecked"/>
480    
481        <condition property="warnunchecked.arg" value="${unchecked.option}">
482          <istrue value="${build.warnunchecked}"/>
483        </condition>
484    
485        <property name="warnunchecked.arg" value=""/>
486    
487    
488        <!-- Common options in javac invocations -->
489        <property name="build.args" value="${warnunchecked.arg}"/>
490    
491    </target>    </target>
492    
493    
494    <target name="check-junit">    <target name="configure-tests"
495      <!-- FIXME: this test isn't specific enough -->         depends="configure-compiler">
496    
497        <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
498      <available property="junit.available"      <available property="junit.available"
499                 classname="junit.framework.TestCase"/>                 classname="junit.framework.Protectable"/>
500      <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>  
501        <!-- Xalan -->
502        <available property="xalan.available"
503                   classname="org.apache.xalan.Version"/>
504    
505                  
506        <!-- Ant 1.6beta and later don't need or want this check -->
507        <!--    
508        <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
509              unless="junit.available"/>
510    
511        <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
512              unless="xalan.available"/>
513        -->
514    
515      </target>
516    
517    
518    
519      <!-- Anthill targets -->
520    
521      <target name="anthill-build">
522      
523        <!-- Override this in user.properties -->
524        <property name="tiger.home" location="e:/j2sdk1.5.0"/>
525        
526        <exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java">
527          <arg value="-Xmx256000000"/>
528          <!-- classpath of new JVM -->
529          <arg value="-classpath"/> <arg path="${java.class.path}"/>
530          <!-- location of Ant home directory -->
531          <arg value="-Dant.home=${ant.home}"/>
532          <!-- the Ant main class -->
533          <arg value="org.apache.tools.ant.Main"/>
534          <!-- The build file -->
535          <arg value="-buildfile"/>  <arg value="build.xml"/>
536          <!-- the target to build on the new Ant instance -->
537          <arg value="-DJAVA_HOME=${tiger.home}"/>
538          <arg value="do-anthill-build"/>
539        </exec>
540      </target>
541      
542      <target name="do-anthill-build"
543              depends="jar, test, docs, dist-docs"/>
544    
545      <target name="anthill-publish">
546    
547        <copy todir="${deployDir}/docs/private">
548          <fileset dir="${build.javadocs.dir}"/>
549        </copy>
550    
551        <copy todir="${deployDir}/docs/public">
552          <fileset dir="${dist.javadocs.dir}"/>
553        </copy>
554    
555        <copy tofile="${deployDir}/index.html"
556              file="${basedir}/etc/anthill-index.html"/>
557    
558        <copy todir="${deployDir}/notes">
559          <fileset dir="${basedir}/etc/notes"/>
560        </copy>
561    
562      </target>
563    
564    
565    
566      <!-- Backward compatibility, work in progress (some files not checked in) -->
567    
568    
569      <target name="compat" depends="jar">
570      
571        <mkdir dir="${build.testcases.dir}"/>
572        
573        <javac srcdir="${test.src.dir}"
574              destdir="${build.testcases.dir}"
575                debug="${build.debug}"
576           debuglevel="${build.debuglevel}"
577          deprecation="${build.deprecation}"
578               source="${build.sourcelevel}"
579                 fork="true">
580                
581          <compilerarg value="${bootclasspath.args}"/>
582          <compilerarg line="${build.args}"/>
583          
584          <classpath refid="test.classpath"/>
585          
586          <include name="Compatibility.java"/>
587          
588        </javac>
589        
590                
591        <java classname="Compatibility" fork="true">
592          <jvmarg value="${bootclasspath.args}"/>
593          <classpath refid="test.classpath"/>
594        </java>
595      </target>
596    
597    
598    
599      <property name="pretiger.src.dir"     location="${build.dir}/pretiger/src"/>
600      <property name="build.pretiger.dir"   location="${build.dir}/pretiger/classes"/>
601      <property name="pretiger.jar"         location="${build.lib.dir}/jsr166-pretiger.jar"/>
602      <property name="pretiger.sourcelevel" value="1.4"/>
603      
604      <target name="defang"
605           depends="init"
606       description="Generates pre-Tiger compatible source">
607      
608        <delete dir="${pretiger.src.dir}"/>
609        <mkdir dir="${pretiger.src.dir}"/>
610      
611        <exec executable="perl">
612          <arg file="etc/defang.pl"/>
613          <!-- <arg value="-v"/> -->
614          <arg value="-s"/> <arg file="${src.dir}"/>
615          <arg value="-t"/> <arg file="${pretiger.src.dir}"/>
616        </exec>
617        
618      </target>
619    
620      <target name="compile-pretiger"
621              depends="init, configure-compiler, defang"
622              description="Compiles pre-Tiger sources to build folder">
623    
624        <mkdir dir="${build.pretiger.dir}"/>
625    
626        <javac srcdir="${pretiger.src.dir}"
627              destdir="${build.pretiger.dir}"
628                debug="${build.debug}"
629           debuglevel="${build.debuglevel}"
630          deprecation="${build.deprecation}"
631               source="${pretiger.sourcelevel}"
632                 fork="true">
633    
634          <compilerarg line="${build.args}"/>
635          <exclude name="**/Thread.java"/>
636    
637        </javac>
638    
639    </target>    </target>
640      
641      <target name="pretiger" depends="compile-pretiger">
642    
643        <mkdir dir="${build.lib.dir}"/>
644        
645        <jar destfile="${pretiger.jar}">
646          <fileset dir="${build.pretiger.dir}">
647          </fileset>
648        </jar>
649        
650      </target>
651    
652  </project>  </project>

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

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