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

Diff of /jsr166/build.xml

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

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

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.89

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