/[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.49 by tim, Sat Aug 2 02:38:24 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 53  ant [target], where target is one of: Line 39  ant [target], where target is one of:
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.filter.doccheck.dir" location="${build.dir}/filterdocchk"/>
43    
44    <!-- Source locations -->    <!-- Source locations -->
45    <property name="src.dir"              location="${basedir}/src/main"/>    <property name="src.dir"              location="${basedir}/src/main"/>
# 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 and emulation jar -->
64     ! Bootclasspath munging for source compilation.    <patternset id="unsafe.exclusion">
65     -->      <exclude name="java/util/Random.*"/>
66        <exclude name="sun/misc/Unsafe.*"/>
67    <path id="javac.bootclasspath.prepend">    </patternset>
68      <!-- <pathelement location="${src.dir}"/> -->  
69      <pathelement location="${javac.jar}"/>    <!-- Files excludes from emulation jar -->
70    </path>    <patternset id="atomic.exclusion">
71        <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/>
72    <path id="javac.bootclasspath">      <exclude name="java/util/concurrent/atomic/AtomicInteger*"/>
73      <!-- <pathelement location="${src.dir}"/> -->      <exclude name="java/util/concurrent/atomic/AtomicLong*"/>
74      <pathelement location="${collect.jar}"/>      <exclude name="java/util/concurrent/atomic/AtomicReference*"/>
75      <pathelement location="${rt.jar}"/>    </patternset>
   </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}'/>  
76    
77    
78    
79    <!-- Main targets -->    <!-- Main targets -->
80    
81    <target name="compile" depends="init"    <target name="compile"
82              depends="init, configure-compiler, prepare-src"
83            description="Compiles main sources to build folder">            description="Compiles main sources to build folder">
84    
85        <property name="prepare.src.dir" value="${src.dir}"/>
86    
87      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
88    
89      <javac srcdir="${src.dir}"  <!--
90        <echo>javac ${gjc.args}</echo>
91        <echo>bootclasspath=${compile.bootclasspath}</echo>
92    -->
93    
94        <javac srcdir="${prepare.src.dir}"
95            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
96              debug="${build.debug}"              debug="${build.debug}"
97         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
# Line 130  ant [target], where target is one of: Line 99  ant [target], where target is one of:
99             source="${build.sourcelevel}"             source="${build.sourcelevel}"
100               fork="true">               fork="true">
101    
102        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args}"/>
103        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <bootclasspath refid="compile.bootclasspath"/>
104    
105      </javac>      </javac>
106    
107    </target>    </target>
108    
109    
110    <target name="jar" depends="native-jar, emulation-jar"/>    <target name="jar"
111              depends="configure-emulation, init-jar, native-jar, emulation-jar"
112              description="Builds library jar from compiled sources"/>
113    
114    
115    <target name="test" depends="init, check-junit, report-tests"    <target name="test"
116            description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)"            depends="init, configure-tests, report-tests"
117    />            description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
118    
119    
120    <target name="checkstyle" depends="filter-src"    <target name="checkstyle"
121              depends="filter-src"
122            description="Reports on style errors in Java source (verbose, mostly chaff)">            description="Reports on style errors in Java source (verbose, mostly chaff)">
123    
124      <taskdef resource="checkstyletask.properties"      <taskdef resource="checkstyletask.properties"
# Line 160  ant [target], where target is one of: Line 132  ant [target], where target is one of:
132    </target>    </target>
133    
134    
135    <target name="doccheck" depends="filter-src"    <target name="doccheck"
136            description="Reports on javadoc style errors (not working yet)">            depends="filter-doccheck"
137              description="Reports on javadoc style errors">
138    
139      <delete dir="${build.doccheck.dir}"/>      <delete dir="${build.doccheck.dir}"/>
140      <mkdir dir="${build.doccheck.dir}"/>      <mkdir dir="${build.doccheck.dir}"/>
# Line 169  ant [target], where target is one of: Line 142  ant [target], where target is one of:
142      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
143           docletpath="${lib.dir}/doccheck.jar"           docletpath="${lib.dir}/doccheck.jar"
144              destdir="${build.doccheck.dir}">              destdir="${build.doccheck.dir}">
145        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.doccheck.dir}"/>
146      </javadoc>      </javadoc>
147    
148        <echo>DocCheck output is in ${build.doccheck.dir}</echo>
149    
150    </target>    </target>
151    
152    
153    <target name="docs" depends="filter-src"    <target name="docs"
154              depends="filter-src"
155            description="Builds javadocs with custom tags to build folder">            description="Builds javadocs with custom tags to build folder">
156    
157      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
# Line 187  ant [target], where target is one of: Line 163  ant [target], where target is one of:
163                source="${build.docsourcelevel}">                source="${build.docsourcelevel}">
164    
165        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
166        <tag name="spec" description="Specified by:"/>        <tag name="spec"    description="Specified by:"/>
167        <tag name="editor" description="Last edited by:"/>        <tag name="editor"  description="Last edited by:"/>
168        <tag name="fixme" description="FIX ME:"/>        <tag name="fixme"   description="FIX ME:"/>
169    
170        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.src.dir}"/>
171    
172      </javadoc>      </javadoc>
# Line 197  ant [target], where target is one of: Line 174  ant [target], where target is one of:
174    </target>    </target>
175    
176    
177    <!--    <target name="sinjdocs"
178     # javac -s doesn't reliably generate compilable code. It generates            depends="configure-tests"
179     # bridge methods (marked as "synthetic") that can have identical            description="Builds javadocs with custom tags to build folder">
180     # signatures to existing methods except for the return value.  
181     -->      <delete dir="${build.javadocs.dir}"/>
182    <target name="strip" depends="init">      <mkdir dir="${build.javadocs.dir}"/>
183    
184        <java classname="net.cscott.sinjdoc.Main" fork="true">
185    
186          <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
187    
188          <classpath>
189            <pathelement location="${sinjdoc.jar}"/>
190            <path refid="test.classpath"/>
191          </classpath>
192    
193          <!-- <arg value="-link"/>       <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> -->
194    
195          <arg value="-d"/>          <arg value="${build.javadocs.dir}"/>
196          <arg value="-sourcepath"/> <arg value="${src.dir}"/>
197          <arg value="-overview"/>   <arg value="${src.dir}/intro.html"/>
198          <arg value="-source"/>     <arg value="1.5"/>
199          <arg value="-verbose"/>
200          <arg value="java.util"/>
201    
202          <!--
203          <arg value="-help"/>
204          -->
205    
206        </java>
207    
208      </target>
209    
210    
211      <target name="strip"
212              depends="init, configure-compiler"
213              description="Strip generics from java source (not working yet)">
214    
215      <mkdir dir="${build.stripped.dir}"/>      <mkdir dir="${build.stripped.dir}"/>
216    
217        <!--
218         # javac -s doesn't reliably generate compilable code. It generates
219         # bridge methods (marked as "synthetic") that can have identical
220         # signatures to existing methods except for the return value.
221         -->
222      <javac srcdir="${src.dir}"      <javac srcdir="${src.dir}"
223            destdir="${build.stripped.dir}"            destdir="${build.stripped.dir}"
224              debug="${build.debug}"              debug="${build.debug}"
# Line 214  ant [target], where target is one of: Line 227  ant [target], where target is one of:
227             source="${build.sourcelevel}"             source="${build.sourcelevel}"
228               fork="true">               fork="true">
229    
230        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args} -s"/>
231        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>        <bootclasspath refid="compile.bootclasspath"/>
232    
233      </javac>      </javac>
234    
235    </target>    </target>
236    
237    
238    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"    <target name="dist"
239              depends="init, dist-clean, dist-jar, dist-docs"
240            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
241    
242      <target name="release"
243              depends="dist"
244              description="Puts entire CVS tree, plus distribution productions, in a jar">
245    
246    <!--
247        #keep build dir? - dl
248        <delete dir="${build.dir}"/>
249    -->
250        <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
251    
252        <jar basedir="${basedir}" destfile="${release.jar}">
253          <exclude name="${release.jar}"/>
254          <exclude name="user.properties"/>
255          <exclude name="etc/notes/**"/>
256          <exclude name="lib/gjc/2.1/**"/>
257          <exclude name="**/SyntaxTest.java"/>
258        </jar>
259    
260      </target>
261    
262    <target name="clean"    <target name="clean"
263            description="Removes all build products">            description="Removes all build products">
# Line 244  ant [target], where target is one of: Line 277  ant [target], where target is one of:
277    </target>    </target>
278    
279    
280    <!-- Anthill targets -->    <target name="dist-docs"
281              depends="filter-src"
282    <!-- 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>  
283    
284        <delete dir="${dist.javadocs.dir}"/>
285        <mkdir dir="${dist.javadocs.dir}"/>
286    
287    <!-- Internal targets -->      <javadoc destdir="${dist.javadocs.dir}"
288                    link="http://java.sun.com/j2se/1.4.1/docs/api"
289                overview="${src.dir}/intro.html"
290                  source="${build.docsourcelevel}">
291    
292    <target name="set-warnings-if" if="build.warnings">        <packageset dir="${build.filter.src.dir}"/>
293    
294      <property name="build.warnings.option" value="-warnunchecked"/>      </javadoc>
295    
296    </target>    </target>
297    
298    
   <target name="set-warnings-unless" unless="build.warnings">  
   
     <property name="build.warnings.option" value=""/>  
299    
300    </target>    <!-- Internal targets -->
301    
302    
303    <target name="init" depends="set-warnings-if, set-warnings-unless">    <target name="init">
304    
305      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
306      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
# Line 289  ant [target], where target is one of: Line 309  ant [target], where target is one of:
309    </target>    </target>
310    
311    
312    <target name="native-jar" depends="compile"    <target name="init-jar">
           description="Builds library jar from compiled sources">  
313    
314      <mkdir dir="${build.lib.dir}"/>      <mkdir dir="${build.lib.dir}"/>
315    
316      </target>
317    
318    
319      <target name="native-jar"
320              depends="compile"
321              unless="build.emulation.true">
322    
323      <jar destfile="${product.jar}">      <jar destfile="${product.jar}">
324        <fileset dir="${build.classes.dir}"/>        <fileset dir="${build.classes.dir}"/>
325      </jar>      </jar>
# Line 301  ant [target], where target is one of: Line 327  ant [target], where target is one of:
327    </target>    </target>
328    
329    
330    <target name="compile-emulation" depends="init"    <target name="compile-emulation"
331            if="build.emulation"            depends="init, configure-compiler"
332            description="Compiles emulation sources to build folder">            if="build.emulation.true">
333    
334      <mkdir dir="${build.emulation.dir}"/>      <mkdir dir="${build.emulation.dir}"/>
335    
# Line 315  ant [target], where target is one of: Line 341  ant [target], where target is one of:
341             source="${build.sourcelevel}"             source="${build.sourcelevel}"
342               fork="true">               fork="true">
343    
344        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args}"/>
345        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <bootclasspath refid="compile.bootclasspath"/>
346    
347      </javac>      </javac>
348    
349    </target>    </target>
350    
351    
352    <target name="emulation-jar" depends="native-jar, compile-emulation"    <target name="emulation-jar"
353            if="build.emulation">            depends="compile-emulation"
354              if="build.emulation.true">
355    
356    
357      <jar destfile="${product.jar}" update="true" duplicate="add">      <jar destfile="${product.jar}" duplicate="add">
358          <fileset dir="${build.classes.dir}">
359            <patternset refid="atomic.exclusion"/>
360            <patternset refid="unsafe.exclusion"/>
361          </fileset>
362        <fileset dir="${build.emulation.dir}"/>        <fileset dir="${build.emulation.dir}"/>
363      </jar>      </jar>
364    
365    </target>    </target>
366    
367    
368    <target name="dist-jar" depends="clean, jar">    <target name="dist-jar"
369              depends="clean, jar">
370    
371      <copy file="${product.jar}" todir="${dist.dir}"/>      <copy file="${product.jar}" todir="${dist.dir}"/>
372    
373    </target>    </target>
374    
375    
376    <target name="dist-docs" depends="filter-src"    <target name="compile-ant-filter"
377            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">  
378    
379      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
380    
# Line 370  ant [target], where target is one of: Line 386  ant [target], where target is one of:
386    </target>    </target>
387    
388    
389    <target name="filter-src" depends="compile-ant-filter">    <target name="filter-src"
390              depends="compile-ant-filter">
391    
392      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
393    
394      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
395        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
396          <include name="**/*.java"/>          <include name="**/*.html"/>
397          <exclude name="**/Random.java"/>        </fileset>
398          <exclude name="**/Unsafe.java"/>      </copy>
399    
400        <copy todir="${build.filter.src.dir}">
401          <fileset dir="${src.dir}">
402            <exclude name="**/*.html"/>
403            <patternset refid="unsafe.exclusion"/>
404        </fileset>        </fileset>
405        <filterchain>        <filterchain>
406    
407            <!--
408             # This filter gets rid of angle-bracketed type parameters
409             # so that javadoc can run on the result. The following
410             # heuristic seems to work:
411             #
412             # For all lines not starting with space(s)-asterisk-space(s),
413             #   replace <something> with a space, where there may be more
414             #   than one right angle bracket at the end, and "something"
415             #   must not contain parens or pipes. (This may need some
416             #   tweaking.)
417             -->
418    
419          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
420                        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.)  
            -->  
421            <param name="notmatching" value="^\s+\*\s.*$"/>            <param name="notmatching" value="^\s+\*\s.*$"/>
422            <param name="pattern" value="&lt;[^|>()]+?>+"/>            <param name="pattern"     value="&lt;[^|>()]+?>+"/>
423            <param name="replacement" value=" "/>            <param name="replacement" value=" "/>
424          </filterreader>          </filterreader>
425    
426    
427            <!--
428             # This filter uncomments lines beginning with "//@" so that
429             # javadoc can see imports that are needed to resolve links
430             # but that shouldn't be in the compiled code.
431             -->
432    
433          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
434                        classpath="${build.ant.dir}">                        classpath="${build.ant.dir}">
435            <!--            <param name="matching"    value="^//@.*$"/>
436             # These arguments are to uncomment lines beginning with            <param name="pattern"     value="^//@"/>
            # "//@" so that javadoc can see imports that are needed  
            # to resolve links but that shouldn't be in the compiled  
            # code.  
            -->  
           <param name="matching" value="^//@.*$"/>  
           <param name="pattern" value="^//@"/>  
437            <param name="replacement" value=""/>            <param name="replacement" value=""/>
438          </filterreader>          </filterreader>
439        </filterchain>        </filterchain>
# Line 416  ant [target], where target is one of: Line 442  ant [target], where target is one of:
442    </target>    </target>
443    
444    
445    <target name="compile-tests" depends="jar">  
446    
447      <target name="filter-doccheck"
448              depends="filter-src">
449    
450        <mkdir dir="${build.filter.doccheck.dir}"/>
451    
452        <copy todir="${build.filter.doccheck.dir}">
453          <fileset dir="${build.filter.src.dir}">
454            <include name="**/*.html"/>
455          </fileset>
456        </copy>
457    
458        <property name="generic.declarations"
459                 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 {}"
460        />
461    
462        <copy todir="${build.filter.doccheck.dir}">
463          <fileset dir="${build.filter.src.dir}">
464            <exclude name="**/*.html"/>
465          </fileset>
466          <filterchain>
467            <!--
468             # These two filters try to make the source look like
469             # something that doccheck can process. The first removes
470             # -source 1.4 assertions and the second adds in a bunch
471             # of single letter public nested marker interfaces so that
472             # the generic type parameters are recognized.
473             -->
474    
475            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
476                          classpath="${build.ant.dir}">
477              <param name="matching"    value="^\s*assert[\s ].*$"/>
478              <param name="pattern"     value="assert"/>
479              <param name="replacement" value="//assert"/>
480            </filterreader>
481    
482            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
483                          classpath="${build.ant.dir}">
484              <param name="matching"    value="^([^*]*(class|interface|implements) .*|)\{.*$"/>
485              <param name="pattern"     value="$"/>
486              <param name="replacement" value=" ${generic.declarations}"/>
487            </filterreader>
488    
489          </filterchain>
490        </copy>
491    
492      </target>
493    
494    
495      <target name="compile-tests"
496              depends="jar">
497    
498      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
499    
500    <!--
501        <echo>javac ${gjc.args}</echo>
502        <echo>bootclasspath=${test.compile.bootclasspath}</echo>
503        <echo>classpath="${test.classpath}"</echo>
504    -->
505    
506      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
507            destdir="${build.testcases.dir}"            destdir="${build.testcases.dir}"
508              debug="${build.debug}"              debug="${build.debug}"
# Line 428  ant [target], where target is one of: Line 511  ant [target], where target is one of:
511             source="${build.sourcelevel}"             source="${build.sourcelevel}"
512               fork="true">               fork="true">
513    
514        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args}"/>
515        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <bootclasspath refid="test.compile.bootclasspath"/>
516        <classpath refid="test.classpath"/>        <classpath     refid="test.classpath"/>
517    
518      </javac>      </javac>
519    
520    </target>    </target>
521    
522    
523    <target name="run-tests" depends="compile-tests">    <target name="run-tests"
524              depends="compile-tests">
525    
526      <!-- May be overridden by user.properties -->      <!-- May be overridden by user.properties -->
527      <property name="testcase" value="*"/>      <property name="testcase" value="*"/>
# Line 451  ant [target], where target is one of: Line 535  ant [target], where target is one of:
535                      dir="${build.reports.dir}"                      dir="${build.reports.dir}"
536                     fork="true">                     fork="true">
537    
538        <jvmarg value="${test.javac.args}"/>        <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
539    
540        <formatter type="xml"/>        <formatter type="xml"/>
541    
# Line 466  ant [target], where target is one of: Line 550  ant [target], where target is one of:
550    </target>    </target>
551    
552    
553    <target name="report-tests" depends="run-tests">    <target name="report-tests"
554              depends="run-tests">
555    
556      <!-- Sets junit.report.format to frames if Xalan is present,      <!-- Sets junit.report.format to frames if Xalan is present,
557           otherwise sets it to noframes. -->           otherwise sets it to noframes. -->
558      <available property="junit.report.format"      <available property="junit.report.format"
# Line 486  ant [target], where target is one of: Line 572  ant [target], where target is one of:
572      </junitreport>      </junitreport>
573    
574      <fail message="Test Cases Failed" if="junit.failed"/>      <fail message="Test Cases Failed" if="junit.failed"/>
575    
576      </target>
577    
578    
579      <target name="configure-compiler">
580    
581        <property name="gjc.version"
582                 value="2.2"/>
583    
584        <condition property="novariance.arg" value="-novariance">
585          <and>
586            <equals arg1="${gjc.version}" arg2="2.0"/>
587            <or>
588              <not><isset property="gjc.novariance"/></not>
589              <istrue value="${gjc.novariance}"/>
590            </or>
591          </and>
592        </condition>
593    
594        <property name="novariance.arg"
595                 value=""/>
596    
597        <property name="gjc.dir"
598                 value="${lib.dir}/gjc"/>
599    
600        <property name="javac.jar"
601              location="${gjc.dir}/${gjc.version}/javac.jar"/>
602    
603        <property name="collect.jar"
604              location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
605    
606    
607        <condition property="warnunchecked.arg" value="-warnunchecked">
608          <istrue value="${gjc.warnunchecked}"/>
609        </condition>
610    
611        <property name="warnunchecked.arg" value=""/>
612    
613        <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
614          <istrue value="${build.nothreads}"/>
615        </condition>
616    
617    
618        <!--
619         ! Bootclasspath munging for source compilation.
620         -->
621    
622        <path id="pre.bootclasspath">
623          <pathelement location="${javac.jar}"/>
624        </path>
625    
626        <path id="compile.bootclasspath">
627          <pathelement location="${build.classes.dir}"/>
628          <pathelement location="${collect.jar}"/>
629          <pathelement location="${rt.jar}"/>
630        </path>
631    
632        <!-- Flatten paths into platform-appropriate strings -->
633        <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
634        <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
635    
636    
637        <!-- Common options in javac invocations -->
638        <property name="gjc.args"
639                 value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
640        />
641    
642      </target>
643    
644    
645      <target name="prepare-src"
646              depends="configure-compiler"
647              if="prepare.src.dir">
648    
649        <mkdir dir="${prepare.src.dir}"/>
650        <copy todir="${prepare.src.dir}">
651          <fileset dir="${src.dir}">
652            <exclude name="java/lang/**"/>
653          </fileset>
654        </copy>
655    
656      </target>
657    
658    
659      <target name="configure-emulation">
660    
661        <condition property="build.emulation.true">
662          <or>
663            <and>
664              <os family="windows"/>
665              <not>
666                <isset property="build.emulation"/>
667              </not>
668            </and>
669            <istrue value="${build.emulation}"/>
670          </or>
671        </condition>
672    
673    </target>    </target>
674    
675    
676    <target name="check-junit">    <target name="configure-tests"
677      <!-- FIXME: this test isn't specific enough -->         depends="configure-compiler">
678    
679        <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
680      <available property="junit.available"      <available property="junit.available"
681                 classname="junit.framework.TestCase"/>                 classname="junit.framework.Protectable"/>
682      <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>  
683        <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
684              unless="junit.available"/>
685    
686    
687        <!--
688         ! Bootclasspath munging for testing, so JUnit can test our local
689         ! modifications to java.*.
690         -->
691    
692        <path id="test.classpath">
693          <pathelement location="${product.jar}"/>
694          <pathelement location="${build.testcases.dir}"/>
695          <pathelement location="${junit.jar}"/>
696        </path>
697    
698        <path id="test.compile.bootclasspath">
699          <pathelement location="${javac.jar}"/>
700          <pathelement location="${collect.jar}"/>
701          <pathelement location="${rt.jar}"/>
702        </path>
703    
704        <path id="test.run.bootclasspath">
705          <pathelement location="${javac.jar}"/>
706          <path refid="test.classpath"/>
707        </path>
708    
709        <!-- Flatten test classpaths into platform-appropriate strings -->
710        <property name="test.classpath"             refid="test.classpath"/>
711        <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
712        <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
713    
714      </target>
715    
716    
717    
718      <!-- Anthill targets -->
719    
720      <target name="anthill-build"
721              depends="jar, test, docs, dist-docs"/>
722    
723      <target name="anthill-publish">
724    
725        <copy todir="${deployDir}/docs/private">
726          <fileset dir="${build.javadocs.dir}"/>
727        </copy>
728    
729        <copy todir="${deployDir}/docs/public">
730          <fileset dir="${dist.javadocs.dir}"/>
731        </copy>
732    
733        <copy tofile="${deployDir}/index.html"
734              file="${basedir}/etc/anthill-index.html"/>
735    
736        <copy todir="${deployDir}/notes">
737          <fileset dir="${basedir}/etc/notes"/>
738        </copy>
739    
740      </target>
741    
742    
743      <target name="ng" depends="test">
744        <java classname="SuperfluousAbstract" fork="true">
745    
746          <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
747    
748        </java>
749    </target>    </target>
750    
751    

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

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