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

Diff of /jsr166/build.xml

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

revision 1.47 by tim, Fri Aug 1 19:34:05 2003 UTC revision 1.86 by jsr166, Sat May 28 02:19: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">  
138    
139      <delete dir="${build.doccheck.dir}"/>    <target name="test"
140      <mkdir dir="${build.doccheck.dir}"/>            depends="init, configure-tests, report-tests"
141              description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
     <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"  
          docletpath="${lib.dir}/doccheck.jar"  
             destdir="${build.doccheck.dir}">  
       <packageset dir="${build.filter.doccheck.dir}"/>  
     </javadoc>  
142    
   </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}"      <javadoc destdir="${build.javadocs.dir}"
152                  link="http://java.sun.com/j2se/1.4.1/docs/api"                  link="http://download.oracle.com/javase/6/docs/api/"
153              overview="${src.dir}/intro.html"              overview="${src.dir}/intro.html"
154                source="${build.docsourcelevel}">              sourcepath="${src.dir}:${jdksrc.dir}"
155        >
       <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:"/>  
156    
157        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${src.dir}"/>
158    
159      </javadoc>      </javadoc>
160    
161    </target>    </target>
162    
163    
   <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>  
   
164    
165    <target name="dist"    <target name="dist"
166            depends="init, dist-clean, dist-jar, dist-docs"            depends="init, dist-clean, dist-jar, dist-docs"
167            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
168    
169    
170    <target name="release"    <target name="release"
171            depends="dist"            depends="dist"
172            description="Puts entire CVS tree, plus distribution productions, in a jar">            description="Puts entire CVS tree, plus distribution productions, in a jar">
173    
 <!--  
     #keep build dir? - dl  
     <delete dir="${build.dir}"/>  
 -->  
174      <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>      <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
175    
176      <jar basedir="${basedir}" destfile="${release.jar}">      <jar basedir="${basedir}" destfile="${release.jar}">
177          <!-- <exclude name="build/**"/> -->
178        <exclude name="${release.jar}"/>        <exclude name="${release.jar}"/>
179        <exclude name="user.properties"/>        <exclude name="user.properties"/>
180        <exclude name="etc/notes/**"/>        <exclude name="etc/notes/**"/>
181        <exclude name="lib/gjc/2.1/**"/>        <exclude name="src/emulation/**"/>
182        <exclude name="**/SyntaxTest.java"/>        <exclude name="**/SyntaxTest.java"/>
183          <exclude name="**/SuperfluousAbstract.java"/>
184      </jar>      </jar>
185    
186    </target>    </target>
187    
188    
189    
190    <target name="clean"    <target name="clean"
191            description="Removes all build products">            description="Removes all build products">
192    
# Line 233  Line 197 
197    </target>    </target>
198    
199    
200    
201    <target name="dist-clean"    <target name="dist-clean"
202            description="Removes all build and distribution products">            description="Removes all build and distribution products">
203    
# Line 241  Line 206 
206    </target>    </target>
207    
208    
209    
210    <target name="dist-docs"    <target name="dist-docs"
           depends="filter-src"  
211            description="Builds javadocs without custom tags to dist folder">            description="Builds javadocs without custom tags to dist folder">
212    
213      <delete dir="${dist.javadocs.dir}"/>      <delete dir="${dist.javadocs.dir}"/>
214      <mkdir dir="${dist.javadocs.dir}"/>      <mkdir dir="${dist.javadocs.dir}"/>
215    
216      <javadoc destdir="${dist.javadocs.dir}"      <!-- the packagenames="none" hack below prevents scanning the -->
217                  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}"/>  
218    
219        <javadoc destdir="${dist.javadocs.dir}"
220                 packagenames="none"
221                 link="http://download.oracle.com/javase/6/docs/api/"
222                 overview="${src.dir}/intro.html"
223                 sourcepath="${src.dir}:${jdksrc.dir}" >
224          <fileset dir="${src.dir}" defaultexcludes="yes">
225          <include name="**/*.java"/>
226          </fileset>
227      </javadoc>      </javadoc>
228    
229    </target>    </target>
# Line 269  Line 238 
238      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
239      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
240      <echo>Building JSR-166 version ${version}</echo>      <echo>Building JSR-166 version ${version}</echo>
241        <echo>java.home is ${java.home}</echo>
242    
243    </target>    </target>
244    
245    
246    <target name="init-jar">    <target name="dist-jar"
247              depends="clean, jar">
248    
249      <mkdir dir="${build.lib.dir}"/>      <copy file="${product.jar}" todir="${dist.dir}"/>
250    
251    </target>    </target>
252    
253    
254    <target name="native-jar"    <target name="compile-tests"
255            depends="compile"            depends="jar">
           unless="build.emulation.true">  
256    
257      <jar destfile="${product.jar}">      <mkdir dir="${build.testcases.dir}"/>
       <fileset dir="${build.classes.dir}"/>  
     </jar>  
258    
259    </target>      <javac srcdir="${tck.src.dir}"
260              destdir="${build.testcases.dir}"
261                debug="${build.debug}"
262           debuglevel="${build.debuglevel}"
263          deprecation="${build.deprecation}"
264               source="${build.sourcelevel}"
265                 fork="true">
266    
267          <compilerarg value="${bootclasspath.args}"/>
268          <compilerarg line="${build.args}"/>
269          <compilerarg value="-XDignore.symbol.file=true"/>
270    
271    <target name="compile-emulation"        <classpath refid="test.classpath"/>
           depends="init, configure-compiler"  
           if="build.emulation.true">  
272    
273      <mkdir dir="${build.emulation.dir}"/>      </javac>
274    
275      <javac srcdir="${emulation.src.dir}"      <javac srcdir="${test.src.dir}"
276            destdir="${build.emulation.dir}"            destdir="${build.testcases.dir}"
277              debug="${build.debug}"              debug="${build.debug}"
278         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
279        deprecation="${build.deprecation}"        deprecation="${build.deprecation}"
280             source="${build.sourcelevel}"             source="${build.sourcelevel}"
281               fork="true">               fork="true">
282    
283        <compilerarg    line="${gjc.args}"/>        <include name="jsr166/test/**"/>
284        <bootclasspath refid="compile.bootclasspath"/>  
285          <compilerarg value="${bootclasspath.args}"/>
286          <compilerarg line="${build.args}"/>
287          <compilerarg value="-XDignore.symbol.file=true"/>
288    
289          <classpath refid="test.classpath"/>
290    
291      </javac>      </javac>
292    
293    <!--
294        <javac srcdir="${jtreg.src.dir}"
295              destdir="${build.testcases.dir}"
296                debug="${build.debug}"
297           debuglevel="${build.debuglevel}"
298          deprecation="${build.deprecation}"
299               source="${build.sourcelevel}"
300                 fork="true">
301    
302          <compilerarg value="${bootclasspath.args}"/>
303          <compilerarg line="${build.args}"/>
304          <compilerarg value="-XDignore.symbol.file=true"/>
305    
306          <classpath refid="test.classpath"/>
307    
308        </javac>
309    -->
310    
311    </target>    </target>
312    
313    
314    <target name="emulation-jar"    <target name="run-tests"
315            depends="compile-emulation"            depends="compile-tests">
           if="build.emulation.true">  
316    
317        <!-- May be overridden by user.properties -->
318        <property name="testcase" value="*"/>
319    
320      <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>  
321    
322    </target>      <junit printsummary="true"
323                 showoutput="true"
324              errorProperty="junit.failed"
325            failureProperty="junit.failed"
326                        dir="${build.reports.dir}"
327                       fork="true">
328    
329          <jvmarg value="${bootclasspath.args}"/>
330          <jvmarg value="-server"/>
331          <jvmarg value="-showversion"/>
332    
333    <target name="dist-jar"        <classpath refid="test.classpath"/>
           depends="clean, jar">  
334    
335      <copy file="${product.jar}" todir="${dist.dir}"/>        <formatter type="xml"/>
336    
337    </target>        <batchtest todir="${build.reports.dir}" unless="no.test.tck">
338            <fileset dir="${tck.src.dir}">
339              <include name="**/${testcase}Test.java"/>
340            </fileset>
341          </batchtest>
342    
343          <batchtest todir="${build.reports.dir}" if="do.test.old">
344            <fileset dir="${test.src.dir}">
345              <include name="jsr166/test/**/${testcase}Test.java"/>
346            </fileset>
347          </batchtest>
348    
349    <!--
350          <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
351            <fileset dir="${jtreg.src.dir}">
352              <include name="**/${testcase}Test.java"/>
353            </fileset>
354          </batchtest>
355    -->
356    
357        </junit>
358    
359      </target>
360    
   <target name="compile-ant-filter"  
           depends="init">  
361    
362      <mkdir dir="${build.ant.dir}"/>    <target name="report-tests"
363              depends="run-tests">
364    
365      <javac srcdir="${ant.src.dir}"      <!-- Sets junit.report.format to frames if redirection is present,
366            destdir="${build.ant.dir}"           otherwise sets it to noframes. -->
367             source="1.4"      <available property="junit.report.format"
368                      value="frames"
369                  classname="org.apache.xalan.lib.Redirect"
370      />      />
371        <property name="junit.report.format" value="noframes"/>
372    
373        <junitreport todir="${build.reports.dir}">
374          <fileset dir="${build.reports.dir}">
375            <include name="TEST-*.xml"/>
376          </fileset>
377          <report format="${junit.report.format}" todir="${build.reports.dir}"
378          />
379        </junitreport>
380    
381        <fail message="Test Cases Failed" if="junit.failed"/>
382    
383    </target>    </target>
384    
385    
386    <target name="filter-src"    <target name="configure-compiler">
           depends="compile-ant-filter">  
387    
388      <mkdir dir="${build.filter.src.dir}"/>      <property name="unchecked.option" value="-Xlint:unchecked"/>
389    
390      <copy todir="${build.filter.src.dir}">      <condition property="warnunchecked.arg" value="${unchecked.option}">
391        <fileset dir="${src.dir}">        <istrue value="${build.warnunchecked}"/>
392          <include name="**/*.html"/>      </condition>
       </fileset>  
     </copy>  
393    
394      <copy todir="${build.filter.src.dir}">      <property name="warnunchecked.arg" value=""/>
395        <fileset dir="${src.dir}">  
396          <exclude name="**/*.html"/>  
397          <patternset refid="unsafe.exclusion"/>      <!-- Common options in javac invocations -->
398        </fileset>      <property name="build.args" value="${warnunchecked.arg}"/>
399        <filterchain>  
400      </target>
401    
402    
403      <target name="configure-tests"
404           depends="configure-compiler">
405    
406          <!--      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
407           # This filter gets rid of angle-bracketed type parameters      <available property="junit.available"
408           # so that javadoc can run on the result. The following                 classname="junit.framework.Protectable"/>
          # 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.)  
          -->  
409    
410          <filterreader classname="jsr166.ant.filters.ReplaceFilter"      <!-- Xalan -->
411                        classpath="${build.ant.dir}">      <available property="xalan.available"
412            <param name="notmatching" value="^\s+\*\s.*$"/>                 classname="org.apache.xalan.Version"/>
           <param name="pattern"     value="&lt;[^|>()]+?>+"/>  
           <param name="replacement" value=" "/>  
         </filterreader>  
413    
414    
415          <!--      <!-- Ant 1.6beta and later don't need or want this check -->
416           # This filter uncomments lines beginning with "//@" so that      <!--
417           # javadoc can see imports that are needed to resolve links      <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
418           # but that shouldn't be in the compiled code.            unless="junit.available"/>
          -->  
419    
420          <filterreader classname="jsr166.ant.filters.ReplaceFilter"      <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
421                        classpath="${build.ant.dir}">            unless="xalan.available"/>
422            <param name="matching"    value="^//@.*$"/>      -->
           <param name="pattern"     value="^//@"/>  
           <param name="replacement" value=""/>  
         </filterreader>  
       </filterchain>  
     </copy>  
423    
424    </target>    </target>
425    
426    
427      <!-- Various demos and test programs -->
428    
429    
430    <target name="filter-doccheck"    <target name="loops" depends="init, configure-compiler"
431            depends="filter-src">            description="Benchmark from Doug Lea's AQS paper">
432    
433      <mkdir dir="${build.filter.doccheck.dir}"/>      <mkdir dir="${build.loops.dir}"/>
434    
435      <copy todir="${build.filter.doccheck.dir}">      <javac srcdir="${loops.src.dir}"
436        <fileset dir="${build.filter.src.dir}">            destdir="${build.loops.dir}"
437          <include name="**/*.html"/>              debug="${build.debug}"
438        </fileset>         debuglevel="${build.debuglevel}"
439      </copy>        deprecation="${build.deprecation}"
440               source="${build.sourcelevel}"
441                 fork="true">
442    
443      <property name="generic.declarations"        <compilerarg line="${build.args}"/>
444               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"/>
445      />        <compilerarg value="-XDignore.symbol.file=true"/>
446    
447      <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>  
448    
449        </filterchain>      <java classname="ALoops" fork="true">
450      </copy>        <classpath refid="loops.classpath"/>
451        </java>
452    
453    </target>    </target>
454    
455    
456    <target name="compile-tests"    <!-- jsr166x -->
           depends="jar">  
457    
     <mkdir dir="${build.testcases.dir}"/>  
458    
459  <!--    <target name="jsr166xcompile"
460      <echo>javac ${gjc.args}</echo>            depends="init, configure-compiler"
461      <echo>bootclasspath=${test.compile.bootclasspath}</echo>            description="Compiles jsr166x sources">
     <echo>classpath="${test.classpath}"</echo>  
 -->  
462    
463      <javac srcdir="${test.src.dir}"      <mkdir dir="${build.jsr166x.dir}"/>
464            destdir="${build.testcases.dir}"  
465        <javac srcdir="${jsr166xsrc.dir}"
466              destdir="${build.jsr166x.dir}"
467              debug="${build.debug}"              debug="${build.debug}"
468         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
469        deprecation="${build.deprecation}"        deprecation="${build.deprecation}"
470             source="${build.sourcelevel}"             source="${build.sourcelevel}"
471               fork="true">               fork="true">
472    
473        <compilerarg    line="${gjc.args}"/>        <include name="**/*.java"/>
474        <bootclasspath refid="test.compile.bootclasspath"/>        <compilerarg line="${build.args}"/>
475        <classpath     refid="test.classpath"/>        <compilerarg value="-XDignore.symbol.file=true"/>
476    
477      </javac>      </javac>
478    
479    </target>    </target>
480    
481    
   <target name="run-tests"  
           depends="compile-tests">  
482    
483      <!-- May be overridden by user.properties -->    <target name="jsr166xjar"
484      <property name="testcase" value="*"/>            depends="jsr166xcompile"
485              description="Builds library jar from compiled sources">
486    
487      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.jsr166xlib.dir}"/>
488    
489      <junit printsummary="true"      <jar destfile="${jsr166xproduct.jar}">
490               showoutput="true"        <fileset dir="${build.jsr166x.dir}"/>
491            errorProperty="junit.failed"      </jar>
         failureProperty="junit.failed"  
                     dir="${build.reports.dir}"  
                    fork="true">  
492    
493        <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>    </target>
494    
       <formatter type="xml"/>  
495    
       <batchtest todir="${build.reports.dir}">  
         <fileset dir="${test.src.dir}">  
           <include name="**/${testcase}Test.java"/>  
         </fileset>  
       </batchtest>  
496    
497      </junit>    <target name="jsr166xdocs"
498              description="Builds javadocs with custom tags to build folder">
499    
500        <delete dir="${build.jsr166xjavadocs.dir}"/>
501        <mkdir dir="${build.jsr166xjavadocs.dir}"/>
502    
503        <javadoc destdir="${build.jsr166xjavadocs.dir}"
504                 packagenames="jsr166x"
505                 link="http://download.oracle.com/javase/6/docs/api/"
506                 source="${build.sourcelevel}"
507                 sourcepath="${topsrc.dir}:${jdksrc.dir}" />
508    
509    </target>    </target>
510    
511    
512    <target name="report-tests"    <target name="jsr166xdist"
513            depends="run-tests">            depends="jsr166xdist-clean, jsr166xdist-jar, jsr166xdist-docs"
514              description="Puts all distributable products in single hierarchy"/>
515    
     <!-- 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"/>  
516    
     <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>  
517    
518      <fail message="Test Cases Failed" if="junit.failed"/>    <target name="jsr166xclean"
519              description="Removes all build products">
520    
521        <delete dir="${build.jsr166x.dir}"/>
522        <delete dir="${build.jsr166xlib.dir}"/>
523    
524    </target>    </target>
525    
526    
   <target name="configure-compiler">  
527    
528      <property name="gjc.version"    <target name="jsr166xdist-clean"
529               value="2.2"/>            description="Removes all build and distribution products">
530    
531      <condition property="novariance.arg" value="-novariance">    </target>
       <and>  
         <equals arg1="${gjc.version}" arg2="2.0"/>  
         <or>  
           <not><isset property="gjc.novariance"/></not>  
           <istrue value="${gjc.novariance}"/>  
         </or>  
       </and>  
     </condition>  
532    
     <property name="novariance.arg"  
              value=""/>  
533    
     <property name="gjc.dir"  
              value="${lib.dir}/gjc"/>  
534    
535      <property name="javac.jar"    <target name="jsr166xdist-docs"
536            location="${gjc.dir}/${gjc.version}/javac.jar"/>            description="Builds javadocs without custom tags to dist folder">
537    
538      <property name="collect.jar"      <delete dir="${dist.jsr166xjavadocs.dir}"/>
539            location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>      <mkdir dir="${dist.jsr166xjavadocs.dir}"/>
540    
541        <javadoc destdir="${dist.jsr166xjavadocs.dir}"
542                 packagenames="jsr166x"
543                 link="http://download.oracle.com/javase/6/docs/api/"
544                 source="${build.sourcelevel}"
545                 sourcepath="${topsrc.dir}:${jdksrc.dir}" />
546    
547      <condition property="warnunchecked.arg" value="-warnunchecked">    </target>
       <istrue value="${gjc.warnunchecked}"/>  
     </condition>  
548    
549      <property name="warnunchecked.arg" value=""/>    <target name="jsr166xdist-jar"
550              depends="jsr166xclean, jsr166xjar">
551    
552      <condition property="prepare.src.dir" value="${build.dir}/prepare-src">      <copy file="${jsr166xproduct.jar}" todir="${dist.dir}"/>
       <istrue value="${build.nothreads}"/>  
     </condition>  
553    
554      </target>
555    
556      <!--    <!-- jsr166y -->
      ! Bootclasspath munging for source compilation.  
      -->  
557    
     <path id="pre.bootclasspath">  
       <pathelement location="${javac.jar}"/>  
     </path>  
   
     <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"/>  
558    
559      <target name="jsr166ycompile"
560              depends="init, configure-compiler"
561              description="Compiles jsr166y sources">
562    
563      <!-- Common options in javac invocations -->      <mkdir dir="${build.jsr166y.dir}"/>
564      <property name="gjc.args"  
565               value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"      <javac srcdir="${jsr166ysrc.dir}"
566      />            destdir="${build.jsr166y.dir}"
567                debug="${build.debug}"
568           debuglevel="${build.debuglevel}"
569          deprecation="${build.deprecation}"
570               source="${build.sourcelevel}"
571                 fork="true">
572    
573          <include name="**/*.java"/>
574          <compilerarg line="${build.args}"/>
575          <compilerarg value="-XDignore.symbol.file=true"/>
576          <compilerarg value="${bootclasspath.args}"/>
577    
578    <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
579    
580        </javac>
581    
582    </target>    </target>
583    
584    
585    <target name="prepare-src"  
586            depends="configure-compiler"    <target name="jsr166yjar"
587            if="prepare.src.dir">            depends="jsr166ycompile"
588              description="Builds library jar from compiled sources">
589      <mkdir dir="${prepare.src.dir}"/>  
590      <copy todir="${prepare.src.dir}">      <mkdir dir="${build.jsr166ylib.dir}"/>
591        <fileset dir="${src.dir}">  
592          <exclude name="java/lang/**"/>      <jar destfile="${jsr166yproduct.jar}" index="true">
593        </fileset>        <fileset dir="${build.jsr166y.dir}"/>
594      </copy>      </jar>
595    
596    </target>    </target>
597    
598    
   <target name="configure-emulation">  
599    
600      <condition property="build.emulation.true">    <target name="jsr166ydocs"
601        <or>            description="Builds javadocs with custom tags to build folder">
602          <and>  
603            <os family="windows"/>      <delete dir="${build.jsr166yjavadocs.dir}"/>
604            <not>      <mkdir dir="${build.jsr166yjavadocs.dir}"/>
605              <isset property="build.emulation"/>  
606            </not>      <javadoc destdir="${build.jsr166yjavadocs.dir}"
607          </and>               packagenames="jsr166y"
608          <istrue value="${build.emulation}"/>               link="http://download.oracle.com/javase/6/docs/api/"
609        </or>               source="${build.sourcelevel}"
610      </condition>               sourcepath="${topsrc.dir}:${jdksrc.dir}" />
611    
612    </target>    </target>
613    
614    
615    <target name="configure-tests"    <target name="jsr166ydist"
616         depends="configure-compiler">            depends="jsr166ydist-clean, jsr166ydist-jar, jsr166ydist-docs"
617              description="Puts all distributable products in single hierarchy"/>
618    
     <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->  
     <available property="junit.available"  
                classname="junit.framework.Protectable"/>  
619    
620      <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"  
621            unless="junit.available"/>    <target name="jsr166yclean"
622              description="Removes all build products">
623    
624        <delete dir="${build.jsr166y.dir}"/>
625        <delete dir="${build.jsr166ylib.dir}"/>
626    
627      </target>
628    
629    
     <!--  
      ! Bootclasspath munging for testing, so JUnit can test our local  
      ! modifications to java.*.  
      -->  
630    
631      <path id="test.classpath">    <target name="jsr166ydist-clean"
632        <pathelement location="${product.jar}"/>            description="Removes all build and distribution products">
       <pathelement location="${build.testcases.dir}"/>  
       <pathelement location="${junit.jar}"/>  
     </path>  
633    
634      <path id="test.compile.bootclasspath">    </target>
       <pathelement location="${javac.jar}"/>  
       <pathelement location="${collect.jar}"/>  
       <pathelement location="${rt.jar}"/>  
     </path>  
635    
636      <path id="test.run.bootclasspath">    <target name="jsr166ydist-docs"
637        <pathelement location="${javac.jar}"/>            description="Builds javadocs without custom tags to dist folder">
       <path refid="test.classpath"/>  
     </path>  
638    
639      <!-- Flatten test classpaths into platform-appropriate strings -->      <delete dir="${dist.jsr166yjavadocs.dir}"/>
640      <property name="test.classpath"             refid="test.classpath"/>      <mkdir dir="${dist.jsr166yjavadocs.dir}"/>
641      <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>  
642      <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>      <javadoc destdir="${dist.jsr166yjavadocs.dir}"
643                 packagenames="jsr166y"
644                 link="http://download.oracle.com/javase/6/docs/api/"
645                 source="${build.sourcelevel}"
646                 sourcepath="${topsrc.dir}:${jdksrc.dir}" />
647    
648    </target>    </target>
649    
650      <target name="jsr166ydist-jar"
651              depends="jsr166yclean, jsr166yjar">
652    
653        <copy file="${jsr166yproduct.jar}" todir="${dist.dir}"/>
654    
655    <!-- Anthill targets -->    </target>
656    
657    <target name="anthill-build"    <!-- extra166y -->
           depends="jar, test, docs, dist-docs"/>  
658    
   <target name="anthill-publish">  
659    
660      <copy todir="${deployDir}/docs/private">    <target name="extra166ycompile"
661        <fileset dir="${build.javadocs.dir}"/>            depends="init, configure-compiler, jsr166ycompile"
662      </copy>            description="Compiles extra166y sources">
663    
664      <copy todir="${deployDir}/docs/public">      <mkdir dir="${build.extra166y.dir}"/>
       <fileset dir="${dist.javadocs.dir}"/>  
     </copy>  
665    
666      <copy tofile="${deployDir}/index.html"      <javac srcdir="${extra166ysrc.dir}"
667            file="${basedir}/etc/anthill-index.html"/>            destdir="${build.extra166y.dir}"
668                debug="${build.debug}"
669                classpath="${jsr166yproduct.jar}"
670           debuglevel="${build.debuglevel}"
671          deprecation="${build.deprecation}"
672               source="${build.sourcelevel}"
673                 fork="true">
674    
675      <copy todir="${deployDir}/notes">        <include name="**/*.java"/>
676        <fileset dir="${basedir}/etc/notes"/>        <compilerarg line="${build.args}"/>
677      </copy>        <compilerarg value="-XDignore.symbol.file=true"/>
678          <compilerarg value="${bootclasspath.args}"/>
679    
680    <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
681    
682        </javac>
683    
684    </target>    </target>
685    
686    
   <target name="ng" depends="test">  
     <java classname="SuperfluousAbstract" fork="true">  
687    
688        <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>    <target name="extra166yjar"
689              depends="extra166ycompile"
690              description="Builds library jar from compiled sources">
691    
692        <mkdir dir="${build.extra166ylib.dir}"/>
693    
694        <jar destfile="${extra166yproduct.jar}" index="true">
695          <fileset dir="${build.extra166y.dir}"/>
696        </jar>
697    
698      </target>
699    
700    
701    
702      <target name="extra166ydocs"
703              description="Builds javadocs with custom tags to build folder">
704    
705        <delete dir="${build.extra166yjavadocs.dir}"/>
706        <mkdir dir="${build.extra166yjavadocs.dir}"/>
707    
708        <javadoc destdir="${build.extra166yjavadocs.dir}"
709                 packagenames="extra166y"
710                 link="http://download.oracle.com/javase/6/docs/api/"
711                 source="${build.sourcelevel}"
712                 sourcepath="${topsrc.dir}:${jdksrc.dir}" />
713    
714      </target>
715    
716    
717      <target name="extra166ydist"
718              depends="extra166ydist-clean, extra166ydist-jar, extra166ydist-docs"
719              description="Puts all distributable products in single hierarchy"/>
720    
721    
722    
723      <target name="extra166yclean"
724              description="Removes all build products">
725    
726        <delete dir="${build.extra166y.dir}"/>
727        <delete dir="${build.extra166ylib.dir}"/>
728    
729      </target>
730    
731    
732    
733      <target name="extra166ydist-clean"
734              description="Removes all build and distribution products">
735    
736      </target>
737    
738      <target name="extra166ydist-docs"
739              description="Builds javadocs without custom tags to dist folder">
740    
741        <delete dir="${dist.extra166yjavadocs.dir}"/>
742        <mkdir dir="${dist.extra166yjavadocs.dir}"/>
743    
744        <javadoc destdir="${dist.extra166yjavadocs.dir}"
745                 packagenames="extra166y"
746                 link="http://download.oracle.com/javase/6/docs/api/"
747                 source="${build.sourcelevel}"
748                 sourcepath="${topsrc.dir}:${jdksrc.dir}" />
749    
     </java>  
750    </target>    </target>
751    
752      <target name="extra166ydist-jar"
753              depends="extra166yclean, extra166yjar">
754    
755        <copy file="${extra166yproduct.jar}" todir="${dist.dir}"/>
756    
757      </target>
758    
759  </project>  </project>

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.86

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