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

Diff of /jsr166/build.xml

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

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

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.88

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