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

Diff of /jsr166/build.xml

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

revision 1.27 by tim, Wed May 28 00:33:17 2003 UTC revision 1.110 by jsr166, Sun Jan 20 01:09:12 2013 UTC
# Line 1  Line 1 
1  <project name="jsr166" default="usage">  <project name="jsr166" default="usage">
2    
3    <description>    <description>
4      Build file for JSR-166  ------------------------------------------------------------------------------
5      Build file for JSR-166
6    
7      JUnit 3.8 or better must be in ${ant.home}/lib for the test target to work.    Usage: ant [target]
8    </description>  
9      User-specific settings are read from user.properties.
10      See user.properties.sample for an explanation of some useful settings.
11    
12      The repository contains all dependencies except for ant and the JDK
13      itself.  Because the JDK version matters and because different
14      targets require different JDKs, we assume that users have created a
15      hierarchy containing:
16      $HOME/jdk/jdk6
17      $HOME/jdk/jdk7
18      $HOME/jdk/jdk8
19      where each of the above is a JDK or a symlink to same, and
20      $HOME/jdk/src/jdk6
21      $HOME/jdk/src/jdk7
22      $HOME/jdk/src/jdk8
23      where each of the above is a complete JDK source tree
24      (e.g. mercurial forest) or a symlink to same.
25    ------------------------------------------------------------------------------
26      </description>
27    
28    <target name="usage" description="Prints this message">    <target name="usage" description="Advises user to run with -projecthelp">
29      <echo>      <echo>Run "ant -projecthelp" for full usage information.</echo>
 ant [target], where target is one of:  
   
  usage       (default) Prints this message  
  compile     Compiles all sources to build folder  
  jar         Builds library jar from compiled sources  
  test        Runs all tests (requires JUnit 1.8 in ${ant.home}/lib)  
  docs        Builds javadocs with custom tags to build folder  
  dist-docs   Builds javadocs without custom tags to dist folder  
  dist        Puts all distributable products in single hierarchy  
   
  clean       Removes all build products  
  dist-clean  Removes all build and distribution products  
   
  checkstyle  Reports on style errors in Java source (verbose, mostly chaff)  
  doccheck    Reports on javadoc style errors (not working yet)  
     </echo>  
30    </target>    </target>
31    
32    
33    <!-- User-specific settings -->    <!-- User-specific settings -->
34    <property file="user.properties"/>    <property file="user.properties"/>
35    
   <!-- Set build.warnings in user.properties to turn on -warnunchecked -->  
   <!-- <property name="build.warnings" value=""/> -->  
   
36    
37    <!-- Compilation options -->    <!-- Compilation options -->
38    <property name="build.sourcelevel"    value="1.5"/>    <property name="build.sourcelevel"    value="1.6"/>
   <property name="build.docsourcelevel" value="1.4"/>  
39    <property name="build.debug"          value="true"/>    <property name="build.debug"          value="true"/>
40    <property name="build.debuglevel"     value="source,lines,vars"/>    <property name="build.debuglevel"     value="source,lines,vars"/>
41    <property name="build.deprecation"    value="false"/>    <property name="build.deprecation"    value="false"/>
42    
43    <!-- Build locations -->    <!-- Build locations -->
44    <property name="build.dir"            location="build"/>    <property name="build.dir"                   location="build"/>
45    <property name="build.classes.dir"    location="${build.dir}/classes"/>    <property name="build.classes.dir"           location="${build.dir}/classes"/>
46    <property name="build.emulation.dir"  location="${build.dir}/emulation"/>    <property name="build.testcases.dir"         location="${build.dir}/testcases"/>
47    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>    <property name="build.loops.dir"             location="${build.dir}/loops"/>
48    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.reports.dir"           location="${build.dir}/reports"/>
49    <property name="build.ant.dir"        location="${build.dir}/ant"/>  
50    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>    <property name="build.4jdk7.dir"             location="${build.dir}/jsr166-4jdk7"/>
51    <property name="build.stripped.dir"   location="${build.dir}/stripped"/>    <property name="build.4jdk7.classes.dir"     location="${build.4jdk7.dir}/classes"/>
52    <property name="build.reports.dir"    location="${build.dir}/reports"/>    <property name="build.4jdk7.tck.classes.dir" location="${build.4jdk7.dir}/tck/classes"/>
53    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>    <property name="build.4jdk7.docs.dir"        location="${build.4jdk7.dir}/docs"/>
54    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>  
55      <property name="build.jsr166x.dir"           location="${build.dir}/jsr166x"/>
56      <property name="build.jsr166y.dir"           location="${build.dir}/jsr166y"/>
57      <property name="build.jsr166e.dir"           location="${build.dir}/jsr166e"/>
58      <property name="build.extra166y.dir"         location="${build.dir}/extra166y"/>
59    
60      <!-- JDK binary locations -->
61      <property name="jdks.home"  location="${user.home}/jdk"/>
62    
63      <macrodef name="defjdklocations">
64        <attribute name="v"/>
65        <sequential>
66        <property name="jdk@{v}.home"   location="${jdks.home}/jdk@{v}"/>
67        <property name="java@{v}"       location="${jdk@{v}.home}/bin/java"/>
68        <property name="javac@{v}"      location="${jdk@{v}.home}/bin/javac"/>
69        <property name="javadoc@{v}"    location="${jdk@{v}.home}/bin/javadoc"/>
70        <property name="bootdir@{v}"    location="${jdk@{v}.home}/jre/lib"/>
71        <property name="jdk@{v}src.dir" location="${jdks.home}/src/jdk@{v}/jdk/src/share/classes"/>
72        <property name="bootclasspath@{v}"
73         value="${bootdir@{v}}/resources.jar:${bootdir@{v}}/rt.jar:${bootdir@{v}}/jsse.jar:${bootdir@{v}}/jce.jar:${bootdir@{v}}/:${bootdir@{v}}/charsets.jar"/>
74        </sequential>
75      </macrodef>
76    
77      <defjdklocations v="6"/>
78      <defjdklocations v="7"/>
79      <defjdklocations v="8"/>
80    
81      <macrodef name="run-tck-tests">
82        <attribute name="jvm"/>
83        <attribute name="tck.classes"/>
84        <attribute name="product.jar" default="${product.jar}"/>
85        <attribute name="jvmflags" default=""/>
86        <sequential>
87        <java classname="JSR166TestCase"
88              jvm="@{jvm}" fork="true">
89            <jvmarg value="-Xbootclasspath/p:@{product.jar}"/>
90            <jvmarg line="@{jvmflags}"/>
91            <classpath>
92              <pathelement location="${junit.jar}"/>
93              <pathelement location="@{tck.classes}"/>
94            </classpath>
95        </java>
96        </sequential>
97      </macrodef>
98    
99    <!-- Source locations -->    <!-- Source locations -->
100    <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"/>  
101    <property name="test.src.dir"         location="${basedir}/src/test"/>    <property name="test.src.dir"         location="${basedir}/src/test"/>
102    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="loops.src.dir"        location="${basedir}/src/loops"/>
103    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
104      <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>
105    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
106    <property name="dist.dir"             location="${basedir}/dist"/>    <property name="dist.dir"             location="${basedir}/dist"/>
107      <property name="topsrc.dir"           location="${basedir}/src"/>
108      <property name="4jdk7src.dir"         location="${topsrc.dir}/jdk7"/>
109      <property name="jsr166xsrc.dir"       location="${topsrc.dir}/jsr166x"/>
110      <property name="jsr166ysrc.dir"       location="${topsrc.dir}/jsr166y"/>
111      <property name="jsr166esrc.dir"       location="${topsrc.dir}/jsr166e"/>
112      <property name="extra166ysrc.dir"     location="${topsrc.dir}/extra166y"/>
113    
114    <!-- Distribution locations -->    <!-- Distribution locations -->
115    <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>    <property name="dist.javadocs.dir"          location="${dist.dir}/jsr166.docs"/>
116      <property name="dist.4jdk7.docs.dir"        location="${dist.dir}/jsr166-4jdk7.docs"/>
117      <property name="dist.jsr166xjavadocs.dir"   location="${dist.dir}/jsr166x.docs"/>
118      <property name="dist.jsr166yjavadocs.dir"   location="${dist.dir}/jsr166y.docs"/>
119      <property name="dist.jsr166ejavadocs.dir"   location="${dist.dir}/jsr166e.docs"/>
120      <property name="dist.extra166yjavadocs.dir" location="${dist.dir}/extra166y.docs"/>
121    
122    <!-- Jar locations -->    <!-- Jar locations -->
123    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"      location="${build.dir}/jsr166.jar"/>
124    <property name="javac.jar"            location="${lib.dir}/javac.jar"/>    <property name="4jdk7product.jar" location="${build.4jdk7.dir}/jsr166-4jdk7.jar"/>
125    <property name="collect.jar"          location="${lib.dir}/collect.jar"/>    <property name="jsr166x.jar"      location="${build.jsr166x.dir}/jsr166x.jar"/>
126    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="jsr166y.jar"      location="${build.jsr166y.dir}/jsr166y.jar"/>
127    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="jsr166e.jar"      location="${build.jsr166e.dir}/jsr166e.jar"/>
128      <property name="extra166y.jar"    location="${build.extra166y.dir}/extra166y.jar"/>
129      <property name="junit.jar"        location="${lib.dir}/junit.jar"/>
130    
131      <!-- Bootclasspath argument -->
132      <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>
133    
134      <!-- Canonical location of jdk API docs, to use with javadoc link attribute -->
135      <property name="jdkapi5docs.url"      value="http://docs.oracle.com/javase/1.5.0/docs/api/"/>
136      <property name="jdkapi6docs.url"      value="http://docs.oracle.com/javase/6/docs/api/"/>
137      <property name="jdkapi7docs.url"      value="http://docs.oracle.com/javase/7/docs/api/"/>
138    
139      <property name="jdkapi8docs.url"      value="http://download.java.net/jdk8/docs/api/"/>
140      <!-- The below does not yet exist as of 2012-11 -->
141      <!-- <property name="jdkapi8docs.url" value="http://docs.oracle.com/javase/8/docs/api/"/> -->
142    
143      <!-- Default jdk api doc location (latest stable release seems best) -->
144      <property name="jdkapidocs.url"       value="${jdkapi7docs.url}"/>
145    
146    <!--    <!-- Test classpath -->
147     ! Bootclasspath munging for source compilation.    <path id="test.classpath">
148     -->      <pathelement location="${build.testcases.dir}"/>
149        <pathelement location="${junit.jar}"/>
   <path id="javac.bootclasspath.prepend">  
     <!-- <pathelement location="${src.dir}"/> -->  
     <pathelement location="${javac.jar}"/>  
150    </path>    </path>
151    
152    <path id="javac.bootclasspath">    <!-- ALoops classpath -->
153      <!-- <pathelement location="${src.dir}"/> -->    <path id="loops.classpath">
154      <pathelement location="${collect.jar}"/>      <pathelement location="${build.loops.dir}"/>
     <pathelement location="${rt.jar}"/>  
155    </path>    </path>
156    
157    <!-- Flatten bootclasspath prefix into a platform-appropriate string -->    <!-- Support @jls tag, used in jdk8+ javadoc -->
158    <property name="javac.bootclasspath.prepend" refid="javac.bootclasspath.prepend"/>    <!-- TODO: How do we get &trade to work? -->
159      <!-- TODO: Why isn't @jls a "standard" tag? -->
160      <!--   property name="javadoc.jls.cite" value="The Java&trade; Language Specification" -->
161      <property name="javadoc.jls.cite" value="The Java Language Specification"/>
162      <property name="javadoc.jls.option" value="jls:a:See &lt;cite&gt;${javadoc.jls.cite}&lt;/cite&gt;:"/>
163    
164    <!-- Turn the flattened bootclasspath prefix into a javac argument -->    <!-- Main targets -->
   <property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prepend}'/>  
165    
166      <target name="dists"
167              depends="dist, 4jdk7dist, jsr166edist, jsr166ydist, extra166ydist, jsr166xdist"
168              description="Builds all public jars and docs"/>
169    
170      <target name="compile"
171              depends="configure-compiler"
172              description="Compiles src/main sources to build dir">
173    
174    <!--      <mkdir dir="${build.classes.dir}"/>
    ! Bootclasspath munging for testing, so JUnit can test our local  
    ! modifications to java.*.  
    -->  
175    
176    <path id="test.classpath">      <javac srcdir="${src.dir}"
177      <pathelement location="${product.jar}"/>             destdir="${build.classes.dir}"
178      <pathelement location="${build.testcases.dir}"/>             debug="${build.debug}"
179      <pathelement location="${junit.jar}"/>             debuglevel="${build.debuglevel}"
180    </path>             deprecation="${build.deprecation}"
181               classpath=""
182               includeAntRuntime="false"
183               includeJavaRuntime="false"
184               executable="${javac8}"
185               fork="true">
186    
187          <include name="**/*.java"/>
188          <compilerarg line="${build.args}"/>
189          <compilerarg value="-XDignore.symbol.file=true"/>
190          <compilerarg value="-Xlint:all"/>
191    
192    <!--
193          <exclude name="java/lang/**"/>
194          <compilerarg line="${build.args}"/>
195          <compilerarg line="-Xlint -Xmaxwarns 1000"/>
196    -->
197    
198    <!-- Flatten test classpath into a platform-appropriate string -->      </javac>
   <property name="test.classpath" refid="test.classpath"/>  
199    
200    <!-- Turn the flattened test classpath into a javac argument -->    </target>
   <property name="test.javac.args" value='-Xbootclasspath/p:${test.classpath}'/>  
201    
202    
203    
204    <!-- Main targets -->    <target name="jar"
205              depends="compile"
206              description="Builds library jar from compiled sources">
207    
208    <target name="compile" depends="init"      <jar destfile="${product.jar}">
209            description="Compiles main sources to build folder">        <fileset dir="${build.classes.dir}"/>
210        </jar>
211    
212      <mkdir dir="${build.classes.dir}"/>    </target>
213    
214      <javac srcdir="${src.dir}"  
215            destdir="${build.classes.dir}"  
216      <target name="test"
217              depends="configure-tests, report-tests"
218              description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
219    
220    
221    
222      <target name="docs"
223              description="Builds javadocs for src/main to dist dir">
224    
225        <delete dir="${dist.javadocs.dir}"/>
226        <mkdir dir="${dist.javadocs.dir}"/>
227    
228        <!-- the packagenames="none" hack below prevents scanning the -->
229        <!-- sourcepath for packages -->
230    
231        <javadoc destdir="${dist.javadocs.dir}"
232                 packagenames="none"
233                 link="${jdkapi8docs.url}"
234                 overview="${src.dir}/intro.html"
235                 sourcepath="${src.dir}:${jdk8src.dir}"
236                 classpath=""
237                 executable="${javadoc8}">
238          <arg value="-XDignore.symbol.file=true"/>
239          <arg value="-tag"/>
240          <arg value="${javadoc.jls.option}"/>
241          <fileset dir="${src.dir}" defaultexcludes="yes">
242            <include name="**/*.java"/>
243          </fileset>
244        </javadoc>
245    
246      </target>
247    
248    
249    
250      <target name="dist"
251              depends="dist-clean, dist-jar, docs"
252              description="Puts all distributable products in single hierarchy"/>
253    
254    
255      <target name="release"
256              depends="dist"
257              description="Puts entire CVS tree, plus distribution productions, in a jar">
258    
259        <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
260    
261        <jar basedir="${basedir}" destfile="${release.jar}">
262          <!-- <exclude name="build/**"/> -->
263          <exclude name="${release.jar}"/>
264          <exclude name="user.properties"/>
265          <exclude name="etc/notes/**"/>
266          <exclude name="src/emulation/**"/>
267          <exclude name="**/SyntaxTest.java"/>
268          <exclude name="**/SuperfluousAbstract.java"/>
269        </jar>
270    
271      </target>
272    
273    
274    
275      <target name="clean"
276              description="Removes all build products">
277    
278        <delete dir="${build.dir}"/>
279    
280      </target>
281    
282    
283    
284      <target name="dist-clean"
285              description="Removes all build and distribution products">
286    
287        <delete dir="${dist.dir}"/>
288    
289      </target>
290    
291    
292    
293      <!-- Internal targets -->
294    
295    
296      <target name="dist-jar"
297              depends="clean, jar">
298    
299        <copy file="${product.jar}" todir="${dist.dir}"/>
300    
301      </target>
302    
303    
304      <target name="compile-tests"
305              depends="jar">
306    
307        <mkdir dir="${build.testcases.dir}"/>
308    
309        <javac srcdir="${tck.src.dir}"
310              destdir="${build.testcases.dir}"
311              debug="${build.debug}"              debug="${build.debug}"
312         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
313        deprecation="${build.deprecation}"        deprecation="${build.deprecation}"
314             source="${build.sourcelevel}"             source="${build.sourcelevel}"
315               fork="true">               fork="true">
316    
317        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg value="${bootclasspath.args}"/>
318        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <compilerarg line="${build.args}"/>
319          <compilerarg value="-XDignore.symbol.file=true"/>
320    
321          <classpath refid="test.classpath"/>
322    
323      </javac>      </javac>
324    
325        <javac srcdir="${test.src.dir}"
326              destdir="${build.testcases.dir}"
327                debug="${build.debug}"
328           debuglevel="${build.debuglevel}"
329          deprecation="${build.deprecation}"
330               source="${build.sourcelevel}"
331                 fork="true">
332    
333          <include name="jsr166/test/**"/>
334    
335          <compilerarg value="${bootclasspath.args}"/>
336          <compilerarg line="${build.args}"/>
337          <compilerarg value="-XDignore.symbol.file=true"/>
338    
339          <classpath refid="test.classpath"/>
340    
341        </javac>
342    
343    <!--
344        <javac srcdir="${jtreg.src.dir}"
345              destdir="${build.testcases.dir}"
346                debug="${build.debug}"
347           debuglevel="${build.debuglevel}"
348          deprecation="${build.deprecation}"
349               source="${build.sourcelevel}"
350                 fork="true">
351    
352          <compilerarg value="${bootclasspath.args}"/>
353          <compilerarg line="${build.args}"/>
354          <compilerarg value="-XDignore.symbol.file=true"/>
355    
356          <classpath refid="test.classpath"/>
357    
358        </javac>
359    -->
360    
361    </target>    </target>
362    
363    
364    <target name="jar" depends="native-jar, emulation-jar"/>    <target name="run-tests"
365              depends="compile-tests">
366    
367        <!-- May be overridden by user.properties -->
368        <property name="testcase" value="*"/>
369    
370        <mkdir dir="${build.reports.dir}"/>
371    
372        <junit printsummary="true"
373                 showoutput="true"
374              errorProperty="junit.failed"
375            failureProperty="junit.failed"
376                        dir="${build.reports.dir}"
377                       fork="true">
378    
379          <jvmarg value="${bootclasspath.args}"/>
380          <jvmarg value="-server"/>
381          <jvmarg value="-showversion"/>
382    
383          <classpath refid="test.classpath"/>
384    
385          <formatter type="xml"/>
386    
387          <batchtest todir="${build.reports.dir}" unless="no.test.tck">
388            <fileset dir="${tck.src.dir}">
389              <include name="**/${testcase}Test.java"/>
390            </fileset>
391          </batchtest>
392    
393          <batchtest todir="${build.reports.dir}" if="do.test.old">
394            <fileset dir="${test.src.dir}">
395              <include name="jsr166/test/**/${testcase}Test.java"/>
396            </fileset>
397          </batchtest>
398    
399    <!--
400          <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
401            <fileset dir="${jtreg.src.dir}">
402              <include name="**/${testcase}Test.java"/>
403            </fileset>
404          </batchtest>
405    -->
406    
407        </junit>
408    
409      </target>
410    
   <target name="test" depends="init, check-junit, report-tests"  
           description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)"  
   />  
411    
412      <target name="report-tests"
413              depends="run-tests">
414    
415    <target name="checkstyle" depends="filter-src"      <!-- Sets junit.report.format to frames if redirection is present,
416            description="Reports on style errors in Java source (verbose, mostly chaff)">           otherwise sets it to noframes. -->
417        <available property="junit.report.format"
418                      value="frames"
419                  classname="org.apache.xalan.lib.Redirect"
420        />
421        <property name="junit.report.format" value="noframes"/>
422    
423      <taskdef resource="checkstyletask.properties"      <junitreport todir="${build.reports.dir}">
424              classpath="${lib.dir}/checkstyle-all-2.4.jar"/>        <fileset dir="${build.reports.dir}">
425            <include name="TEST-*.xml"/>
426          </fileset>
427          <report format="${junit.report.format}" todir="${build.reports.dir}"
428          />
429        </junitreport>
430    
431      <checkstyle>      <fail message="Test Cases Failed" if="junit.failed"/>
       <formatter type="plain"/>  <!-- also available: type="xml" -->  
       <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>  
     </checkstyle>  
432    
433    </target>    </target>
434    
435    
436    <target name="doccheck" depends="filter-src"    <target name="configure-compiler">
           description="Reports on javadoc style errors (not working yet)">  
437    
438      <delete dir="${build.doccheck.dir}"/>      <property name="unchecked.option" value="-Xlint:unchecked"/>
     <mkdir dir="${build.doccheck.dir}"/>  
439    
440      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"      <condition property="warnunchecked.arg" value="${unchecked.option}">
441           docletpath="${lib.dir}/doccheck.jar"        <istrue value="${build.warnunchecked}"/>
442              destdir="${build.doccheck.dir}">      </condition>
443        <packageset dir="${build.filter.src.dir}"/>  
444      </javadoc>      <property name="warnunchecked.arg" value=""/>
445    
446    
447        <!-- Common options in javac invocations -->
448        <property name="build.args" value="${warnunchecked.arg}"/>
449    
450    </target>    </target>
451    
452    
453    <target name="docs" depends="filter-src"    <target name="configure-tests"
454            description="Builds javadocs with custom tags to build folder">         depends="configure-compiler">
455    
456      <delete dir="${build.javadocs.dir}"/>      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
457      <mkdir dir="${build.javadocs.dir}"/>      <available property="junit.available"
458                   classname="junit.framework.Protectable"/>
459    
460      <javadoc destdir="${build.javadocs.dir}"      <!-- Xalan -->
461                  link="http://java.sun.com/j2se/1.4.1/docs/api"      <available property="xalan.available"
462              overview="${src.dir}/intro.html"                 classname="org.apache.xalan.Version"/>
               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}"/>  
463    
464      </javadoc>  
465        <!-- Ant 1.6beta and later don't need or want this check -->
466        <!--
467        <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
468              unless="junit.available"/>
469    
470        <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
471              unless="xalan.available"/>
472        -->
473    
474    </target>    </target>
475    
476    
477    <!--    <!-- Various demos and test programs -->
    # 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.  
    -->  
   <target name="strip" depends="init">  
478    
     <mkdir dir="${build.stripped.dir}"/>  
479    
480      <javac srcdir="${src.dir}"    <target name="loops" depends="configure-compiler"
481            destdir="${build.stripped.dir}"            description="Benchmark from Doug Lea's AQS paper">
482    
483        <mkdir dir="${build.loops.dir}"/>
484    
485        <javac srcdir="${loops.src.dir}"
486              destdir="${build.loops.dir}"
487              debug="${build.debug}"              debug="${build.debug}"
488         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
489        deprecation="${build.deprecation}"        deprecation="${build.deprecation}"
490             source="${build.sourcelevel}"             source="${build.sourcelevel}"
491               fork="true">               fork="true">
492    
493        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg line="${build.args}"/>
494        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>        <classpath refid="loops.classpath"/>
495          <compilerarg value="-XDignore.symbol.file=true"/>
496    
497      </javac>      </javac>
498    
499        <java classname="ALoops" fork="true">
500          <classpath refid="loops.classpath"/>
501        </java>
502    
503    </target>    </target>
504    
505    
506    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"    <!-- jsr166 4jdk7 -->
507    
508    
509      <target name="4jdk7compile"
510              depends="configure-compiler"
511              description="Compiles src/jdk7 sources, targeting jdk7">
512    
513        <mkdir dir="${build.4jdk7.classes.dir}"/>
514    
515        <javac srcdir="${4jdk7src.dir}"
516               destdir="${build.4jdk7.classes.dir}"
517               debug="${build.debug}"
518               debuglevel="${build.debuglevel}"
519               deprecation="${build.deprecation}"
520               source="6"
521               classpath=""
522               bootclasspath="${bootclasspath6}"
523               includeAntRuntime="false"
524               includeJavaRuntime="false"
525               executable="${javac7}"
526               fork="true">
527    
528          <include name="**/*.java"/>
529          <compilerarg line="${build.args}"/>
530          <compilerarg value="-XDignore.symbol.file=true"/>
531          <compilerarg value="-Xlint:all"/>
532    
533        </javac>
534    
535        <jar destfile="${4jdk7product.jar}" index="true">
536          <fileset dir="${build.4jdk7.classes.dir}"/>
537        </jar>
538    
539        <mkdir dir="${build.4jdk7.tck.classes.dir}"/>
540    
541        <javac srcdir="${tck.src.dir}"
542               destdir="${build.4jdk7.tck.classes.dir}"
543               debug="${build.debug}"
544               debuglevel="${build.debuglevel}"
545               deprecation="${build.deprecation}"
546               source="6"
547               classpath="${junit.jar}"
548               bootclasspath="${4jdk7product.jar}:${bootclasspath6}"
549               includeAntRuntime="false"
550               includeJavaRuntime="false"
551               executable="${javac7}"
552               fork="true">
553    
554          <include name="**/*.java"/>
555          <compilerarg line="${build.args}"/>
556          <compilerarg value="-XDignore.symbol.file=true"/>
557          <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/>
558    
559        </javac>
560    
561      </target>
562    
563    
564      <target name="4jdk7-test-tck"
565              depends="4jdk7compile"
566              description="Runs tck tests for jsr166-4jdk7 directly">
567        <run-tck-tests
568          jvm="${java7}"
569          tck.classes="${build.4jdk7.tck.classes.dir}"
570          product.jar="${4jdk7product.jar}"/>
571      </target>
572    
573    
574      <target name="4jdk7-test-tck-junit"
575              depends="4jdk7compile"
576              description="Runs tck tests for jsr166-4jdk7 via junit task (experimental)">
577    
578        <junit printsummary="true"
579               showoutput="true"
580               errorProperty="junit.failed"
581               failureProperty="junit.failed"
582               includeantruntime="true"
583               jvm="${java7}"
584               fork="true">
585    
586          <jvmarg value="-Xbootclasspath/p:${4jdk7product.jar}"/>
587          <jvmarg value="-server"/>
588    
589          <classpath>
590            <pathelement location="${junit.jar}"/>
591            <pathelement location="${build.4jdk7.tck.classes.dir}"/>
592          </classpath>
593    
594          <formatter type="brief"/>
595    
596          <test name="JSR166TestCase" haltonfailure="no">
597          </test>
598    
599        </junit>
600      </target>
601    
602    
603      <target name="4jdk7docs"
604              description="Builds javadocs for src/jdk7 to dist dir">
605    
606        <delete dir="${dist.4jdk7.docs.dir}"/>
607        <mkdir dir="${dist.4jdk7.docs.dir}"/>
608    
609        <javadoc destdir="${dist.4jdk7.docs.dir}"
610                 packagenames="none"
611                 link="${jdkapi7docs.url}"
612                 overview="${4jdk7src.dir}/intro.html"
613                 sourcepath="${4jdk7src.dir}:${jdk7src.dir}"
614                 classpath=""
615                 executable="${javadoc7}">
616          <arg value="-XDignore.symbol.file=true"/>
617          <fileset dir="${4jdk7src.dir}" defaultexcludes="yes">
618            <include name="**/*.java"/>
619          </fileset>
620        </javadoc>
621    
622      </target>
623    
624    
625      <target name="4jdk7dist"
626              depends="4jdk7dist-clean, 4jdk7dist-jar, 4jdk7docs"
627            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
628    
629    
   <target name="clean"  
           description="Removes all build products">  
630    
631      <delete dir="${build.dir}"/>    <target name="4jdk7clean"
632      <delete dir="${build.classes.dir}"/>            description="Removes all 4jdk7 build products">
633      <delete dir="${build.lib.dir}"/>  
634        <delete dir="${build.4jdk7.dir}"/>
635    
636    </target>    </target>
637    
638    
639    <target name="dist-clean"  
640      <target name="4jdk7dist-clean"
641            description="Removes all build and distribution products">            description="Removes all build and distribution products">
642    
643      <delete dir="${dist.dir}"/>    </target>
644    
645      <target name="4jdk7dist-jar"
646              depends="4jdk7clean, 4jdk7compile">
647    
648        <copy file="${4jdk7product.jar}" todir="${dist.dir}"/>
649    
650    </target>    </target>
651    
652    
653    <!-- Anthill targets -->    <!-- jsr166x -->
654    
655      <target name="jsr166xcompile"
656              depends="configure-compiler"
657              description="Compiles jsr166x sources to build dir">
658    
659        <mkdir dir="${build.jsr166x.dir}"/>
660    
661        <javac srcdir="${topsrc.dir}"
662               destdir="${build.jsr166x.dir}"
663               debug="${build.debug}"
664               debuglevel="${build.debuglevel}"
665               deprecation="${build.deprecation}"
666               classpath=""
667               source="5"
668               bootclasspath="${bootclasspath6}"
669               includeAntRuntime="false"
670               includeJavaRuntime="false"
671               executable="${javac7}"
672               fork="true">
673    
674          <include name="jsr166x/**/*.java"/>
675          <compilerarg line="${build.args}"/>
676          <compilerarg value="-XDignore.symbol.file=true"/>
677          <compilerarg value="-Xlint:all,-unchecked,-rawtypes"/>
678    
679    <!-- Should really run the tests instead of just the jar target -->      </javac>
   <target name="anthill-build" depends="jar, test, docs, dist-docs"/>  
680    
   <target name="anthill-publish">  
     <copy todir="${deployDir}/docs/private">  
       <fileset dir="${build.javadocs.dir}"/>  
     </copy>  
     <copy todir="${deployDir}/docs/public">  
       <fileset dir="${dist.javadocs.dir}"/>  
     </copy>  
     <copy tofile="${deployDir}/index.html"  
           file="${basedir}/etc/anthill-index.html"/>  
     <copy todir="${deployDir}/notes">  
       <fileset dir="${basedir}/etc/notes"/>  
     </copy>  
681    </target>    </target>
682    
683    
   <!-- Internal targets -->  
684    
685    <target name="set-warnings-if" if="build.warnings">    <target name="jsr166xjar"
686              depends="jsr166xcompile"
687              description="Builds library jar from compiled sources">
688    
689      <property name="build.warnings.option" value="-warnunchecked"/>      <jar destfile="${jsr166x.jar}">
690          <fileset dir="${build.jsr166x.dir}"/>
691        </jar>
692    
693    </target>    </target>
694    
695    
   <target name="set-warnings-unless" unless="build.warnings">  
696    
697      <property name="build.warnings.option" value=""/>    <target name="jsr166xdocs"
698              description="Builds javadocs to dist dir">
699    
700        <delete dir="${dist.jsr166xjavadocs.dir}"/>
701        <mkdir dir="${dist.jsr166xjavadocs.dir}"/>
702    
703        <javadoc destdir="${dist.jsr166xjavadocs.dir}"
704                 packagenames="jsr166x.*"
705                 link="${jdkapidocs.url}"
706                 source="5"
707                 bootclasspath="${bootclasspath6}"
708                 sourcepath="${topsrc.dir}:${jdk6src.dir}"
709                 executable="${javadoc7}"
710                 additionalparam="-XDignore.symbol.file=true" />
711    
712    </target>    </target>
713    
714    
715    <target name="init" depends="set-warnings-if, set-warnings-unless">    <target name="jsr166xdist"
716              depends="jsr166xdist-clean, jsr166xdist-jar, jsr166xdocs"
717              description="Puts all distributable products in single hierarchy"/>
718    
719    
720    
721      <!-- Version is kept in a separate file -->    <target name="jsr166xclean"
722      <loadfile property="version" srcFile="version.properties"/>            description="Removes all jsr166x build products">
723      <echo>Building JSR-166 version ${version}</echo>  
724        <delete dir="${build.jsr166x.dir}"/>
725    
726    </target>    </target>
727    
728    
   <target name="native-jar" depends="compile"  
           description="Builds library jar from compiled sources">  
729    
730      <mkdir dir="${build.lib.dir}"/>    <target name="jsr166xdist-clean"
731              description="Removes all build and distribution products">
732    
733      </target>
734    
735      <jar destfile="${product.jar}">  
736        <fileset dir="${build.classes.dir}"/>    <target name="jsr166xdist-jar"
737      </jar>            depends="jsr166xclean, jsr166xjar">
738    
739        <copy file="${jsr166x.jar}" todir="${dist.dir}"/>
740    
741    </target>    </target>
742    
743      <!-- jsr166y -->
744    
   <target name="compile-emulation" depends="init"  
           if="build.emulation"  
           description="Compiles emulation sources to build folder">  
745    
746      <mkdir dir="${build.emulation.dir}"/>    <target name="jsr166ycompile"
747              depends="configure-compiler"
748              description="Compiles jsr166y sources">
749    
750      <javac srcdir="${emulation.src.dir}"      <mkdir dir="${build.jsr166y.dir}"/>
           destdir="${build.emulation.dir}"  
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
751    
752        <bootclasspath refid="javac.bootclasspath"/>      <javac srcdir="${topsrc.dir}"
753        <compilerarg line="${javac.args} ${build.warnings.option}"/>             destdir="${build.jsr166y.dir}"
754               debug="${build.debug}"
755               debuglevel="${build.debuglevel}"
756               deprecation="${build.deprecation}"
757               source="6"
758               classpath=""
759               bootclasspath="${bootclasspath6}"
760               includeAntRuntime="false"
761               includeJavaRuntime="false"
762               executable="${javac7}"
763               fork="true">
764    
765          <include name="jsr166y/**/*.java"/>
766          <compilerarg line="${build.args}"/>
767          <compilerarg value="-XDignore.symbol.file=true"/>
768          <compilerarg value="-Xlint:all"/>
769      </javac>      </javac>
   
770    </target>    </target>
771    
772    
773    <target name="emulation-jar" depends="native-jar, compile-emulation"    <target name="jsr166yjar"
774            if="build.emulation">            depends="jsr166ycompile"
775              description="Builds library jar from compiled sources">
776    
777      <jar destfile="${product.jar}" update="true" duplicate="add">      <jar destfile="${jsr166y.jar}" index="true">
778        <fileset dir="${build.emulation.dir}"/>        <fileset dir="${build.jsr166y.dir}"/>
779      </jar>      </jar>
780    
781    </target>    </target>
782    
783    
   <target name="dist-jar" depends="clean, jar">  
784    
785      <copy file="${product.jar}" todir="${dist.dir}"/>    <target name="jsr166ydocs"
786              description="Builds javadocs to dist dir">
787    
788        <delete dir="${dist.jsr166yjavadocs.dir}"/>
789        <mkdir dir="${dist.jsr166yjavadocs.dir}"/>
790    
791        <javadoc destdir="${dist.jsr166yjavadocs.dir}"
792                 packagenames="jsr166y.*"
793                 link="${jdkapidocs.url}"
794                 source="6"
795                 bootclasspath="${bootclasspath6}"
796                 sourcepath="${topsrc.dir}:${jdk6src.dir}"
797                 executable="${javadoc7}"
798                 additionalparam="-XDignore.symbol.file=true" />
799    
800    </target>    </target>
801    
802    
803    <target name="dist-docs" depends="filter-src"    <target name="jsr166ydist"
804            description="Builds javadocs without custom tags to dist folder">            depends="jsr166ydist-clean, jsr166ydist-jar, jsr166ydocs"
805              description="Puts all distributable products in single hierarchy"/>
806    
     <delete dir="${dist.javadocs.dir}"/>  
     <mkdir dir="${dist.javadocs.dir}"/>  
807    
     <javadoc destdir="${dist.javadocs.dir}"  
                 link="http://java.sun.com/j2se/1.4.1/docs/api"  
             overview="${src.dir}/intro.html"  
               source="${build.docsourcelevel}">  
808    
809        <packageset dir="${build.filter.src.dir}"/>    <target name="jsr166yclean"
810              description="Removes all jsr166y build products">
811    
812      </javadoc>      <delete dir="${build.jsr166y.dir}"/>
813    
814    </target>    </target>
815    
816    
   <target name="compile-ant-filter" depends="init">  
817    
818      <mkdir dir="${build.ant.dir}"/>    <target name="jsr166ydist-clean"
819              description="Removes all build and distribution products">
820    
821      <javac srcdir="${ant.src.dir}"    </target>
822            destdir="${build.ant.dir}"  
823             source="1.4"    <target name="jsr166ydist-jar"
824      />            depends="jsr166yclean, jsr166yjar">
825    
826        <copy file="${jsr166y.jar}" todir="${dist.dir}"/>
827    
828    </target>    </target>
829    
830    
831    <target name="filter-src" depends="compile-ant-filter">    <!-- extra166y -->
832    
     <mkdir dir="${build.filter.src.dir}"/>  
833    
834      <copy todir="${build.filter.src.dir}">    <target name="extra166ycompile"
835        <fileset dir="${src.dir}">            depends="configure-compiler, jsr166yjar"
836          <include name="**/*.java"/>            description="Compiles extra166y sources">
837          <exclude name="**/Random.java"/>  
838          <exclude name="**/Unsafe.java"/>      <mkdir dir="${build.extra166y.dir}"/>
839        </fileset>  
840        <filterchain>      <javac srcdir="${topsrc.dir}"
841          <filterreader classname="jsr166.ant.filters.ReplaceFilter"             destdir="${build.extra166y.dir}"
842                        classpath="${build.ant.dir}">             debug="${build.debug}"
843            <!--             debuglevel="${build.debuglevel}"
844             # These arguments are to get rid of angle-bracketed type             deprecation="${build.deprecation}"
845             # parameters so that javadoc can run on the result. The             classpath=""
846             # following heuristic that seems to work:             source="6"
847             #             bootclasspath="${jsr166y.jar}:${bootclasspath6}"
848             # For all lines not starting with space(s)-asterisk-space(s),             includeAntRuntime="false"
849             #   replace <something> with a space, where there may be more             includeJavaRuntime="false"
850             #   than one right angle bracket at the end, and "something"             executable="${javac7}"
851             #   must not contain parens or pipes. (This may need some             fork="true">
852             #   tweaking.)  
853             -->        <include name="extra166y/**/*.java"/>
854            <param name="notmatching" value="^\s+\*\s.*$"/>        <compilerarg line="${build.args}"/>
855            <param name="pattern" value="&lt;[^|>()]+?>+"/>        <compilerarg value="-XDignore.symbol.file=true"/>
856            <param name="replacement" value=" "/>        <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial"/>
857          </filterreader>  
858          <filterreader classname="jsr166.ant.filters.ReplaceFilter"      </javac>
                       classpath="${build.ant.dir}">  
           <!--  
            # These arguments are to uncomment lines beginning with  
            # "//@" so that javadoc can see imports that are needed  
            # to resolve links but that shouldn't be in the compiled  
            # code.  
            -->  
           <param name="matching" value="^//@.*$"/>  
           <param name="pattern" value="^//@"/>  
           <param name="replacement" value=""/>  
         </filterreader>  
       </filterchain>  
     </copy>  
859    
860    </target>    </target>
861    
862    
   <target name="compile-tests" depends="jar">  
863    
864      <mkdir dir="${build.testcases.dir}"/>    <target name="extra166yjar"
865              depends="extra166ycompile"
866              description="Builds library jar from compiled sources">
867    
868      <javac srcdir="${test.src.dir}"      <jar destfile="${extra166y.jar}" index="true">
869            destdir="${build.testcases.dir}"        <fileset dir="${build.extra166y.dir}"/>
870              debug="${build.debug}"      </jar>
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
871    
872        <bootclasspath refid="javac.bootclasspath"/>    </target>
873        <compilerarg line="${javac.args} ${build.warnings.option}"/>  
874        <classpath refid="test.classpath"/>  
875    
876      <target name="extra166ydocs"
877              description="Builds javadocs to build dir">
878    
879        <delete dir="${dist.extra166yjavadocs.dir}"/>
880        <mkdir dir="${dist.extra166yjavadocs.dir}"/>
881    
882        <javadoc destdir="${dist.extra166yjavadocs.dir}"
883                 packagenames="extra166y.*"
884                 link="${jdkapidocs.url}"
885                 source="6"
886                 bootclasspath="${bootclasspath6}"
887                 sourcepath="${topsrc.dir}:${jdk6src.dir}"
888                 executable="${javadoc7}"
889                 additionalparam="-XDignore.symbol.file=true" />
890    
891      </target>
892    
893    
894      <target name="extra166ydist"
895              depends="extra166ydist-clean, extra166ydist-jar, extra166ydocs"
896              description="Puts all distributable products in single hierarchy"/>
897    
898    
899    
900      <target name="extra166yclean"
901              description="Removes all extra166y build products">
902    
903        <delete dir="${build.extra166y.dir}"/>
904    
905      </target>
906    
907    
908    
909      <target name="extra166ydist-clean"
910              description="Removes all build and distribution products">
911    
912      </target>
913    
914      <target name="extra166ydist-jar"
915              depends="extra166yclean, extra166yjar">
916    
917        <copy file="${extra166y.jar}" todir="${dist.dir}"/>
918    
919      </target>
920    
921      <!-- jsr166e -->
922    
923      <target name="jsr166ecompile"
924              depends="configure-compiler"
925              description="Compiles jsr166e sources">
926    
927        <mkdir dir="${build.jsr166e.dir}"/>
928    
929        <javac srcdir="${topsrc.dir}"
930               destdir="${build.jsr166e.dir}"
931               debug="${build.debug}"
932               debuglevel="${build.debuglevel}"
933               deprecation="${build.deprecation}"
934               source="7"
935               classpath=""
936               includeAntRuntime="false"
937               includeJavaRuntime="false"
938               executable="${javac7}"
939               fork="true">
940    
941          <include name="jsr166e/**/*.java"/>
942          <compilerarg line="${build.args}"/>
943          <compilerarg value="-XDignore.symbol.file=true"/>
944          <compilerarg value="-Xlint:all"/>
945    
946      </javac>      </javac>
947    
948    </target>    </target>
949    
950    
   <target name="run-tests" depends="compile-tests">  
951    
952      <!-- May be overridden by user.properties -->    <target name="jsr166ejar"
953      <property name="testcase" value="*"/>            depends="jsr166ecompile"
954              description="Builds library jar from compiled sources">
955    
956      <mkdir dir="${build.reports.dir}"/>      <jar destfile="${jsr166e.jar}" index="true">
957          <fileset dir="${build.jsr166e.dir}"/>
958        </jar>
959    
960      <junit printsummary="true"    </target>
              showoutput="true"  
           errorProperty="junit.failed"  
         failureProperty="junit.failed"  
                     dir="${build.reports.dir}"  
                    fork="true">  
961    
       <jvmarg value="${test.javac.args}"/>  
962    
       <formatter type="xml"/>  
963    
964        <batchtest todir="${build.reports.dir}">    <target name="jsr166edocs"
965          <fileset dir="${test.src.dir}">            description="Builds javadocs to build dir">
           <include name="**/${testcase}Test.java"/>  
         </fileset>  
       </batchtest>  
966    
967      </junit>      <delete dir="${dist.jsr166ejavadocs.dir}"/>
968        <mkdir dir="${dist.jsr166ejavadocs.dir}"/>
969    
970        <javadoc destdir="${dist.jsr166ejavadocs.dir}"
971                 packagenames="jsr166e.*"
972                 link="${jdkapidocs.url}"
973                 source="7"
974                 sourcepath="${topsrc.dir}:${jdk7src.dir}"
975                 executable="${javadoc7}"
976                 additionalparam="-XDignore.symbol.file=true" >
977        </javadoc>
978    
979    </target>    </target>
980    
981    
982    <target name="report-tests" depends="run-tests">    <target name="jsr166edist"
983      <!-- Sets junit.report.format to frames if Xalan is present,            depends="jsr166edist-clean, jsr166edist-jar, jsr166edocs"
984           otherwise sets it to noframes. -->            description="Puts all distributable products in single hierarchy"/>
     <available property="junit.report.format"  
                   value="frames"  
               classname="org.apache.xalan.lib.Redirect"  
     />  
     <property name="junit.report.format" value="noframes"/>  
985    
     <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>  
986    
987      <fail message="Test Cases Failed" if="junit.failed"/>  
988      <target name="jsr166eclean"
989              description="Removes all jsr166e build products">
990    
991        <delete dir="${build.jsr166e.dir}"/>
992    
993    </target>    </target>
994    
995    
996    <target name="check-junit">    <target name="jsr166edist-clean"
997      <!-- FIXME: this test isn't specific enough -->            description="Removes all build and distribution products">
998      <available property="junit.available"  
                classname="junit.framework.TestCase"/>  
     <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>  
999    </target>    </target>
1000    
1001      <target name="jsr166edist-jar"
1002              depends="jsr166eclean, jsr166ejar">
1003    
1004        <copy file="${jsr166e.jar}" todir="${dist.dir}"/>
1005    
1006      </target>
1007    
1008  </project>  </project>

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.110

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