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

Diff of /jsr166/build.xml

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

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

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

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