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

Diff of /jsr166/build.xml

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

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

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.85

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