[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.24, Mon May 19 03:02:39 2003 UTC revision 1.40, Fri Jun 6 18:34:44 2003 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.5"/>
# Line 36  Line 26 
26    <property name="build.debug"          value="true"/>    <property name="build.debug"          value="true"/>
27    <property name="build.debuglevel"     value="source,lines,vars"/>    <property name="build.debuglevel"     value="source,lines,vars"/>
28    <property name="build.deprecation"    value="false"/>    <property name="build.deprecation"    value="false"/>
   <!--  
   <property name="build.warnings"       value="true"/>  
   -->  
29    
30    <!-- Build locations -->    <!-- Build locations -->
31    <property name="build.dir"            location="build"/>    <property name="build.dir"            location="build"/>
32    <property name="build.classes.dir"    location="${build.dir}/classes"/>    <property name="build.classes.dir"    location="${build.dir}/classes"/>
33      <property name="build.emulation.dir"  location="${build.dir}/emulation"/>
34    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
35    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.lib.dir"        location="${build.dir}/lib"/>
36    <property name="build.ant.dir"        location="${build.dir}/ant"/>    <property name="build.ant.dir"        location="${build.dir}/ant"/>
# Line 54  Line 42 
42    
43    <!-- Source locations -->    <!-- Source locations -->
44    <property name="src.dir"              location="${basedir}/src/main"/>    <property name="src.dir"              location="${basedir}/src/main"/>
45      <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>
46    <property name="test.src.dir"         location="${basedir}/src/test"/>    <property name="test.src.dir"         location="${basedir}/src/test"/>
47    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
48    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
# Line 65  Line 54 
54    
55    <!-- Jar locations -->    <!-- Jar locations -->
56    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
   <property name="javac.jar"            location="${lib.dir}/javac.jar"/>  
   <property name="collect.jar"          location="${lib.dir}/collect.jar"/>  
57    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
58    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
59    
   <property name="javac.args"           value='-J-Xbootclasspath/p:${javac.jar}'/>  
60    
   <path id="javac.bootclasspath">  
     <pathelement location="${collect.jar}"/>  
     <pathelement location="${rt.jar}"/>  
   </path>  
61    
62    <path id="test.classpath">    <!-- Files excluded from dist-docs and emulation jar -->
63      <pathelement location="${product.jar}"/>    <patternset id="unsafe.exclusion">
64    </path>      <exclude name="java/util/Random.*"/>
65        <exclude name="sun/misc/Unsafe.*"/>
66      </patternset>
67    
68      <!-- Files excludes from emulation jar -->
69      <patternset id="atomic.exclusion">
70        <exclude name="java/util/concurrent/atomic/AtomicInteger*"/>
71        <exclude name="java/util/concurrent/atomic/AtomicLong*"/>
72        <exclude name="java/util/concurrent/atomic/AtomicReference*"/>
73      </patternset>
74    
75    
76    
77    <!-- Main targets -->    <!-- Main targets -->
78    
79    <target name="compile" depends="init"    <target name="compile"
80            description="Compiles all sources to build folder">            depends="init, configure-compiler, prepare-src"
81              description="Compiles main sources to build folder">
82    
83        <property name="prepare.src.dir" value="${src.dir}"/>
84    
85      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
86      <javac srcdir="${src.dir}"  
87    <!--
88        <echo>javac ${gjc.args}</echo>
89        <echo>bootclasspath=${compile.bootclasspath}</echo>
90    -->
91    
92        <javac srcdir="${prepare.src.dir}"
93            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
94              debug="${build.debug}"              debug="${build.debug}"
95         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
# Line 95  Line 97 
97             source="${build.sourcelevel}"             source="${build.sourcelevel}"
98               fork="true">               fork="true">
99    
100        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args}"/>
101        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <bootclasspath refid="compile.bootclasspath"/>
102    
103      </javac>      </javac>
104    
105    </target>    </target>
106    
107    
108    <target name="jar" depends="compile"    <target name="jar"
109            description="Builds library jar from compiled sources">            depends="configure-emulation, init-jar, native-jar, emulation-jar"
110      <mkdir dir="${build.lib.dir}"/>            description="Builds library jar from compiled sources"/>
     <jar basedir="${build.classes.dir}"  
         destfile="${product.jar}"  
     />  
   </target>  
111    
112    
113    <target name="test" depends="init, check-junit, report-tests"    <target name="test"
114            description="Runs all tests (requires JUnit 1.8 in ${ant.home}/lib)"/>            depends="init, configure-tests, report-tests"
115              description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
116    
117    
118    <target name="checkstyle" depends="filter-src"    <target name="checkstyle"
119              depends="filter-src"
120            description="Reports on style errors in Java source (verbose, mostly chaff)">            description="Reports on style errors in Java source (verbose, mostly chaff)">
121    
122      <taskdef resource="checkstyletask.properties"      <taskdef resource="checkstyletask.properties"
123              classpath="${lib.dir}/checkstyle-all-2.4.jar"/>              classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
124    
# Line 124  Line 126 
126        <formatter type="plain"/>  <!-- also available: type="xml" -->        <formatter type="plain"/>  <!-- also available: type="xml" -->
127        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
128      </checkstyle>      </checkstyle>
129    
130    </target>    </target>
131    
132    
133    <target name="doccheck" depends="filter-src"    <target name="doccheck"
134              depends="filter-src"
135            description="Reports on javadoc style errors (not working yet)">            description="Reports on javadoc style errors (not working yet)">
136    
137      <delete dir="${build.doccheck.dir}"/>      <delete dir="${build.doccheck.dir}"/>
138      <mkdir dir="${build.doccheck.dir}"/>      <mkdir dir="${build.doccheck.dir}"/>
139    
140      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
141           docletpath="${lib.dir}/doccheck.jar"           docletpath="${lib.dir}/doccheck.jar"
142              destdir="${build.doccheck.dir}">              destdir="${build.doccheck.dir}">
143        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.src.dir}"/>
144      </javadoc>      </javadoc>
145    
146    </target>    </target>
147    
148    
149    <target name="docs" depends="filter-src"    <target name="docs"
150              depends="filter-src"
151            description="Builds javadocs with custom tags to build folder">            description="Builds javadocs with custom tags to build folder">
152    
153      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
154      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${build.javadocs.dir}"/>
155    
156      <javadoc destdir="${build.javadocs.dir}"      <javadoc destdir="${build.javadocs.dir}"
157                  link="http://java.sun.com/j2se/1.4.1/docs/api"                  link="http://java.sun.com/j2se/1.4.1/docs/api"
158              overview="${src.dir}/intro.html"              overview="${src.dir}/intro.html"
# Line 152  Line 162 
162        <tag name="spec" description="Specified by:"/>        <tag name="spec" description="Specified by:"/>
163        <tag name="editor" description="Last edited by:"/>        <tag name="editor" description="Last edited by:"/>
164        <tag name="fixme" description="FIX ME:"/>        <tag name="fixme" description="FIX ME:"/>
165    
166        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.src.dir}"/>
167    
168      </javadoc>      </javadoc>
169    
170    </target>    </target>
171    
172    
173      <target name="strip"
174              depends="init, configure-compiler"
175              description="Strip generics from java source (not working yet)">
176    
177        <mkdir dir="${build.stripped.dir}"/>
178    
179    <!--    <!--
180     # javac -s doesn't reliably generate compilable code. It generates     # javac -s doesn't reliably generate compilable code. It generates
181     # bridge methods (marked as "synthetic") that can have identical     # bridge methods (marked as "synthetic") that can have identical
182     # signatures to existing methods except for the return value.     # signatures to existing methods except for the return value.
183     -->     -->
   <target name="strip" depends="init">  
     <mkdir dir="${build.stripped.dir}"/>  
184      <javac srcdir="${src.dir}"      <javac srcdir="${src.dir}"
185            destdir="${build.stripped.dir}"            destdir="${build.stripped.dir}"
186              debug="${build.debug}"              debug="${build.debug}"
# Line 173  Line 189 
189             source="${build.sourcelevel}"             source="${build.sourcelevel}"
190               fork="true">               fork="true">
191    
192        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args} -s"/>
193        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>        <bootclasspath refid="compile.bootclasspath"/>
194    
195      </javac>      </javac>
196    
197    </target>    </target>
198    
199    
200    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"    <target name="dist"
201              depends="init, dist-clean, dist-jar, dist-docs"
202            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
203    
204    
205    <target name="clean"    <target name="clean"
206            description="Removes all build products">            description="Removes all build products">
207    
208      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
209      <delete dir="${build.classes.dir}"/>      <delete dir="${build.classes.dir}"/>
210      <delete dir="${build.lib.dir}"/>      <delete dir="${build.lib.dir}"/>
211    
212    </target>    </target>
213    
214    
215    <target name="dist-clean"    <target name="dist-clean"
216            description="Removes all build and distribution products">            description="Removes all build and distribution products">
217    
218      <delete dir="${dist.dir}"/>      <delete dir="${dist.dir}"/>
219    
220    </target>    </target>
221    
222    
223    <!-- Anthill targets -->    <target name="dist-docs"
224              depends="filter-src"
225              description="Builds javadocs without custom tags to dist folder">
226    
227    <!-- Should really run the tests instead of just the jar target -->      <delete dir="${dist.javadocs.dir}"/>
228    <target name="anthill-build" depends="jar, docs, dist-docs"/>      <mkdir dir="${dist.javadocs.dir}"/>
229    
230    <target name="anthill-publish">      <javadoc destdir="${dist.javadocs.dir}"
231      <copy todir="${deployDir}/docs/private">                  link="http://java.sun.com/j2se/1.4.1/docs/api"
232        <fileset dir="${build.javadocs.dir}"/>              overview="${src.dir}/intro.html"
233      </copy>                source="${build.docsourcelevel}">
     <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>  
234    
235          <packageset dir="${build.filter.src.dir}"/>
236    
237    <!-- Internal targets -->      </javadoc>
238    
   <target name="set-warnings-if" if="build.warnings">  
     <property name="build.warnings.option" value="-warnunchecked"/>  
239    </target>    </target>
240    
241    
   <target name="set-warnings-unless" unless="build.warnings">  
     <property name="build.warnings.option" value=""/>  
   </target>  
242    
243      <!-- Internal targets -->
244    
245    
246      <target name="init">
247    
   <target name="init" depends="set-warnings-if, set-warnings-unless">  
248      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
249      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
250      <echo>Building JSR-166 version ${version}</echo>      <echo>Building JSR-166 version ${version}</echo>
251    
252    </target>    </target>
253    
254    
255    <target name="dist-jar" depends="clean, jar">    <target name="init-jar">
256      <copy file="${product.jar}" todir="${dist.dir}"/>  
257        <mkdir dir="${build.lib.dir}"/>
258    
259    </target>    </target>
260    
261    
262    <target name="dist-docs" depends="filter-src"    <target name="native-jar"
263            description="Builds javadocs without custom tags to dist folder">            depends="compile"
264      <delete dir="${dist.javadocs.dir}"/>            unless="build.emulation.true">
     <mkdir dir="${dist.javadocs.dir}"/>  
     <javadoc destdir="${dist.javadocs.dir}"  
                 link="http://java.sun.com/j2se/1.4.1/docs/api"  
             overview="${src.dir}/intro.html"  
               source="${build.sourcelevel}">  
265    
266        <packageset dir="${build.filter.src.dir}"/>      <jar destfile="${product.jar}">
267          <fileset dir="${build.classes.dir}"/>
268        </jar>
269    
     </javadoc>  
270    </target>    </target>
271    
272    
273    <target name="compile-ant-filter" depends="init">    <target name="compile-emulation"
274              depends="init, configure-compiler"
275              if="build.emulation.true">
276    
277        <mkdir dir="${build.emulation.dir}"/>
278    
279        <javac srcdir="${emulation.src.dir}"
280              destdir="${build.emulation.dir}"
281                debug="${build.debug}"
282           debuglevel="${build.debuglevel}"
283          deprecation="${build.deprecation}"
284               source="${build.sourcelevel}"
285                 fork="true">
286    
287          <compilerarg    line="${gjc.args}"/>
288          <bootclasspath refid="compile.bootclasspath"/>
289    
290        </javac>
291    
292      </target>
293    
294    
295      <target name="emulation-jar"
296              depends="compile-emulation"
297              if="build.emulation.true">
298    
299    
300        <jar destfile="${product.jar}" duplicate="add">
301          <fileset dir="${build.classes.dir}">
302            <patternset refid="atomic.exclusion"/>
303            <patternset refid="unsafe.exclusion"/>
304          </fileset>
305          <fileset dir="${build.emulation.dir}"/>
306        </jar>
307    
308      </target>
309    
310    
311      <target name="dist-jar"
312              depends="clean, jar">
313    
314        <copy file="${product.jar}" todir="${dist.dir}"/>
315    
316      </target>
317    
318    
319      <target name="compile-ant-filter"
320              depends="init">
321    
322      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
323    
324      <javac srcdir="${ant.src.dir}"      <javac srcdir="${ant.src.dir}"
325            destdir="${build.ant.dir}"            destdir="${build.ant.dir}"
326             source="1.4"             source="1.4"
327      />      />
328    
329    </target>    </target>
330    
331    
332    <target name="filter-src" depends="compile-ant-filter">    <target name="filter-src"
333              depends="compile-ant-filter">
334    
335      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
336    
337      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
338        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
339          <include name="**/*.java"/>          <include name="**/*.html"/>
340          </fileset>
341        </copy>
342    
343        <!-- Not needed now, used for doccheck filtering:
344        <property name="generic.declarations"
345                 value="public interface E {} public interface T {} public interface K {} public interface V {}"
346        />
347        -->
348    
349        <copy todir="${build.filter.src.dir}">
350          <fileset dir="${src.dir}">
351            <exclude name="**/*.html"/>
352            <patternset refid="unsafe.exclusion"/>
353        </fileset>        </fileset>
354        <filterchain>        <filterchain>
355          <filterreader classname="jsr166.ant.filters.ReplaceFilter"  
                       classpath="${build.ant.dir}">  
356            <!--            <!--
357             # These arguments are to get rid of angle-bracketed type           # This filter gets rid of angle-bracketed type parameters
358             # parameters so that javadoc can run on the result. The           # so that javadoc can run on the result. The following
359             # following heuristic that seems to work:           # heuristic seems to work:
360             #             #
361             # For all lines not starting with space(s)-asterisk-space(s),             # For all lines not starting with space(s)-asterisk-space(s),
362             #   replace <something> with a space, where there may be more             #   replace <something> with a space, where there may be more
# Line 286  Line 364 
364             #   must not contain parens or pipes. (This may need some             #   must not contain parens or pipes. (This may need some
365             #   tweaking.)             #   tweaking.)
366             -->             -->
367    
368            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
369                          classpath="${build.ant.dir}">
370            <param name="notmatching" value="^\s+\*\s.*$"/>            <param name="notmatching" value="^\s+\*\s.*$"/>
371            <param name="pattern" value="&lt;[^|>()]+?>+"/>            <param name="pattern" value="&lt;[^|>()]+?>+"/>
372            <param name="replacement" value=" "/>            <param name="replacement" value=" "/>
373          </filterreader>          </filterreader>
374          <filterreader classname="jsr166.ant.filters.ReplaceFilter"  
375                        classpath="${build.ant.dir}">  
376            <!--            <!--
377             # These arguments are to uncomment lines beginning with           # This filter uncomments lines beginning with "//@" so that
378             # "//@" so that javadoc can see imports that are needed           # javadoc can see imports that are needed to resolve links
379             # to resolve links but that shouldn't be in the compiled           # but that shouldn't be in the compiled code.
            # code.  
380             -->             -->
381    
382            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
383                          classpath="${build.ant.dir}">
384            <param name="matching" value="^//@.*$"/>            <param name="matching" value="^//@.*$"/>
385            <param name="pattern" value="^//@"/>            <param name="pattern" value="^//@"/>
386            <param name="replacement" value=""/>            <param name="replacement" value=""/>
387          </filterreader>          </filterreader>
388    
389    
390            <!--
391             # The next two filters try to make the source look like
392             # something that doccheck can process. The first removes
393             # -source 1.4 assertions and the second adds in a bunch
394             # of single letter public nested marker interfaces so that
395             # the generic type parameters are recognized.
396             #
397             # Currently commented out because doccheck doesn't work. :-(
398             -->
399    
400            <!--
401            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
402                          classpath="${build.ant.dir}">
403              <param name="matching"    value="^\s*assert[\s ].*$"/>
404              <param name="pattern"     value="assert"/>
405              <param name="replacement" value="//assert"/>
406            </filterreader>
407    
408            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
409                          classpath="${build.ant.dir}">
410              <param name="matching"    value="^(.*(class|interface|implements) .*|)\{.*$"/>
411              <param name="pattern"     value="$"/>
412              <param name="replacement" value=" ${generic.declarations}"/>
413            </filterreader>
414            -->
415    
416        </filterchain>        </filterchain>
417      </copy>      </copy>
418    
419    </target>    </target>
420    
421    
422    <target name="compile-tests" depends="jar">    <target name="compile-tests"
423              depends="jar">
424    
425      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
426    
427    <!--
428        <echo>javac ${gjc.args}</echo>
429        <echo>bootclasspath=${test.compile.bootclasspath}</echo>
430        <echo>classpath="${test.classpath}"</echo>
431    -->
432    
433      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
434            destdir="${build.testcases.dir}"            destdir="${build.testcases.dir}"
435              debug="${build.debug}"              debug="${build.debug}"
# Line 317  Line 438 
438             source="${build.sourcelevel}"             source="${build.sourcelevel}"
439               fork="true">               fork="true">
440    
441        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args}"/>
442        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <bootclasspath refid="test.compile.bootclasspath"/>
443        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
444    
445      </javac>      </javac>
446    
447    </target>    </target>
448    
449    
450    <target name="run-tests" depends="compile-tests">    <target name="run-tests"
451              depends="compile-tests">
452    
453        <!-- May be overridden by user.properties -->
454        <property name="testcase" value="*"/>
455    
456      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.reports.dir}"/>
457    
458      <junit printsummary="true"      <junit printsummary="true"
459               showoutput="true"               showoutput="true"
460            errorProperty="junit.failed"            errorProperty="junit.failed"
# Line 334  Line 462 
462                      dir="${build.reports.dir}"                      dir="${build.reports.dir}"
463                     fork="true">                     fork="true">
464    
465        <!--        <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
        ! This nastiness is so JUnit can test classes we are inserting  
        ! into the java.* packages.  
        -->  
       <jvmarg value="-Xbootclasspath/p:${product.jar};${build.testcases.dir};${junit.jar}"/>  
466    
467        <formatter type="xml"/>        <formatter type="xml"/>
468    
# Line 349  Line 473 
473        </batchtest>        </batchtest>
474    
475      </junit>      </junit>
476    
477    </target>    </target>
478    
479    
480    <target name="report-tests" depends="run-tests">    <target name="report-tests"
481              depends="run-tests">
482    
483      <!-- Sets junit.report.format to frames if Xalan is present,      <!-- Sets junit.report.format to frames if Xalan is present,
484           otherwise sets it to noframes. -->           otherwise sets it to noframes. -->
485      <available property="junit.report.format"      <available property="junit.report.format"
# Line 372  Line 499 
499      </junitreport>      </junitreport>
500    
501      <fail message="Test Cases Failed" if="junit.failed"/>      <fail message="Test Cases Failed" if="junit.failed"/>
502    
503      </target>
504    
505    
506      <target name="configure-compiler">
507    
508        <property name="gjc.version"
509                 value="2.0"/>
510    
511        <condition property="novariance.arg" value="-novariance">
512          <and>
513            <equals arg1="${gjc.version}" arg2="2.0"/>
514            <or>
515              <not><isset property="gjc.novariance"/></not>
516              <istrue value="${gjc.novariance}"/>
517            </or>
518          </and>
519        </condition>
520    
521        <property name="novariance.arg"
522                 value=""/>
523    
524        <property name="gjc.dir"
525                 value="${lib.dir}/gjc"/>
526    
527        <property name="javac.jar"
528              location="${gjc.dir}/${gjc.version}/javac.jar"/>
529    
530        <property name="collect.jar"
531              location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
532    
533    
534        <condition property="warnunchecked.arg" value="-warnunchecked">
535          <istrue value="${gjc.warnunchecked}"/>
536        </condition>
537    
538        <property name="warnunchecked.arg" value=""/>
539    
540        <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
541          <istrue value="${build.nothreads}"/>
542        </condition>
543    
544    
545        <!--
546         ! Bootclasspath munging for source compilation.
547         -->
548    
549        <path id="pre.bootclasspath">
550          <pathelement location="${javac.jar}"/>
551        </path>
552    
553        <path id="compile.bootclasspath">
554          <pathelement location="${build.classes.dir}"/>
555          <pathelement location="${collect.jar}"/>
556          <pathelement location="${rt.jar}"/>
557        </path>
558    
559        <!-- Flatten paths into platform-appropriate strings -->
560        <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
561        <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
562    
563    
564        <!-- Common options in javac invocations -->
565        <property name="gjc.args"
566                 value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
567        />
568    
569      </target>
570    
571    
572      <target name="prepare-src"
573              depends="configure-compiler"
574              if="prepare.src.dir">
575    
576        <mkdir dir="${prepare.src.dir}"/>
577        <copy todir="${prepare.src.dir}">
578          <fileset dir="${src.dir}">
579            <exclude name="java/lang/**"/>
580          </fileset>
581        </copy>
582    
583    </target>    </target>
584    
585    
586    <target name="check-junit">    <target name="configure-emulation">
587      <!-- FIXME: this test isn't specific enough -->  
588        <condition property="build.emulation.true">
589          <or>
590            <and>
591              <os family="windows"/>
592              <not>
593                <isset property="build.emulation"/>
594              </not>
595            </and>
596            <istrue value="${build.emulation}"/>
597          </or>
598        </condition>
599    
600      </target>
601    
602    
603      <target name="configure-tests"
604           depends="configure-compiler">
605    
606        <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
607      <available property="junit.available"      <available property="junit.available"
608                 classname="junit.framework.TestCase"/>                 classname="junit.framework.Protectable"/>
609      <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>  
610        <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
611              unless="junit.available"/>
612    
613    
614        <!--
615         ! Bootclasspath munging for testing, so JUnit can test our local
616         ! modifications to java.*.
617         -->
618    
619        <path id="test.classpath">
620          <pathelement location="${product.jar}"/>
621          <pathelement location="${build.testcases.dir}"/>
622          <pathelement location="${junit.jar}"/>
623        </path>
624    
625        <path id="test.compile.bootclasspath">
626          <pathelement location="${javac.jar}"/>
627          <pathelement location="${collect.jar}"/>
628          <pathelement location="${rt.jar}"/>
629        </path>
630    
631        <path id="test.run.bootclasspath">
632          <pathelement location="${javac.jar}"/>
633          <path refid="test.classpath"/>
634        </path>
635    
636        <!-- Flatten test classpaths into platform-appropriate strings -->
637        <property name="test.classpath"             refid="test.classpath"/>
638        <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
639        <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
640    
641      </target>
642    
643    
644    
645      <!-- Anthill targets -->
646    
647      <target name="anthill-build"
648              depends="jar, test, docs, dist-docs"/>
649    
650      <target name="anthill-publish">
651    
652        <copy todir="${deployDir}/docs/private">
653          <fileset dir="${build.javadocs.dir}"/>
654        </copy>
655    
656        <copy todir="${deployDir}/docs/public">
657          <fileset dir="${dist.javadocs.dir}"/>
658        </copy>
659    
660        <copy tofile="${deployDir}/index.html"
661              file="${basedir}/etc/anthill-index.html"/>
662    
663        <copy todir="${deployDir}/notes">
664          <fileset dir="${basedir}/etc/notes"/>
665        </copy>
666    
667    </target>    </target>
668    
669    

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.40

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8