/[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.91 by jsr166, Sun Nov 18 06:21:11 2012 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.jsr166e.dir"           location="${build.dir}/jsr166e"/>
46      <property name="build.jsr166elib.dir"        location="${build.dir}/jsr166elib"/>
47      <property name="build.jsr166ejavadocs.dir"   location="${build.dir}/jsr166ejavadocs"/>
48    
49      <property name="build.extra166y.dir"         location="${build.dir}/extra166y"/>
50      <property name="build.extra166ylib.dir"      location="${build.dir}/extra166ylib"/>
51      <property name="build.extra166yjavadocs.dir" location="${build.dir}/extra166yjavadocs"/>
52    
53    <!-- Source locations -->    <!-- Source locations -->
54    <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"/>  
55    <property name="test.src.dir"         location="${basedir}/src/test"/>    <property name="test.src.dir"         location="${basedir}/src/test"/>
56    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="loops.src.dir"        location="${basedir}/src/loops"/>
57    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
58      <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>
59    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
60    <property name="dist.dir"             location="${basedir}/dist"/>    <property name="dist.dir"             location="${basedir}/dist"/>
61      <property name="topsrc.dir"           location="${basedir}/src"/>
62      <property name="jsr166xsrc.dir"       location="${basedir}/src/jsr166x"/>
63      <property name="jsr166ysrc.dir"       location="${basedir}/src/jsr166y"/>
64      <property name="jsr166esrc.dir"       location="${basedir}/src/jsr166e"/>
65      <property name="extra166ysrc.dir"     location="${basedir}/src/extra166y"/>
66      <property name="jdksrc.dir"           location="/home/dl/1.6.0/j2se/martin/j2se/src/share/classes"/>
67    
68    <!-- Distribution locations -->    <!-- Distribution locations -->
69    <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>    <property name="dist.javadocs.dir"           location="${dist.dir}/docs"/>
70      <property name="dist.jsr166xjavadocs.dir"    location="${dist.dir}/jsr166xdocs"/>
71      <property name="dist.jsr166yjavadocs.dir"    location="${dist.dir}/jsr166ydocs"/>
72      <property name="dist.jsr166ejavadocs.dir"    location="${dist.dir}/jsr166edocs"/>
73      <property name="dist.extra166yjavadocs.dir"  location="${dist.dir}/extra166ydocs"/>
74    
75    <!-- Jar locations -->    <!-- Jar locations -->
76    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
77      <property name="jsr166xproduct.jar"   location="${build.jsr166xlib.dir}/jsr166x.jar"/>
78      <property name="jsr166yproduct.jar"   location="${build.jsr166ylib.dir}/jsr166y.jar"/>
79      <property name="jsr166eproduct.jar"   location="${build.jsr166elib.dir}/jsr166e.jar"/>
80      <property name="extra166yproduct.jar" location="${build.extra166ylib.dir}/extra166y.jar"/>
81    <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"/>  
82    
83      <!-- Bootclasspath argument -->
84      <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>
85    
86      <!-- Canonical location of jdk API docs, to use with javadoc link attribute -->
87    <!-- Files excluded from dist-docs and emulation jar -->    <property name="jdkapi5docs.url"      value="http://docs.oracle.com/javase/1.5.0/docs/api/"/>
88    <patternset id="unsafe.exclusion">    <property name="jdkapi6docs.url"      value="http://docs.oracle.com/javase/6/docs/api/"/>
89      <exclude name="java/util/Random.*"/>    <property name="jdkapi7docs.url"      value="http://docs.oracle.com/javase/7/docs/api/"/>
90      <exclude name="sun/misc/Unsafe.*"/>  
91    </patternset>    <property name="jdkapi8docs.url"      value="http://download.java.net/jdk8/docs/api/"/>
92      <!-- The below does not yet exist as of 2012-11 -->
93    <!-- Files excludes from emulation jar -->    <!-- <property name="jdkapi8docs.url" value="http://docs.oracle.com/javase/8/docs/api/"/> -->
94    <patternset id="atomic.exclusion">    <property name="jdkapidocs.url"       value="${jdkapi7docs.url}"/>
95      <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/>  
96      <exclude name="java/util/concurrent/atomic/AtomicInteger*"/>    <!-- Test classpath -->
97      <exclude name="java/util/concurrent/atomic/AtomicLong*"/>    <path id="test.classpath">
98      <exclude name="java/util/concurrent/atomic/AtomicReference*"/>      <pathelement location="${build.testcases.dir}"/>
99    </patternset>      <pathelement location="${junit.jar}"/>
100      </path>
101    
102      <!-- ALoops classpath -->
103      <path id="loops.classpath">
104        <pathelement location="${build.loops.dir}"/>
105      </path>
106    
107    
108    <!-- Main targets -->    <!-- Main targets -->
109    
110      <target name="dists"
111              depends="dist, jsr166xdist, jsr166ydist,jsr166edist,  extra166ydist"
112              description="Builds all public jars and docs"/>
113    
114    <target name="compile"    <target name="compile"
115            depends="init, configure-compiler, prepare-src"            depends="init, configure-compiler"
116            description="Compiles main sources to build folder">            description="Compiles main sources to build folder">
117    
     <property name="prepare.src.dir" value="${src.dir}"/>  
   
118      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
119    
120  <!--      <javac srcdir="${src.dir}"
     <echo>javac ${gjc.args}</echo>  
     <echo>bootclasspath=${compile.bootclasspath}</echo>  
 -->  
   
     <javac srcdir="${prepare.src.dir}"  
121            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
122              debug="${build.debug}"              debug="${build.debug}"
123         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
# Line 99  Line 125 
125             source="${build.sourcelevel}"             source="${build.sourcelevel}"
126               fork="true">               fork="true">
127    
128        <compilerarg    line="${gjc.args}"/>        <include name="**/*.java"/>
129        <bootclasspath refid="compile.bootclasspath"/>        <compilerarg value="-XDignore.symbol.file=true"/>
130    
131    <!--
132          <exclude name="java/lang/**"/>
133          <compilerarg line="${build.args}"/>
134          <compilerarg line="-Xlint -Xmaxwarns 1000"/>
135    -->
136    
137      </javac>      </javac>
138    
139    </target>    </target>
140    
141    
   <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)" />  
142    
143      <target name="jar"
144              depends="compile"
145              description="Builds library jar from compiled sources">
146    
147    <target name="checkstyle"      <mkdir dir="${build.lib.dir}"/>
           depends="filter-src"  
           description="Reports on style errors in Java source (verbose, mostly chaff)">  
   
     <taskdef resource="checkstyletask.properties"  
             classpath="${lib.dir}/checkstyle-all-2.4.jar"/>  
148    
149      <checkstyle>      <jar destfile="${product.jar}">
150        <formatter type="plain"/>  <!-- also available: type="xml" -->        <fileset dir="${build.classes.dir}"/>
151        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>      </jar>
     </checkstyle>  
152    
153    </target>    </target>
154    
155    
   <target name="doccheck"  
           depends="filter-doccheck"  
           description="Reports on javadoc style errors">  
   
     <delete dir="${build.doccheck.dir}"/>  
     <mkdir dir="${build.doccheck.dir}"/>  
156    
157      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"    <target name="test"
158           docletpath="${lib.dir}/doccheck.jar"            depends="init, configure-tests, report-tests"
159              destdir="${build.doccheck.dir}">            description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
       <packageset dir="${build.filter.doccheck.dir}"/>  
     </javadoc>  
160    
   </target>  
161    
162    
163    <target name="docs"    <target name="docs"
           depends="filter-src"  
164            description="Builds javadocs with custom tags to build folder">            description="Builds javadocs with custom tags to build folder">
165    
166      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
167      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${build.javadocs.dir}"/>
168    
169      <javadoc destdir="${build.javadocs.dir}"      <!-- the packagenames="none" hack below prevents scanning the -->
170                  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}"/>  
171    
172        <javadoc destdir="${build.javadocs.dir}"
173                 packagenames="none"
174                 link="${jdkapidocs.url}"
175                 overview="${src.dir}/intro.html"
176                 sourcepath="${src.dir}:${jdksrc.dir}"
177                 additionalparam="-XDignore.symbol.file=true" >
178          <fileset dir="${src.dir}" defaultexcludes="yes">
179          <include name="**/*.java"/>
180          </fileset>
181      </javadoc>      </javadoc>
182    
183    </target>    </target>
184    
185    
   <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>  
   
186    
187    <target name="dist"    <target name="dist"
188            depends="init, dist-clean, dist-jar, dist-docs"            depends="init, dist-clean, dist-jar, dist-docs"
189            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
190    
191    
192    <target name="release"    <target name="release"
193            depends="dist"            depends="dist"
194            description="Puts entire CVS tree, plus distribution productions, in a jar">            description="Puts entire CVS tree, plus distribution productions, in a jar">
195    
 <!--  
     #keep build dir? - dl  
     <delete dir="${build.dir}"/>  
 -->  
196      <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>      <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
197    
198      <jar basedir="${basedir}" destfile="${release.jar}">      <jar basedir="${basedir}" destfile="${release.jar}">
199          <!-- <exclude name="build/**"/> -->
200        <exclude name="${release.jar}"/>        <exclude name="${release.jar}"/>
201        <exclude name="user.properties"/>        <exclude name="user.properties"/>
202        <exclude name="etc/notes/**"/>        <exclude name="etc/notes/**"/>
203        <exclude name="lib/gjc/2.1/**"/>        <exclude name="src/emulation/**"/>
204        <exclude name="**/SyntaxTest.java"/>        <exclude name="**/SyntaxTest.java"/>
205          <exclude name="**/SuperfluousAbstract.java"/>
206      </jar>      </jar>
207    
208    </target>    </target>
209    
210    
211    
212    <target name="clean"    <target name="clean"
213            description="Removes all build products">            description="Removes all build products">
214    
# Line 233  Line 219 
219    </target>    </target>
220    
221    
222    
223    <target name="dist-clean"    <target name="dist-clean"
224            description="Removes all build and distribution products">            description="Removes all build and distribution products">
225    
# Line 241  Line 228 
228    </target>    </target>
229    
230    
231    
232    <target name="dist-docs"    <target name="dist-docs"
           depends="filter-src"  
233            description="Builds javadocs without custom tags to dist folder">            description="Builds javadocs without custom tags to dist folder">
234    
235      <delete dir="${dist.javadocs.dir}"/>      <delete dir="${dist.javadocs.dir}"/>
236      <mkdir dir="${dist.javadocs.dir}"/>      <mkdir dir="${dist.javadocs.dir}"/>
237    
238      <javadoc destdir="${dist.javadocs.dir}"      <!-- the packagenames="none" hack below prevents scanning the -->
239                  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}"/>  
240    
241        <javadoc destdir="${dist.javadocs.dir}"
242                 packagenames="none"
243                 link="${jdkapidocs.url}"
244                 overview="${src.dir}/intro.html"
245                 sourcepath="${src.dir}:${jdksrc.dir}"
246                 additionalparam="-XDignore.symbol.file=true" >
247          <fileset dir="${src.dir}" defaultexcludes="yes">
248          <include name="**/*.java"/>
249          </fileset>
250      </javadoc>      </javadoc>
251    
252    </target>    </target>
# Line 269  Line 261 
261      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
262      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
263      <echo>Building JSR-166 version ${version}</echo>      <echo>Building JSR-166 version ${version}</echo>
264        <echo>java.home is ${java.home}</echo>
265    
266    </target>    </target>
267    
268    
269    <target name="init-jar">    <target name="dist-jar"
270              depends="clean, jar">
271    
272      <mkdir dir="${build.lib.dir}"/>      <copy file="${product.jar}" todir="${dist.dir}"/>
273    
274    </target>    </target>
275    
276    
277    <target name="native-jar"    <target name="compile-tests"
278            depends="compile"            depends="jar">
           unless="build.emulation.true">  
279    
280      <jar destfile="${product.jar}">      <mkdir dir="${build.testcases.dir}"/>
       <fileset dir="${build.classes.dir}"/>  
     </jar>  
281    
282    </target>      <javac srcdir="${tck.src.dir}"
283              destdir="${build.testcases.dir}"
284                debug="${build.debug}"
285           debuglevel="${build.debuglevel}"
286          deprecation="${build.deprecation}"
287               source="${build.sourcelevel}"
288                 fork="true">
289    
290          <compilerarg value="${bootclasspath.args}"/>
291          <compilerarg line="${build.args}"/>
292          <compilerarg value="-XDignore.symbol.file=true"/>
293    
294    <target name="compile-emulation"        <classpath refid="test.classpath"/>
           depends="init, configure-compiler"  
           if="build.emulation.true">  
295    
296      <mkdir dir="${build.emulation.dir}"/>      </javac>
297    
298      <javac srcdir="${emulation.src.dir}"      <javac srcdir="${test.src.dir}"
299            destdir="${build.emulation.dir}"            destdir="${build.testcases.dir}"
300              debug="${build.debug}"              debug="${build.debug}"
301         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
302        deprecation="${build.deprecation}"        deprecation="${build.deprecation}"
303             source="${build.sourcelevel}"             source="${build.sourcelevel}"
304               fork="true">               fork="true">
305    
306        <compilerarg    line="${gjc.args}"/>        <include name="jsr166/test/**"/>
307        <bootclasspath refid="compile.bootclasspath"/>  
308          <compilerarg value="${bootclasspath.args}"/>
309          <compilerarg line="${build.args}"/>
310          <compilerarg value="-XDignore.symbol.file=true"/>
311    
312          <classpath refid="test.classpath"/>
313    
314      </javac>      </javac>
315    
316    <!--
317        <javac srcdir="${jtreg.src.dir}"
318              destdir="${build.testcases.dir}"
319                debug="${build.debug}"
320           debuglevel="${build.debuglevel}"
321          deprecation="${build.deprecation}"
322               source="${build.sourcelevel}"
323                 fork="true">
324    
325          <compilerarg value="${bootclasspath.args}"/>
326          <compilerarg line="${build.args}"/>
327          <compilerarg value="-XDignore.symbol.file=true"/>
328    
329          <classpath refid="test.classpath"/>
330    
331        </javac>
332    -->
333    
334    </target>    </target>
335    
336    
337    <target name="emulation-jar"    <target name="run-tests"
338            depends="compile-emulation"            depends="compile-tests">
339            if="build.emulation.true">  
340        <!-- May be overridden by user.properties -->
341        <property name="testcase" value="*"/>
342    
343        <mkdir dir="${build.reports.dir}"/>
344    
345        <junit printsummary="true"
346                 showoutput="true"
347              errorProperty="junit.failed"
348            failureProperty="junit.failed"
349                        dir="${build.reports.dir}"
350                       fork="true">
351    
352          <jvmarg value="${bootclasspath.args}"/>
353          <jvmarg value="-server"/>
354          <jvmarg value="-showversion"/>
355    
356          <classpath refid="test.classpath"/>
357    
358          <formatter type="xml"/>
359    
360          <batchtest todir="${build.reports.dir}" unless="no.test.tck">
361            <fileset dir="${tck.src.dir}">
362              <include name="**/${testcase}Test.java"/>
363            </fileset>
364          </batchtest>
365    
366          <batchtest todir="${build.reports.dir}" if="do.test.old">
367            <fileset dir="${test.src.dir}">
368              <include name="jsr166/test/**/${testcase}Test.java"/>
369            </fileset>
370          </batchtest>
371    
372    <!--
373          <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
374            <fileset dir="${jtreg.src.dir}">
375              <include name="**/${testcase}Test.java"/>
376            </fileset>
377          </batchtest>
378    -->
379    
380        </junit>
381    
382      </target>
383    
384    
385      <target name="report-tests"
386              depends="run-tests">
387    
388      <jar destfile="${product.jar}" duplicate="add">      <!-- Sets junit.report.format to frames if redirection is present,
389        <fileset dir="${build.classes.dir}">           otherwise sets it to noframes. -->
390          <patternset refid="atomic.exclusion"/>      <available property="junit.report.format"
391          <patternset refid="unsafe.exclusion"/>                    value="frames"
392                  classname="org.apache.xalan.lib.Redirect"
393        />
394        <property name="junit.report.format" value="noframes"/>
395    
396        <junitreport todir="${build.reports.dir}">
397          <fileset dir="${build.reports.dir}">
398            <include name="TEST-*.xml"/>
399        </fileset>        </fileset>
400        <fileset dir="${build.emulation.dir}"/>        <report format="${junit.report.format}" todir="${build.reports.dir}"
401      </jar>        />
402        </junitreport>
403    
404        <fail message="Test Cases Failed" if="junit.failed"/>
405    
406    </target>    </target>
407    
408    
409    <target name="dist-jar"    <target name="configure-compiler">
           depends="clean, jar">  
410    
411      <copy file="${product.jar}" todir="${dist.dir}"/>      <property name="unchecked.option" value="-Xlint:unchecked"/>
412    
413        <condition property="warnunchecked.arg" value="${unchecked.option}">
414          <istrue value="${build.warnunchecked}"/>
415        </condition>
416    
417        <property name="warnunchecked.arg" value=""/>
418    
419    
420        <!-- Common options in javac invocations -->
421        <property name="build.args" value="${warnunchecked.arg}"/>
422    
423    </target>    </target>
424    
425    
426    <target name="compile-ant-filter"    <target name="configure-tests"
427            depends="init">         depends="configure-compiler">
428    
429      <mkdir dir="${build.ant.dir}"/>      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
430        <available property="junit.available"
431                   classname="junit.framework.Protectable"/>
432    
433      <javac srcdir="${ant.src.dir}"      <!-- Xalan -->
434            destdir="${build.ant.dir}"      <available property="xalan.available"
435             source="1.4"                 classname="org.apache.xalan.Version"/>
436      />  
437    
438        <!-- Ant 1.6beta and later don't need or want this check -->
439        <!--
440        <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
441              unless="junit.available"/>
442    
443        <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
444              unless="xalan.available"/>
445        -->
446    
447    </target>    </target>
448    
449    
450    <target name="filter-src"    <!-- Various demos and test programs -->
           depends="compile-ant-filter">  
451    
     <mkdir dir="${build.filter.src.dir}"/>  
452    
453      <copy todir="${build.filter.src.dir}">    <target name="loops" depends="init, configure-compiler"
454        <fileset dir="${src.dir}">            description="Benchmark from Doug Lea's AQS paper">
         <include name="**/*.html"/>  
       </fileset>  
     </copy>  
455    
456      <copy todir="${build.filter.src.dir}">      <mkdir dir="${build.loops.dir}"/>
457        <fileset dir="${src.dir}">  
458          <exclude name="**/*.html"/>      <javac srcdir="${loops.src.dir}"
459          <patternset refid="unsafe.exclusion"/>            destdir="${build.loops.dir}"
460        </fileset>              debug="${build.debug}"
461        <filterchain>         debuglevel="${build.debuglevel}"
462          deprecation="${build.deprecation}"
463               source="${build.sourcelevel}"
464                 fork="true">
465    
466          <compilerarg line="${build.args}"/>
467          <classpath refid="loops.classpath"/>
468          <compilerarg value="-XDignore.symbol.file=true"/>
469    
470        </javac>
471    
472        <java classname="ALoops" fork="true">
473          <classpath refid="loops.classpath"/>
474        </java>
475    
476      </target>
477    
478    
479      <!-- jsr166x -->
480    
         <!--  
          # 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.)  
          -->  
481    
482          <filterreader classname="jsr166.ant.filters.ReplaceFilter"    <target name="jsr166xcompile"
483                        classpath="${build.ant.dir}">            depends="init, configure-compiler"
484            <param name="notmatching" value="^\s+\*\s.*$"/>            description="Compiles jsr166x sources">
485            <param name="pattern"     value="&lt;[^|>()]+?>+"/>  
486            <param name="replacement" value=" "/>      <mkdir dir="${build.jsr166x.dir}"/>
         </filterreader>  
487    
488        <javac srcdir="${jsr166xsrc.dir}"
489              destdir="${build.jsr166x.dir}"
490                debug="${build.debug}"
491           debuglevel="${build.debuglevel}"
492          deprecation="${build.deprecation}"
493               source="${build.sourcelevel}"
494                 fork="true">
495    
496          <!--        <include name="**/*.java"/>
497           # This filter uncomments lines beginning with "//@" so that        <compilerarg line="${build.args}"/>
498           # javadoc can see imports that are needed to resolve links        <compilerarg value="-XDignore.symbol.file=true"/>
          # but that shouldn't be in the compiled code.  
          -->  
499    
500          <filterreader classname="jsr166.ant.filters.ReplaceFilter"      </javac>
                       classpath="${build.ant.dir}">  
           <param name="matching"    value="^//@.*$"/>  
           <param name="pattern"     value="^//@"/>  
           <param name="replacement" value=""/>  
         </filterreader>  
       </filterchain>  
     </copy>  
501    
502    </target>    </target>
503    
504    
505    
506      <target name="jsr166xjar"
507              depends="jsr166xcompile"
508              description="Builds library jar from compiled sources">
509    
510        <mkdir dir="${build.jsr166xlib.dir}"/>
511    
512    <target name="filter-doccheck"      <jar destfile="${jsr166xproduct.jar}">
513            depends="filter-src">        <fileset dir="${build.jsr166x.dir}"/>
514        </jar>
515    
516      <mkdir dir="${build.filter.doccheck.dir}"/>    </target>
517    
     <copy todir="${build.filter.doccheck.dir}">  
       <fileset dir="${build.filter.src.dir}">  
         <include name="**/*.html"/>  
       </fileset>  
     </copy>  
518    
     <property name="generic.declarations"  
              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 {}"  
     />  
519    
520      <copy todir="${build.filter.doccheck.dir}">    <target name="jsr166xdocs"
521        <fileset dir="${build.filter.src.dir}">            description="Builds javadocs with custom tags to build folder">
         <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>  
522    
523        </filterchain>      <delete dir="${build.jsr166xjavadocs.dir}"/>
524      </copy>      <mkdir dir="${build.jsr166xjavadocs.dir}"/>
525    
526        <javadoc destdir="${build.jsr166xjavadocs.dir}"
527                 packagenames="jsr166x"
528                 link="${jdkapidocs.url}"
529                 source="${build.sourcelevel}"
530                 sourcepath="${topsrc.dir}:${jdksrc.dir}"
531                 additionalparam="-XDignore.symbol.file=true" />
532    
533    </target>    </target>
534    
535    
536    <target name="compile-tests"    <target name="jsr166xdist"
537            depends="jar">            depends="jsr166xdist-clean, jsr166xdist-jar, jsr166xdist-docs"
538              description="Puts all distributable products in single hierarchy"/>
539    
     <mkdir dir="${build.testcases.dir}"/>  
540    
 <!--  
     <echo>javac ${gjc.args}</echo>  
     <echo>bootclasspath=${test.compile.bootclasspath}</echo>  
     <echo>classpath="${test.classpath}"</echo>  
 -->  
541    
542      <javac srcdir="${test.src.dir}"    <target name="jsr166xclean"
543            destdir="${build.testcases.dir}"            description="Removes all build products">
544    
545        <delete dir="${build.jsr166x.dir}"/>
546        <delete dir="${build.jsr166xlib.dir}"/>
547    
548      </target>
549    
550    
551    
552      <target name="jsr166xdist-clean"
553              description="Removes all build and distribution products">
554    
555      </target>
556    
557    
558    
559      <target name="jsr166xdist-docs"
560              description="Builds javadocs without custom tags to dist folder">
561    
562        <delete dir="${dist.jsr166xjavadocs.dir}"/>
563        <mkdir dir="${dist.jsr166xjavadocs.dir}"/>
564    
565        <javadoc destdir="${dist.jsr166xjavadocs.dir}"
566                 packagenames="jsr166x"
567                 link="${jdkapidocs.url}"
568                 source="${build.sourcelevel}"
569                 sourcepath="${topsrc.dir}:${jdksrc.dir}"
570                 additionalparam="-XDignore.symbol.file=true" />
571    
572      </target>
573    
574      <target name="jsr166xdist-jar"
575              depends="jsr166xclean, jsr166xjar">
576    
577        <copy file="${jsr166xproduct.jar}" todir="${dist.dir}"/>
578    
579      </target>
580    
581      <!-- jsr166y -->
582    
583    
584      <target name="jsr166ycompile"
585              depends="init, configure-compiler"
586              description="Compiles jsr166y sources">
587    
588        <mkdir dir="${build.jsr166y.dir}"/>
589    
590        <javac srcdir="${jsr166ysrc.dir}"
591              destdir="${build.jsr166y.dir}"
592              debug="${build.debug}"              debug="${build.debug}"
593         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
594        deprecation="${build.deprecation}"        deprecation="${build.deprecation}"
595             source="${build.sourcelevel}"             source="${build.sourcelevel}"
596               fork="true">               fork="true">
597    
598        <compilerarg    line="${gjc.args}"/>        <include name="**/*.java"/>
599        <bootclasspath refid="test.compile.bootclasspath"/>        <compilerarg line="${build.args}"/>
600        <classpath     refid="test.classpath"/>        <compilerarg value="-XDignore.symbol.file=true"/>
601          <compilerarg value="${bootclasspath.args}"/>
602    
603    <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
604    
605      </javac>      </javac>
606    
607    </target>    </target>
608    
609    
   <target name="run-tests"  
           depends="compile-tests">  
610    
611      <!-- May be overridden by user.properties -->    <target name="jsr166yjar"
612      <property name="testcase" value="*"/>            depends="jsr166ycompile"
613              description="Builds library jar from compiled sources">
614    
615      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.jsr166ylib.dir}"/>
616    
617      <junit printsummary="true"      <jar destfile="${jsr166yproduct.jar}" index="true">
618               showoutput="true"        <fileset dir="${build.jsr166y.dir}"/>
619            errorProperty="junit.failed"      </jar>
         failureProperty="junit.failed"  
                     dir="${build.reports.dir}"  
                    fork="true">  
620    
621        <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>    </target>
622    
       <formatter type="xml"/>  
623    
       <batchtest todir="${build.reports.dir}">  
         <fileset dir="${test.src.dir}">  
           <include name="**/${testcase}Test.java"/>  
         </fileset>  
       </batchtest>  
624    
625      </junit>    <target name="jsr166ydocs"
626              description="Builds javadocs with custom tags to build folder">
627    
628        <delete dir="${build.jsr166yjavadocs.dir}"/>
629        <mkdir dir="${build.jsr166yjavadocs.dir}"/>
630    
631        <javadoc destdir="${build.jsr166yjavadocs.dir}"
632                 packagenames="jsr166y"
633                 link="${jdkapidocs.url}"
634                 source="${build.sourcelevel}"
635                 sourcepath="${topsrc.dir}:${jdksrc.dir}"
636                 additionalparam="-XDignore.symbol.file=true" />
637    
638    </target>    </target>
639    
640    
641    <target name="report-tests"    <target name="jsr166ydist"
642            depends="run-tests">            depends="jsr166ydist-clean, jsr166ydist-jar, jsr166ydist-docs"
643              description="Puts all distributable products in single hierarchy"/>
644    
     <!-- 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"/>  
645    
     <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>  
646    
647      <fail message="Test Cases Failed" if="junit.failed"/>    <target name="jsr166yclean"
648              description="Removes all build products">
649    
650        <delete dir="${build.jsr166y.dir}"/>
651        <delete dir="${build.jsr166ylib.dir}"/>
652    
653    </target>    </target>
654    
655    
   <target name="configure-compiler">  
656    
657      <property name="gjc.version"    <target name="jsr166ydist-clean"
658               value="2.2"/>            description="Removes all build and distribution products">
659    
660      <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>  
661    
662      <property name="novariance.arg"    <target name="jsr166ydist-docs"
663               value=""/>            description="Builds javadocs without custom tags to dist folder">
664    
665      <property name="gjc.dir"      <delete dir="${dist.jsr166yjavadocs.dir}"/>
666               value="${lib.dir}/gjc"/>      <mkdir dir="${dist.jsr166yjavadocs.dir}"/>
667    
668      <property name="javac.jar"      <javadoc destdir="${dist.jsr166yjavadocs.dir}"
669            location="${gjc.dir}/${gjc.version}/javac.jar"/>               packagenames="jsr166y"
670                 link="${jdkapidocs.url}"
671                 source="${build.sourcelevel}"
672                 sourcepath="${topsrc.dir}:${jdksrc.dir}"
673                 additionalparam="-XDignore.symbol.file=true" />
674    
675      <property name="collect.jar"    </target>
           location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>  
676    
677      <target name="jsr166ydist-jar"
678              depends="jsr166yclean, jsr166yjar">
679    
680      <condition property="warnunchecked.arg" value="-warnunchecked">      <copy file="${jsr166yproduct.jar}" todir="${dist.dir}"/>
       <istrue value="${gjc.warnunchecked}"/>  
     </condition>  
681    
682      <property name="warnunchecked.arg" value=""/>    </target>
683    
     <condition property="prepare.src.dir" value="${build.dir}/prepare-src">  
       <istrue value="${build.nothreads}"/>  
     </condition>  
684    
685      <!-- extra166y -->
686    
     <!--  
      ! Bootclasspath munging for source compilation.  
      -->  
687    
688      <path id="pre.bootclasspath">    <target name="extra166ycompile"
689        <pathelement location="${javac.jar}"/>            depends="init, configure-compiler, jsr166ycompile"
690      </path>            description="Compiles extra166y 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"/>  
691    
692        <mkdir dir="${build.extra166y.dir}"/>
693    
694      <!-- Common options in javac invocations -->      <javac srcdir="${extra166ysrc.dir}"
695      <property name="gjc.args"            destdir="${build.extra166y.dir}"
696               value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"              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="-XDignore.symbol.file=true"/>
706          <compilerarg value="${bootclasspath.args}"/>
707    
708    <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
709    
710        </javac>
711    
712    </target>    </target>
713    
714    
715    <target name="prepare-src"  
716            depends="configure-compiler"    <target name="extra166yjar"
717            if="prepare.src.dir">            depends="extra166ycompile"
718              description="Builds library jar from compiled sources">
719      <mkdir dir="${prepare.src.dir}"/>  
720      <copy todir="${prepare.src.dir}">      <mkdir dir="${build.extra166ylib.dir}"/>
721        <fileset dir="${src.dir}">  
722          <exclude name="java/lang/**"/>      <jar destfile="${extra166yproduct.jar}" index="true">
723        </fileset>        <fileset dir="${build.extra166y.dir}"/>
724      </copy>      </jar>
725    
726    </target>    </target>
727    
728    
   <target name="configure-emulation">  
729    
730      <condition property="build.emulation.true">    <target name="extra166ydocs"
731        <or>            description="Builds javadocs with custom tags to build folder">
732          <and>  
733            <os family="windows"/>      <delete dir="${build.extra166yjavadocs.dir}"/>
734            <not>      <mkdir dir="${build.extra166yjavadocs.dir}"/>
735              <isset property="build.emulation"/>  
736            </not>      <javadoc destdir="${build.extra166yjavadocs.dir}"
737          </and>               packagenames="extra166y"
738          <istrue value="${build.emulation}"/>               link="${jdkapidocs.url}"
739        </or>               source="${build.sourcelevel}"
740      </condition>               sourcepath="${topsrc.dir}:${jdksrc.dir}"
741                 additionalparam="-XDignore.symbol.file=true" />
742    
743    </target>    </target>
744    
745    
746    <target name="configure-tests"    <target name="extra166ydist"
747         depends="configure-compiler">            depends="extra166ydist-clean, extra166ydist-jar, extra166ydist-docs"
748              description="Puts all distributable products in single hierarchy"/>
749    
     <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->  
     <available property="junit.available"  
                classname="junit.framework.Protectable"/>  
750    
     <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"  
           unless="junit.available"/>  
751    
752      <target name="extra166yclean"
753              description="Removes all build products">
754    
755      <!--      <delete dir="${build.extra166y.dir}"/>
756       ! Bootclasspath munging for testing, so JUnit can test our local      <delete dir="${build.extra166ylib.dir}"/>
      ! modifications to java.*.  
      -->  
757    
758      <path id="test.classpath">    </target>
       <pathelement location="${product.jar}"/>  
       <pathelement location="${build.testcases.dir}"/>  
       <pathelement location="${junit.jar}"/>  
     </path>  
759    
     <path id="test.compile.bootclasspath">  
       <pathelement location="${javac.jar}"/>  
       <pathelement location="${collect.jar}"/>  
       <pathelement location="${rt.jar}"/>  
     </path>  
760    
     <path id="test.run.bootclasspath">  
       <pathelement location="${javac.jar}"/>  
       <path refid="test.classpath"/>  
     </path>  
761    
762      <!-- Flatten test classpaths into platform-appropriate strings -->    <target name="extra166ydist-clean"
763      <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"/>  
764    
765    </target>    </target>
766    
767      <target name="extra166ydist-docs"
768              description="Builds javadocs without custom tags to dist folder">
769    
770        <delete dir="${dist.extra166yjavadocs.dir}"/>
771        <mkdir dir="${dist.extra166yjavadocs.dir}"/>
772    
773        <javadoc destdir="${dist.extra166yjavadocs.dir}"
774                 packagenames="extra166y"
775                 link="${jdkapidocs.url}"
776                 source="${build.sourcelevel}"
777                 sourcepath="${topsrc.dir}:${jdksrc.dir}"
778                 additionalparam="-XDignore.symbol.file=true" />
779    
780    <!-- Anthill targets -->    </target>
781    
782    <target name="anthill-build"    <target name="extra166ydist-jar"
783            depends="jar, test, docs, dist-docs"/>            depends="extra166yclean, extra166yjar">
784    
785    <target name="anthill-publish">      <copy file="${extra166yproduct.jar}" todir="${dist.dir}"/>
786    
787      <copy todir="${deployDir}/docs/private">    </target>
       <fileset dir="${build.javadocs.dir}"/>  
     </copy>  
788    
789      <copy todir="${deployDir}/docs/public">    <!-- jsr166e -->
       <fileset dir="${dist.javadocs.dir}"/>  
     </copy>  
790    
     <copy tofile="${deployDir}/index.html"  
           file="${basedir}/etc/anthill-index.html"/>  
791    
792      <copy todir="${deployDir}/notes">    <target name="jsr166ecompile"
793        <fileset dir="${basedir}/etc/notes"/>            depends="init, configure-compiler"
794      </copy>            description="Compiles jsr166e sources">
795    
796        <mkdir dir="${build.jsr166e.dir}"/>
797    
798        <javac srcdir="${jsr166esrc.dir}"
799              destdir="${build.jsr166e.dir}"
800                debug="${build.debug}"
801           debuglevel="${build.debuglevel}"
802          deprecation="${build.deprecation}"
803               source="1.7"
804                 fork="true">
805    
806          <include name="**/*.java"/>
807          <compilerarg line="${build.args}"/>
808          <compilerarg value="-XDignore.symbol.file=true"/>
809          <compilerarg value="${bootclasspath.args}"/>
810    
811    <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
812    
813        </javac>
814    
815    </target>    </target>
816    
817    
   <target name="ng" depends="test">  
     <java classname="SuperfluousAbstract" fork="true">  
818    
819        <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>    <target name="jsr166ejar"
820              depends="jsr166ecompile"
821              description="Builds library jar from compiled sources">
822    
823        <mkdir dir="${build.jsr166elib.dir}"/>
824    
825        <jar destfile="${jsr166eproduct.jar}" index="true">
826          <fileset dir="${build.jsr166e.dir}"/>
827        </jar>
828    
829      </target>
830    
831    
832    
833      <target name="jsr166edocs"
834              description="Builds javadocs with custom tags to build folder">
835    
836        <delete dir="${build.jsr166ejavadocs.dir}"/>
837        <mkdir dir="${build.jsr166ejavadocs.dir}"/>
838    
839        <javadoc destdir="${build.jsr166ejavadocs.dir}"
840                 packagenames="jsr166e,jsr166e.extra"
841                 link="${jdkapidocs.url}"
842                 source="1.7"
843                 sourcepath="${topsrc.dir}:${jdksrc.dir}"
844                 additionalparam="-XDignore.symbol.file=true" />
845    
     </java>  
846    </target>    </target>
847    
848    
849      <target name="jsr166edist"
850              depends="jsr166edist-clean, jsr166edist-jar, jsr166edist-docs"
851              description="Puts all distributable products in single hierarchy"/>
852    
853    
854    
855      <target name="jsr166eclean"
856              description="Removes all build products">
857    
858        <delete dir="${build.jsr166e.dir}"/>
859        <delete dir="${build.jsr166elib.dir}"/>
860    
861      </target>
862    
863    
864    
865      <target name="jsr166edist-clean"
866              description="Removes all build and distribution products">
867    
868      </target>
869    
870      <target name="jsr166edist-docs"
871              description="Builds javadocs without custom tags to dist folder">
872    
873        <delete dir="${dist.jsr166ejavadocs.dir}"/>
874        <mkdir dir="${dist.jsr166ejavadocs.dir}"/>
875    
876        <javadoc destdir="${dist.jsr166ejavadocs.dir}"
877                 packagenames="jsr166e,jsr166e.extra"
878                 link="${jdkapidocs.url}"
879                 source="1.7"
880                 sourcepath="${topsrc.dir}:${jdksrc.dir}"
881                 additionalparam="-XDignore.symbol.file=true" />
882    
883      </target>
884    
885      <target name="jsr166edist-jar"
886              depends="jsr166eclean, jsr166ejar">
887    
888        <copy file="${jsr166eproduct.jar}" todir="${dist.dir}"/>
889    
890      </target>
891    
892  </project>  </project>

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

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