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

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

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