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

Diff of /jsr166/build.xml

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

revision 1.28 by tim, Wed May 28 13:37:59 2003 UTC revision 1.67 by jsr166, Sun Apr 11 22:00:40 2004 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.j1.dir"         location="${build.dir}/j1"/>
34      <property name="build.loops.dir"      location="${build.dir}/loops"/>
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"/>
37    <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"/>  
38    <property name="build.reports.dir"    location="${build.dir}/reports"/>    <property name="build.reports.dir"    location="${build.dir}/reports"/>
39      <property name="build.checkstyle.dir" location="${build.dir}/checkstyle"/>
40    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
41    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
42      <property name="build.dc-filter.dir"  location="${build.dir}/filterdocchk"/>
43    
44    <!-- Source locations -->    <!-- Source locations -->
45    <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"/>  
46    <property name="test.src.dir"         location="${basedir}/src/test"/>    <property name="test.src.dir"         location="${basedir}/src/test"/>
47      <property name="j1.src.dir"           location="${basedir}/src/javaone"/>
48      <property name="loops.src.dir"        location="${basedir}/src/loops"/>
49      <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
50      <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>
51    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
52    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
53    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
# Line 68  ant [target], where target is one of: Line 58  ant [target], where target is one of:
58    
59    <!-- Jar locations -->    <!-- Jar locations -->
60    <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"/>  
61    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
62    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="concurrent.jar"       location="${lib.dir}/concurrent.jar"/>
   
   
   
   <!--  
    ! Bootclasspath munging for source compilation.  
    -->  
   
   <path id="javac.bootclasspath.prefix">  
     <!-- <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.prefix" refid="javac.bootclasspath.prefix"/>  
63    
64    <!-- Turn the flattened bootclasspath prefix into a javac argument -->    <!-- Bootclasspath argument -->
65    <property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/>    <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>
   
   
   
   <!--  
    ! Bootclasspath munging for testing, so JUnit can test our local  
    ! modifications to java.*.  
    -->  
66    
67      <!-- Test classpath -->
68    <path id="test.classpath">    <path id="test.classpath">
     <pathelement location="${product.jar}"/>  
69      <pathelement location="${build.testcases.dir}"/>      <pathelement location="${build.testcases.dir}"/>
70      <pathelement location="${junit.jar}"/>      <pathelement location="${junit.jar}"/>
71    </path>    </path>
72    
73    <!-- Flatten test classpath into a platform-appropriate string -->    <!-- ALoops classpath -->
74    <property name="test.classpath" refid="test.classpath"/>    <path id="loops.classpath">
75        <pathelement location="${build.loops.dir}"/>
76    <!-- Turn the flattened test classpath into a javac argument -->    </path>
   <property name="test.javac.args" value='-Xbootclasspath/p:${test.classpath}'/>  
   
   
   
   <!-- Files excluded from emulation and dist-docs -->  
   <patternset id="emulation.excludes">  
     <exclude name="java/util/Random.*"/>  
     <exclude name="sun/misc/Unsafe.*"/>  
   </patternset>  
77    
78      <!-- J1 classpath -->
79      <path id="j1.classpath">
80        <pathelement location="${build.j1.dir}"/>
81        <pathelement location="${junit.jar}"/>
82        <pathelement location="${concurrent.jar}"/>
83      </path>
84    
85    
86    <!-- Main targets -->    <!-- Main targets -->
87    
88    
89    <target name="compile"    <target name="compile"
90            depends="init"            depends="init, configure-compiler"
91            description="Compiles main sources to build folder">            description="Compiles main sources to build folder">
92    
93      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
# Line 141  ant [target], where target is one of: Line 100  ant [target], where target is one of:
100             source="${build.sourcelevel}"             source="${build.sourcelevel}"
101               fork="true">               fork="true">
102    
103        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg line="${build.args}"/>
       <compilerarg line="${javac.args} ${build.warnings.option}"/>  
104    
105      </javac>      </javac>
106    
107    </target>    </target>
108    
109    
110    
111    <target name="jar"    <target name="jar"
112            depends="native-jar, emulation-jar"            depends="compile"
113            description="Builds library jar from compiled sources"/>            description="Builds library jar from compiled sources">
114    
115        <mkdir dir="${build.lib.dir}"/>
116    
117        <jar destfile="${product.jar}">
118          <fileset dir="${build.classes.dir}"/>
119        </jar>
120    
121      </target>
122    
123    
124    
125    <target name="test"    <target name="test"
126            depends="init, check-junit, report-tests"            depends="init, configure-tests, report-tests"
127            description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)" />            description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
128    
129    
   <target name="checkstyle"  
           depends="filter-src"  
           description="Reports on style errors in Java source (verbose, mostly chaff)">  
130    
131      <taskdef resource="checkstyletask.properties"    <target name="docs"
132              classpath="${lib.dir}/checkstyle-all-2.4.jar"/>            description="Builds javadocs with custom tags to build folder">
133    
134      <checkstyle>      <delete dir="${build.javadocs.dir}"/>
135        <formatter type="plain"/>  <!-- also available: type="xml" -->      <mkdir dir="${build.javadocs.dir}"/>
136        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>  
137      </checkstyle>      <javadoc destdir="${build.javadocs.dir}"
138                    link="http://java.sun.com/j2se/1.4.1/docs/api"
139                overview="${src.dir}/intro.html"
140                  source="${build.sourcelevel}">
141    
142          <tag name="revised" description="Last revised:"/>
143          <tag name="spec"    description="Specified by:"/>
144    
145          <packageset dir="${src.dir}"/>
146    
147        </javadoc>
148    
149    </target>    </target>
150    
151    
152    
153    <target name="doccheck"    <target name="doccheck"
154            depends="filter-src"            depends="filter-doccheck"
155            description="Reports on javadoc style errors (not working yet)">            description="Reports on javadoc style errors">
156    
157      <delete dir="${build.doccheck.dir}"/>      <delete dir="${build.doccheck.dir}"/>
158      <mkdir dir="${build.doccheck.dir}"/>      <mkdir dir="${build.doccheck.dir}"/>
# Line 184  ant [target], where target is one of: Line 160  ant [target], where target is one of:
160      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
161           docletpath="${lib.dir}/doccheck.jar"           docletpath="${lib.dir}/doccheck.jar"
162              destdir="${build.doccheck.dir}">              destdir="${build.doccheck.dir}">
163        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.dc-filter.dir}"/>
164      </javadoc>      </javadoc>
165    
166        <echo>DocCheck output is in ${build.doccheck.dir}</echo>
167    
168    </target>    </target>
169    
170    
171    <target name="docs"  
172      <target name="checkstyle"
173            depends="filter-src"            depends="filter-src"
174            description="Builds javadocs with custom tags to build folder">            description="Reports on style errors in Java source (verbose, mostly chaff)">
175    
176      <delete dir="${build.javadocs.dir}"/>      <taskdef resource="checkstyletask.properties"
177      <mkdir dir="${build.javadocs.dir}"/>              classpath="${lib.dir}/checkstyle-all-3.1.jar"/>
178    
179      <javadoc destdir="${build.javadocs.dir}"      <mkdir dir="${build.checkstyle.dir}"/>
                 link="http://java.sun.com/j2se/1.4.1/docs/api"  
             overview="${src.dir}/intro.html"  
               source="${build.docsourcelevel}">  
180    
181        <tag name="revised" description="Last revised:"/>      <checkstyle config="etc/checkstyle/sun_checks.xml"
182        <tag name="spec" description="Specified by:"/>         failOnViolation="false">
183        <tag name="editor" description="Last edited by:"/>        <formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/>
184        <tag name="fixme" description="FIX ME:"/>        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
185        <packageset dir="${build.filter.src.dir}"/>      </checkstyle>
186    
187      </javadoc>      <style in="${build.checkstyle.dir}/checkstyle-report.xml"
188              out="${build.checkstyle.dir}/checkstyle-report.html"
189            style="${stylesheet.dir}/checkstyle-frames.xsl"/>
190    
191    </target>    </target>
192    
193    
   <!--  
    # 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">  
194    
195      <mkdir dir="${build.stripped.dir}"/>    <target name="dist"
196              depends="init, dist-clean, dist-jar, dist-docs"
197              description="Puts all distributable products in single hierarchy"/>
198    
     <javac srcdir="${src.dir}"  
           destdir="${build.stripped.dir}"  
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
199    
       <bootclasspath refid="javac.bootclasspath"/>  
       <compilerarg line="${javac.args} ${build.warnings.option} -s"/>  
200    
201      </javac>    <target name="release"
202              depends="dist"
203              description="Puts entire CVS tree, plus distribution productions, in a jar">
204    
205        <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
206    
207        <jar basedir="${basedir}" destfile="${release.jar}">
208          <!-- <exclude name="build/**"/> -->
209          <exclude name="${release.jar}"/>
210          <exclude name="user.properties"/>
211          <exclude name="etc/notes/**"/>
212          <exclude name="src/emulation/**"/>
213          <exclude name="**/SyntaxTest.java"/>
214          <exclude name="**/SuperfluousAbstract.java"/>
215        </jar>
216    
217    </target>    </target>
218    
219    
   <target name="dist"  
           depends="init, dist-clean, dist-jar, dist-docs"  
           description="Puts all distributable products in single hierarchy"/>  
   
220    
221    <target name="clean"    <target name="clean"
222            description="Removes all build products">            description="Removes all build products">
# Line 254  ant [target], where target is one of: Line 228  ant [target], where target is one of:
228    </target>    </target>
229    
230    
231    
232    <target name="dist-clean"    <target name="dist-clean"
233            description="Removes all build and distribution products">            description="Removes all build and distribution products">
234    
# Line 262  ant [target], where target is one of: Line 237  ant [target], where target is one of:
237    </target>    </target>
238    
239    
240    
241    <target name="dist-docs"    <target name="dist-docs"
           depends="filter-src"  
242            description="Builds javadocs without custom tags to dist folder">            description="Builds javadocs without custom tags to dist folder">
243    
244      <delete dir="${dist.javadocs.dir}"/>      <delete dir="${dist.javadocs.dir}"/>
245      <mkdir dir="${dist.javadocs.dir}"/>      <mkdir dir="${dist.javadocs.dir}"/>
246    
247      <javadoc destdir="${dist.javadocs.dir}"      <javadoc destdir="${dist.javadocs.dir}"
248                  link="http://java.sun.com/j2se/1.4.1/docs/api"                  link="http://java.sun.com/j2se/1.4.2/docs/api"
249              overview="${src.dir}/intro.html"              overview="${src.dir}/intro.html"
250                source="${build.docsourcelevel}">                source="${build.sourcelevel}">
251    
252        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${src.dir}"/>
253    
254      </javadoc>      </javadoc>
255    
# Line 284  ant [target], where target is one of: Line 259  ant [target], where target is one of:
259    
260    <!-- Internal targets -->    <!-- Internal targets -->
261    
   <target name="set-warnings-if" if="build.warnings">  
262    
263      <property name="build.warnings.option" value="-warnunchecked"/>    <target name="init">
   
   </target>  
   
   
   <target name="set-warnings-unless" unless="build.warnings">  
   
     <property name="build.warnings.option" value=""/>  
   
   </target>  
   
   
   <target name="init"  
           depends="set-warnings-if, set-warnings-unless">  
264    
265      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
266      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
267      <echo>Building JSR-166 version ${version}</echo>      <echo>Building JSR-166 version ${version}</echo>
268        <echo>java.home is ${java.home}</echo>
   </target>  
   
   
   <target name="init-jar">  
   
     <mkdir dir="${build.lib.dir}"/>  
   
   </target>  
   
   
   <target name="native-jar"  
           depends="compile, init-jar"  
           unless="build.emulation">  
   
     <jar destfile="${product.jar}">  
       <fileset dir="${build.classes.dir}"/>  
     </jar>  
   
   </target>  
   
   
   <target name="base-jar"  
           depends="compile, init-jar">  
   
     <jar destfile="${product.jar}">  
       <fileset dir="${build.classes.dir}">  
         <patternset refid="emulation.excludes"/>  
       </fileset>  
     </jar>  
   
   </target>  
   
   
   <target name="compile-emulation"  
           depends="init"  
           if="build.emulation">  
   
     <mkdir dir="${build.emulation.dir}"/>  
   
     <javac srcdir="${emulation.src.dir}"  
           destdir="${build.emulation.dir}"  
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
   
       <bootclasspath refid="javac.bootclasspath"/>  
       <compilerarg line="${javac.args} ${build.warnings.option}"/>  
   
     </javac>  
   
   </target>  
   
   
   <target name="emulation-jar"  
           depends="base-jar, compile-emulation"  
           if="build.emulation">  
   
     <jar destfile="${product.jar}" update="true" duplicate="add">  
       <fileset dir="${build.emulation.dir}"/>  
     </jar>  
269    
270    </target>    </target>
271    
# Line 386  ant [target], where target is one of: Line 285  ant [target], where target is one of:
285    
286      <javac srcdir="${ant.src.dir}"      <javac srcdir="${ant.src.dir}"
287            destdir="${build.ant.dir}"            destdir="${build.ant.dir}"
288             source="1.4"             source="1.4"/>
     />  
289    
290    </target>    </target>
291    
# Line 399  ant [target], where target is one of: Line 297  ant [target], where target is one of:
297    
298      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
299        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
300          <patternset refid="emulation.excludes"/>          <include name="**/*.html"/>
301        </fileset>        </fileset>
302        </copy>
303    
304        <copy todir="${build.filter.src.dir}">
305          <fileset dir="${src.dir}">
306            <exclude name="**/*.html"/>
307            <!-- Files excluded from dist-docs -->
308            <exclude name="java/util/Random.*"/>
309            <exclude name="sun/misc/Unsafe.*"/>
310          </fileset>
311          <!--
312        <filterchain>        <filterchain>
313          -->
314    
315            <!--
316             # This filter gets rid of angle-bracketed type parameters
317             # so that javadoc can run on the result. The following
318             # heuristic seems to work:
319             #
320             # For all lines not starting with space(s)-asterisk-space(s),
321             #   replace <something> with a space, where there may be more
322             #   than one right angle bracket at the end, and "something"
323             #   must not contain parens or pipes. (This may need some
324             #   tweaking.)
325             -->
326    
327            <!--
328          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
329                        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.)  
            -->  
330            <param name="notmatching" value="^\s+\*\s.*$"/>            <param name="notmatching" value="^\s+\*\s.*$"/>
331            <param name="pattern" value="&lt;[^|>()]+?>+"/>            <param name="pattern"     value="&lt;[^|>()]+?>+"/>
332            <param name="replacement" value=" "/>            <param name="replacement" value=" "/>
333          </filterreader>          </filterreader>
334            -->
335    
336          <!--
337          </filterchain>
338          -->
339        </copy>
340    
341      </target>
342    
343    
344      <target name="filter-doccheck"
345              depends="filter-src">
346    
347        <mkdir dir="${build.dc-filter.dir}"/>
348    
349        <copy todir="${build.dc-filter.dir}">
350          <fileset dir="${build.filter.src.dir}">
351            <include name="**/*.html"/>
352          </fileset>
353        </copy>
354    
355        <property name="generic.declarations"
356                 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 {}"
357        />
358    
359        <copy todir="${build.dc-filter.dir}">
360          <fileset dir="${build.filter.src.dir}">
361            <exclude name="**/*.html"/>
362          </fileset>
363          <filterchain>
364            <!--
365             # These two filters try to make the source look like
366             # something that doccheck can process. The first removes
367             # -source 1.4 assertions and the second adds in a bunch
368             # of single letter public nested marker interfaces so that
369             # the generic type parameters are recognized.
370             -->
371    
372          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
373                        classpath="${build.ant.dir}">                        classpath="${build.ant.dir}">
374            <!--            <param name="matching"    value="^\s*assert[\s ].*$"/>
375             # These arguments are to uncomment lines beginning with            <param name="pattern"     value="assert"/>
376             # "//@" so that javadoc can see imports that are needed            <param name="replacement" value="//assert"/>
            # to resolve links but that shouldn't be in the compiled  
            # code.  
            -->  
           <param name="matching" value="^//@.*$"/>  
           <param name="pattern" value="^//@"/>  
           <param name="replacement" value=""/>  
377          </filterreader>          </filterreader>
378    
379            <filterreader classname="jsr166.ant.filters.ReplaceFilter"
380                          classpath="${build.ant.dir}">
381              <param name="matching"    value="^([^*]*(class|interface|implements) .*|)\{.*$"/>
382              <param name="pattern"     value="$"/>
383              <param name="replacement" value=" ${generic.declarations}"/>
384            </filterreader>
385    
386        </filterchain>        </filterchain>
387      </copy>      </copy>
388    
# Line 442  ant [target], where target is one of: Line 394  ant [target], where target is one of:
394    
395      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
396    
397        <javac srcdir="${tck.src.dir}"
398              destdir="${build.testcases.dir}"
399                debug="${build.debug}"
400           debuglevel="${build.debuglevel}"
401          deprecation="${build.deprecation}"
402               source="${build.sourcelevel}"
403                 fork="true">
404    
405          <compilerarg value="${bootclasspath.args}"/>
406          <compilerarg line="${build.args}"/>
407    
408          <classpath refid="test.classpath"/>
409    
410        </javac>
411    
412      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
413            destdir="${build.testcases.dir}"            destdir="${build.testcases.dir}"
414              debug="${build.debug}"              debug="${build.debug}"
# Line 450  ant [target], where target is one of: Line 417  ant [target], where target is one of:
417             source="${build.sourcelevel}"             source="${build.sourcelevel}"
418               fork="true">               fork="true">
419    
420        <bootclasspath refid="javac.bootclasspath"/>        <include name="jsr166/test/**"/>
421        <compilerarg line="${javac.args} ${build.warnings.option}"/>  
422          <compilerarg value="${bootclasspath.args}"/>
423          <compilerarg line="${build.args}"/>
424    
425        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
426    
427      </javac>      </javac>
428    
429    <!--
430        <javac srcdir="${jtreg.src.dir}"
431              destdir="${build.testcases.dir}"
432                debug="${build.debug}"
433           debuglevel="${build.debuglevel}"
434          deprecation="${build.deprecation}"
435               source="${build.sourcelevel}"
436                 fork="true">
437    
438          <compilerarg value="${bootclasspath.args}"/>
439          <compilerarg line="${build.args}"/>
440    
441          <classpath refid="test.classpath"/>
442    
443        </javac>
444    -->
445    
446    </target>    </target>
447    
448    
# Line 474  ant [target], where target is one of: Line 461  ant [target], where target is one of:
461                      dir="${build.reports.dir}"                      dir="${build.reports.dir}"
462                     fork="true">                     fork="true">
463    
464        <jvmarg value="${test.javac.args}"/>        <jvmarg value="${bootclasspath.args}"/>
465          <jvmarg value="-server"/>
466          <jvmarg value="-showversion"/>
467    
468          <classpath refid="test.classpath"/>
469    
470        <formatter type="xml"/>        <formatter type="xml"/>
471    
472        <batchtest todir="${build.reports.dir}">        <batchtest todir="${build.reports.dir}" unless="no.test.tck">
473            <fileset dir="${tck.src.dir}">
474              <include name="**/${testcase}Test.java"/>
475            </fileset>
476          </batchtest>
477    
478          <batchtest todir="${build.reports.dir}" if="do.test.old">
479          <fileset dir="${test.src.dir}">          <fileset dir="${test.src.dir}">
480              <include name="jsr166/test/**/${testcase}Test.java"/>
481            </fileset>
482          </batchtest>
483    
484    <!--
485          <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
486            <fileset dir="${jtreg.src.dir}">
487            <include name="**/${testcase}Test.java"/>            <include name="**/${testcase}Test.java"/>
488          </fileset>          </fileset>
489        </batchtest>        </batchtest>
490    -->
491    
492      </junit>      </junit>
493    
# Line 492  ant [target], where target is one of: Line 497  ant [target], where target is one of:
497    <target name="report-tests"    <target name="report-tests"
498            depends="run-tests">            depends="run-tests">
499    
500      <!-- Sets junit.report.format to frames if Xalan is present,      <!-- Sets junit.report.format to frames if redirection is present,
501           otherwise sets it to noframes. -->           otherwise sets it to noframes. -->
502      <available property="junit.report.format"      <available property="junit.report.format"
503                    value="frames"                    value="frames"
# Line 515  ant [target], where target is one of: Line 520  ant [target], where target is one of:
520    </target>    </target>
521    
522    
523    <target name="check-junit">    <target name="configure-compiler">
524    
525        <property name="unchecked.option" value="-Xlint:unchecked"/>
526    
527        <condition property="warnunchecked.arg" value="${unchecked.option}">
528          <istrue value="${build.warnunchecked}"/>
529        </condition>
530    
531        <property name="warnunchecked.arg" value=""/>
532    
533    
534        <!-- Common options in javac invocations -->
535        <property name="build.args" value="${warnunchecked.arg}"/>
536    
537      </target>
538    
539    
540      <target name="configure-tests"
541           depends="configure-compiler">
542    
543      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
544      <available property="junit.available"      <available property="junit.available"
545                 classname="junit.framework.Protectable"/>                 classname="junit.framework.Protectable"/>
546    
547        <!-- Xalan -->
548        <available property="xalan.available"
549                   classname="org.apache.xalan.Version"/>
550    
551    
552        <!-- Ant 1.6beta and later don't need or want this check -->
553        <!--
554      <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"      <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
555            unless="junit.available"/>            unless="junit.available"/>
556    
557        <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
558              unless="xalan.available"/>
559        -->
560    
561    </target>    </target>
562    
563    
564    
565    <!-- Anthill targets -->    <!-- Anthill targets -->
566    
567    <target name="anthill-build"    <target name="anthill-build">
568    
569        <!-- Override this in user.properties -->
570        <property name="tiger.home" location="e:/j2sdk1.5.0"/>
571    
572        <exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java">
573          <arg value="-Xmx256000000"/>
574          <!-- classpath of new JVM -->
575          <arg value="-classpath"/> <arg path="${java.class.path}"/>
576          <!-- location of Ant home directory -->
577          <arg value="-Dant.home=${ant.home}"/>
578          <!-- the Ant main class -->
579          <arg value="org.apache.tools.ant.Main"/>
580          <!-- The build file -->
581          <arg value="-buildfile"/>  <arg value="build.xml"/>
582          <!-- the target to build on the new Ant instance -->
583          <arg value="-DJAVA_HOME=${tiger.home}"/>
584          <arg value="do-anthill-build"/>
585        </exec>
586      </target>
587    
588      <target name="do-anthill-build"
589            depends="jar, test, docs, dist-docs"/>            depends="jar, test, docs, dist-docs"/>
590    
591    <target name="anthill-publish">    <target name="anthill-publish">
# Line 553  ant [target], where target is one of: Line 608  ant [target], where target is one of:
608    </target>    </target>
609    
610    
611    
612      <!-- Various demos and test programs -->
613    
614    
615      <target name="sample" depends="init, configure-compiler"
616              description="Standalone demo program">
617    
618        <mkdir dir="${build.testcases.dir}"/>
619    
620        <javac srcdir="${test.src.dir}"
621              destdir="${build.testcases.dir}"
622                debug="${build.debug}"
623           debuglevel="${build.debuglevel}"
624          deprecation="${build.deprecation}"
625               source="${build.sourcelevel}"
626                 fork="true">
627    
628          <include name="jsr166/test/Sample.java"/>
629    
630        </javac>
631    
632        <copy todir="${build.testcases.dir}">
633          <fileset dir="${test.src.dir}">
634            <include name="**/*.properties"/>
635          </fileset>
636        </copy>
637    
638    
639        <java classname="jsr166.test.Sample" fork="true">
640          <classpath refid="test.classpath"/>
641          <!-- <jvmarg value="-ea"/> -->
642          <!-- <jvmarg value="-server"/> -->
643          <!-- <arg value="1000"/> -->
644        </java>
645      </target>
646    
647    
648      <target name="loops" depends="init, configure-compiler"
649              description="Benchmark from Doug Lea's AQS paper">
650    
651        <mkdir dir="${build.loops.dir}"/>
652    
653        <javac srcdir="${loops.src.dir}"
654              destdir="${build.loops.dir}"
655                debug="${build.debug}"
656           debuglevel="${build.debuglevel}"
657          deprecation="${build.deprecation}"
658               source="${build.sourcelevel}"
659                 fork="true">
660    
661          <compilerarg line="${build.args}"/>
662          <classpath refid="loops.classpath"/>
663    
664        </javac>
665    
666        <java classname="ALoops" fork="true">
667          <classpath refid="loops.classpath"/>
668        </java>
669    
670      </target>
671    
672    
673      <target name="compile-j1" depends="init, configure-compiler">
674    
675        <mkdir dir="${build.j1.dir}"/>
676    
677        <javac srcdir="${j1.src.dir}"
678              destdir="${build.j1.dir}"
679                debug="${build.debug}"
680           debuglevel="${build.debuglevel}"
681          deprecation="${build.deprecation}"
682               source="${build.sourcelevel}" >
683    
684          <include name="**/*.java"/>
685          <exclude name="**/dijkstra/**"/>
686    
687          <compilerarg line="${build.args}"/>
688          <classpath refid="j1.classpath"/>
689    
690        </javac>
691    
692      </target>
693    
694    
695      <target name="sw" depends="compile-j1"
696              description="Runs the SwingWorker demo">
697    
698        <!--
699        <java classname="jsr166.swing.SwingWorkerDemo" fork="true">
700          <classpath refid="j1.classpath"/>
701        </java>
702        -->
703    
704        <copy todir="${build.j1.dir}" file="${j1.src.dir}/jsr166/swing/SwingWorker.html"/>
705    
706        <exec dir="${build.j1.dir}" executable="appletviewer.exe">
707          <arg value="${build.j1.dir}/SwingWorker.html"/>
708        </exec>
709    
710      </target>
711    
712      <target name="j1" depends="compile-j1"
713              description="Runs a standalone JavaOne program">
714    
715        <java classname="jsr166.random.TestRandom" fork="true">
716          <classpath refid="j1.classpath"/>
717          <jvmarg value="-client"/>
718        </java>
719    
720      </target>
721    
722    
723      <target name="test-j1" depends="compile-j1"
724              description="Runs testcases from the JavaOne source directories">
725    
726        <junit printsummary="true"
727                 showoutput="true"
728              errorProperty="junit.failed"
729            failureProperty="junit.failed"
730                        dir="${build.j1.dir}"
731                       fork="true">
732    
733          <!-- <jvmarg value="-server"/> -->
734          <classpath refid="j1.classpath"/>
735          <formatter type="xml"/>
736    
737          <batchtest todir="${build.j1.dir}">
738            <fileset dir="${j1.src.dir}">
739              <include name="**/*Test.java"/>
740            </fileset>
741          </batchtest>
742    
743        </junit>
744    
745        <available property="junit.report.format"
746                      value="frames"
747                  classname="org.apache.xalan.lib.Redirect"/>
748        <property name="junit.report.format" value="noframes"/>
749    
750        <junitreport todir="${build.j1.dir}">
751          <fileset dir="${build.j1.dir}">
752            <include name="TEST-*.xml"/>
753          </fileset>
754          <report styledir="${stylesheet.dir}"
755                    format="${junit.report.format}"
756                     todir="${build.j1.dir}"
757          />
758        </junitreport>
759    
760        <fail message="Test Cases Failed" if="junit.failed"/>
761    
762      </target>
763    
764    
765    
766      <!-- C++ and JNI definitions and demos -->
767    
768      <target name="configure-cpp">
769    
770        <!-- Define tasks and types -->
771    
772        <path id="cpptasks.path">
773          <pathelement location="${lib.dir}/cpptasks.jar"/>
774        </path>
775        <taskdef resource="cpptasks.tasks" classpathref="cpptasks.path"/>
776        <typedef resource="cpptasks.types" classpathref="cpptasks.path"/>
777    
778        <!-- Set platform property for JNI includes -->
779    
780        <condition property="platform" value="linux">
781          <os name="Linux"/>
782        </condition>
783        <condition property="platform" value="win32">
784          <os family="windows"/>
785        </condition>
786        <condition property="platform" value="solaris">
787          <os name="SunOS"/>
788        </condition>
789    
790      </target>
791    
792    
793      <target name="cppdemo" depends="configure-cpp">
794    
795        <mkdir dir="${build.dir}"/>
796    
797        <cc multithreaded="true"
798                     name="g++"
799                   objdir="${build.dir}"
800                  outfile="${build.dir}/CppDemo">
801          <fileset dir="${test.src.dir}" includes="CppDemo.cpp"/>
802          <libset libs="stdc++"/>
803        </cc>
804    
805        <exec executable="${build.dir}/CppDemo">
806          <arg line="count in word frequency of word in command line count"/>
807        </exec>
808    
809      </target>
810    
811    
812      <target name="jnidemo" depends="init, configure-compiler, configure-cpp">
813    
814        <mkdir dir="${build.testcases.dir}"/>
815    
816        <javac srcdir="${test.src.dir}"
817              destdir="${build.testcases.dir}"
818                debug="${build.debug}"
819           debuglevel="${build.debuglevel}"
820          deprecation="${build.deprecation}"
821               source="${build.sourcelevel}"
822                 fork="true">
823          <compilerarg value="${bootclasspath.args}"/>
824          <compilerarg line="${build.args}"/>
825          <classpath refid="test.classpath"/>
826          <include name="JniDemo.java"/>
827        </javac>
828    
829        <javah destdir="${build.testcases.dir}"
830          classpathref="test.classpath">
831          <class name="JniDemo"/>
832        </javah>
833    
834        <cc multithreaded="true"
835                     name="g++"
836                   objdir="${build.dir}"
837                  outfile="${build.dir}/JniDemo"
838                  outtype="shared">
839    
840          <compiler>
841            <defineset>
842              <define name="__int64" value="long long"/>
843            </defineset>
844            <includepath location="${java.home}/../include"/>
845            <includepath location="${java.home}/../include/${platform}"/>
846            <compilerarg value="-mno-cygwin"/>
847          </compiler>
848    
849          <linker>
850            <linkerarg value="--add-stdcall-alias"/>
851          </linker>
852    
853          <includepath location="${build.testcases.dir}"/>
854    
855          <fileset dir="${test.src.dir}" includes="JniDemo.cpp"/>
856    
857          <libset libs="stdc++"/>
858    
859        </cc>
860    
861        <!-- Necessary if windows, harmless if not -->
862        <copy file="${build.dir}/libJniDemo.so" tofile="${build.dir}/JniDemo.dll"/>
863    
864        <java classname="JniDemo" fork="true">
865          <!-- Watch out: path separator hardwired to semicolon here! -->
866          <sysproperty key="java.library.path" path="${java.library.path};${build.dir}"/>
867          <classpath refid="test.classpath"/>
868          <arg line="count in word frequency of word in command line count"/>
869        </java>
870    
871      </target>
872    
873    
874    
875      <!-- Backward compatibility, work in progress (some files not checked in) -->
876    
877    
878    
879      <property name="pretiger.src.dir"     location="${build.dir}/pretiger/src"/>
880      <property name="build.pretiger.dir"   location="${build.dir}/pretiger/classes"/>
881      <property name="pretiger.jar"         location="${build.lib.dir}/jsr166-pretiger.jar"/>
882      <property name="pretiger.sourcelevel" value="1.4"/>
883    
884      <target name="defang"
885           depends="init"
886       description="Generates pre-Tiger compatible source">
887    
888        <delete dir="${pretiger.src.dir}"/>
889        <mkdir dir="${pretiger.src.dir}"/>
890    
891        <exec executable="perl">
892          <arg file="etc/defang.pl"/>
893          <!-- <arg value="-v"/> -->
894          <arg value="-s"/> <arg file="${src.dir}"/>
895          <arg value="-t"/> <arg file="${pretiger.src.dir}"/>
896        </exec>
897    
898      </target>
899    
900      <target name="compile-pretiger"
901              depends="init, configure-compiler, defang"
902              description="Compiles pre-Tiger sources to build folder">
903    
904        <mkdir dir="${build.pretiger.dir}"/>
905    
906        <javac srcdir="${pretiger.src.dir}"
907              destdir="${build.pretiger.dir}"
908                debug="${build.debug}"
909           debuglevel="${build.debuglevel}"
910          deprecation="${build.deprecation}"
911               source="${pretiger.sourcelevel}"
912                 fork="true">
913    
914          <compilerarg line="${build.args}"/>
915          <exclude name="**/Thread.java"/>
916    
917        </javac>
918    
919      </target>
920    
921      <target name="pretiger" depends="compile-pretiger">
922    
923        <mkdir dir="${build.lib.dir}"/>
924    
925        <jar destfile="${pretiger.jar}">
926          <fileset dir="${build.pretiger.dir}">
927          </fileset>
928        </jar>
929    
930      </target>
931    
932  </project>  </project>

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.67

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