/[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.91 by jsr166, Sun Nov 18 06:21:11 2012 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]
   </description>  
8    
9      User-specific settings are read from user.properties.
10      See user.properties.sample for an explanation of some useful settings.
11    ------------------------------------------------------------------------------
12      </description>
13    
14    <target name="usage" description="Prints this message">    <target name="usage" description="Advises user to run with -projecthelp">
15      <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>  
16    </target>    </target>
17    
18    
19    <!-- User-specific settings -->    <!-- User-specific settings -->
20    <property file="user.properties"/>    <property file="user.properties"/>
21    
   <!-- Set build.warnings in user.properties to turn on -warnunchecked -->  
   <!-- <property name="build.warnings" value=""/> -->  
   
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.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="javac.jar"            location="${lib.dir}/javac.jar"/>    <property name="jsr166xproduct.jar"   location="${build.jsr166xlib.dir}/jsr166x.jar"/>
78    <property name="collect.jar"          location="${lib.dir}/collect.jar"/>    <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     ! Bootclasspath munging for source compilation.    <property name="jdkapi5docs.url"      value="http://docs.oracle.com/javase/1.5.0/docs/api/"/>
88     -->    <property name="jdkapi6docs.url"      value="http://docs.oracle.com/javase/6/docs/api/"/>
89      <property name="jdkapi7docs.url"      value="http://docs.oracle.com/javase/7/docs/api/"/>
90    <path id="javac.bootclasspath.prepend">  
91      <!-- <pathelement location="${src.dir}"/> -->    <property name="jdkapi8docs.url"      value="http://download.java.net/jdk8/docs/api/"/>
92      <pathelement location="${javac.jar}"/>    <!-- The below does not yet exist as of 2012-11 -->
93    </path>    <!-- <property name="jdkapi8docs.url" value="http://docs.oracle.com/javase/8/docs/api/"/> -->
94      <property name="jdkapidocs.url"       value="${jdkapi7docs.url}"/>
   <path id="javac.bootclasspath">  
     <!-- <pathelement location="${src.dir}"/> -->  
     <pathelement location="${collect.jar}"/>  
     <pathelement location="${rt.jar}"/>  
   </path>  
   
   <!-- Flatten bootclasspath prefix into a platform-appropriate string -->  
   <property name="javac.bootclasspath.prepend" refid="javac.bootclasspath.prepend"/>  
   
   <!-- Turn the flattened bootclasspath prefix into a javac argument -->  
   <property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prepend}'/>  
   
   
   <!--  
    ! Bootclasspath munging for testing, so JUnit can test our local  
    ! modifications to java.*.  
    -->  
95    
96      <!-- Test classpath -->
97    <path id="test.classpath">    <path id="test.classpath">
     <pathelement location="${product.jar}"/>  
98      <pathelement location="${build.testcases.dir}"/>      <pathelement location="${build.testcases.dir}"/>
99      <pathelement location="${junit.jar}"/>      <pathelement location="${junit.jar}"/>
100    </path>    </path>
101    
102    <!-- Flatten test classpath into a platform-appropriate string -->    <!-- ALoops classpath -->
103    <property name="test.classpath" refid="test.classpath"/>    <path id="loops.classpath">
104        <pathelement location="${build.loops.dir}"/>
105    <!-- Turn the flattened test classpath into a javac argument -->    </path>
   <property name="test.javac.args" value='-Xbootclasspath/p:${test.classpath}'/>  
   
106    
107    
108    <!-- Main targets -->    <!-- Main targets -->
109    
110    <target name="compile" depends="init"    <target name="dists"
111              depends="dist, jsr166xdist, jsr166ydist,jsr166edist,  extra166ydist"
112              description="Builds all public jars and docs"/>
113    
114      <target name="compile"
115              depends="init, configure-compiler"
116            description="Compiles main sources to build folder">            description="Compiles main sources to build folder">
117    
118      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
# Line 130  ant [target], where target is one of: Line 125  ant [target], where target is one of:
125             source="${build.sourcelevel}"             source="${build.sourcelevel}"
126               fork="true">               fork="true">
127    
128        <bootclasspath refid="javac.bootclasspath"/>        <include name="**/*.java"/>
129        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <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="native-jar, emulation-jar"/>  
142    
143      <target name="jar"
144              depends="compile"
145              description="Builds library jar from compiled sources">
146    
147    <target name="test" depends="init, check-junit, report-tests"      <mkdir dir="${build.lib.dir}"/>
           description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)"  
   />  
148    
149        <jar destfile="${product.jar}">
150          <fileset dir="${build.classes.dir}"/>
151        </jar>
152    
153    <target name="checkstyle" depends="filter-src"    </target>
           description="Reports on style errors in Java source (verbose, mostly chaff)">  
154    
     <taskdef resource="checkstyletask.properties"  
             classpath="${lib.dir}/checkstyle-all-2.4.jar"/>  
155    
     <checkstyle>  
       <formatter type="plain"/>  <!-- also available: type="xml" -->  
       <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>  
     </checkstyle>  
156    
157    </target>    <target name="test"
158              depends="init, configure-tests, report-tests"
159              description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
160    
161    
   <target name="doccheck" depends="filter-src"  
           description="Reports on javadoc style errors (not working yet)">  
162    
163      <delete dir="${build.doccheck.dir}"/>    <target name="docs"
164      <mkdir dir="${build.doccheck.dir}"/>            description="Builds javadocs with custom tags to build folder">
165    
166      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"      <delete dir="${build.javadocs.dir}"/>
167           docletpath="${lib.dir}/doccheck.jar"      <mkdir dir="${build.javadocs.dir}"/>
168              destdir="${build.doccheck.dir}">  
169        <packageset dir="${build.filter.src.dir}"/>      <!-- the packagenames="none" hack below prevents scanning the -->
170        <!-- sourcepath for packages -->
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="docs" depends="filter-src"  
           description="Builds javadocs with custom tags to build folder">  
186    
187      <delete dir="${build.javadocs.dir}"/>    <target name="dist"
188      <mkdir dir="${build.javadocs.dir}"/>            depends="init, dist-clean, dist-jar, dist-docs"
189              description="Puts all distributable products in single hierarchy"/>
190    
     <javadoc destdir="${build.javadocs.dir}"  
                 link="http://java.sun.com/j2se/1.4.1/docs/api"  
             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}"/>  
191    
192      <target name="release"
193              depends="dist"
194              description="Puts entire CVS tree, plus distribution productions, in a jar">
195    
196        <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
197    
198        <jar basedir="${basedir}" destfile="${release.jar}">
199          <!-- <exclude name="build/**"/> -->
200          <exclude name="${release.jar}"/>
201          <exclude name="user.properties"/>
202          <exclude name="etc/notes/**"/>
203          <exclude name="src/emulation/**"/>
204          <exclude name="**/SyntaxTest.java"/>
205          <exclude name="**/SuperfluousAbstract.java"/>
206        </jar>
207    
208      </target>
209    
210    
211    
212      <target name="clean"
213              description="Removes all build products">
214    
215        <delete dir="${build.dir}"/>
216        <delete dir="${build.classes.dir}"/>
217        <delete dir="${build.lib.dir}"/>
218    
219      </target>
220    
221    
222    
223      <target name="dist-clean"
224              description="Removes all build and distribution products">
225    
226        <delete dir="${dist.dir}"/>
227    
228      </target>
229    
230    
231    
232      <target name="dist-docs"
233              description="Builds javadocs without custom tags to dist folder">
234    
235        <delete dir="${dist.javadocs.dir}"/>
236        <mkdir dir="${dist.javadocs.dir}"/>
237    
238        <!-- the packagenames="none" hack below prevents scanning the -->
239        <!-- sourcepath for packages -->
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>
253    
254    
   <!--  
    # 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">  
255    
256      <mkdir dir="${build.stripped.dir}"/>    <!-- Internal targets -->
257    
258      <javac srcdir="${src.dir}"  
259            destdir="${build.stripped.dir}"    <target name="init">
260    
261        <!-- Version is kept in a separate file -->
262        <loadfile property="version" srcFile="version.properties"/>
263        <echo>Building JSR-166 version ${version}</echo>
264        <echo>java.home is ${java.home}</echo>
265    
266      </target>
267    
268    
269      <target name="dist-jar"
270              depends="clean, jar">
271    
272        <copy file="${product.jar}" todir="${dist.dir}"/>
273    
274      </target>
275    
276    
277      <target name="compile-tests"
278              depends="jar">
279    
280        <mkdir dir="${build.testcases.dir}"/>
281    
282        <javac srcdir="${tck.src.dir}"
283              destdir="${build.testcases.dir}"
284              debug="${build.debug}"              debug="${build.debug}"
285         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
286        deprecation="${build.deprecation}"        deprecation="${build.deprecation}"
287             source="${build.sourcelevel}"             source="${build.sourcelevel}"
288               fork="true">               fork="true">
289    
290        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg value="${bootclasspath.args}"/>
291        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>        <compilerarg line="${build.args}"/>
292          <compilerarg value="-XDignore.symbol.file=true"/>
293    
294          <classpath refid="test.classpath"/>
295    
296      </javac>      </javac>
297    
298        <javac srcdir="${test.src.dir}"
299              destdir="${build.testcases.dir}"
300                debug="${build.debug}"
301           debuglevel="${build.debuglevel}"
302          deprecation="${build.deprecation}"
303               source="${build.sourcelevel}"
304                 fork="true">
305    
306          <include name="jsr166/test/**"/>
307    
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>
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="dist" depends="init, dist-clean, dist-jar, dist-docs"    <target name="run-tests"
338            description="Puts all distributable products in single hierarchy"/>            depends="compile-tests">
339    
340        <!-- May be overridden by user.properties -->
341        <property name="testcase" value="*"/>
342    
343        <mkdir dir="${build.reports.dir}"/>
344    
345    <target name="clean"      <junit printsummary="true"
346            description="Removes all build products">               showoutput="true"
347              errorProperty="junit.failed"
348            failureProperty="junit.failed"
349                        dir="${build.reports.dir}"
350                       fork="true">
351    
352      <delete dir="${build.dir}"/>        <jvmarg value="${bootclasspath.args}"/>
353      <delete dir="${build.classes.dir}"/>        <jvmarg value="-server"/>
354      <delete dir="${build.lib.dir}"/>        <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>    </target>
383    
384    
385    <target name="dist-clean"    <target name="report-tests"
386            description="Removes all build and distribution products">            depends="run-tests">
387    
388      <delete dir="${dist.dir}"/>      <!-- Sets junit.report.format to frames if redirection is present,
389             otherwise sets it to noframes. -->
390        <available property="junit.report.format"
391                      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>
400          <report format="${junit.report.format}" todir="${build.reports.dir}"
401          />
402        </junitreport>
403    
404        <fail message="Test Cases Failed" if="junit.failed"/>
405    
406    </target>    </target>
407    
408    
409    <!-- Anthill targets -->    <target name="configure-compiler">
410    
411        <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    <!-- Should really run the tests instead of just the jar target -->      <!-- Common options in javac invocations -->
421    <target name="anthill-build" depends="jar, test, docs, dist-docs"/>      <property name="build.args" value="${warnunchecked.arg}"/>
422    
   <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>  
423    </target>    </target>
424    
425    
426    <!-- Internal targets -->    <target name="configure-tests"
427           depends="configure-compiler">
428    
429        <!-- 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    <target name="set-warnings-if" if="build.warnings">      <!-- Xalan -->
434        <available property="xalan.available"
435                   classname="org.apache.xalan.Version"/>
436    
437      <property name="build.warnings.option" value="-warnunchecked"/>  
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="set-warnings-unless" unless="build.warnings">    <!-- Various demos and test programs -->
451    
452    
453      <property name="build.warnings.option" value=""/>    <target name="loops" depends="init, configure-compiler"
454              description="Benchmark from Doug Lea's AQS paper">
455    
456        <mkdir dir="${build.loops.dir}"/>
457    
458        <javac srcdir="${loops.src.dir}"
459              destdir="${build.loops.dir}"
460                debug="${build.debug}"
461           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>    </target>
477    
478    
479    <target name="init" depends="set-warnings-if, set-warnings-unless">    <!-- jsr166x -->
480    
481      <!-- Version is kept in a separate file -->  
482      <loadfile property="version" srcFile="version.properties"/>    <target name="jsr166xcompile"
483      <echo>Building JSR-166 version ${version}</echo>            depends="init, configure-compiler"
484              description="Compiles jsr166x sources">
485    
486        <mkdir dir="${build.jsr166x.dir}"/>
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          <compilerarg line="${build.args}"/>
498          <compilerarg value="-XDignore.symbol.file=true"/>
499    
500        </javac>
501    
502    </target>    </target>
503    
504    
505    <target name="native-jar" depends="compile"  
506      <target name="jsr166xjar"
507              depends="jsr166xcompile"
508            description="Builds library jar from compiled sources">            description="Builds library jar from compiled sources">
509    
510      <mkdir dir="${build.lib.dir}"/>      <mkdir dir="${build.jsr166xlib.dir}"/>
511    
512      <jar destfile="${product.jar}">      <jar destfile="${jsr166xproduct.jar}">
513        <fileset dir="${build.classes.dir}"/>        <fileset dir="${build.jsr166x.dir}"/>
514      </jar>      </jar>
515    
516    </target>    </target>
517    
518    
   <target name="compile-emulation" depends="init"  
           if="build.emulation"  
           description="Compiles emulation sources to build folder">  
519    
520      <mkdir dir="${build.emulation.dir}"/>    <target name="jsr166xdocs"
521              description="Builds javadocs with custom tags to build folder">
522    
523        <delete dir="${build.jsr166xjavadocs.dir}"/>
524        <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>
534    
535    
536      <target name="jsr166xdist"
537              depends="jsr166xdist-clean, jsr166xdist-jar, jsr166xdist-docs"
538              description="Puts all distributable products in single hierarchy"/>
539    
540    
541    
542      <target name="jsr166xclean"
543              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="${emulation.src.dir}"      <javac srcdir="${jsr166ysrc.dir}"
591            destdir="${build.emulation.dir}"            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        <bootclasspath refid="javac.bootclasspath"/>        <include name="**/*.java"/>
599        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <compilerarg line="${build.args}"/>
600          <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="emulation-jar" depends="native-jar, compile-emulation"  
           if="build.emulation">  
610    
611      <jar destfile="${product.jar}" update="true" duplicate="add">    <target name="jsr166yjar"
612        <fileset dir="${build.emulation.dir}"/>            depends="jsr166ycompile"
613              description="Builds library jar from compiled sources">
614    
615        <mkdir dir="${build.jsr166ylib.dir}"/>
616    
617        <jar destfile="${jsr166yproduct.jar}" index="true">
618          <fileset dir="${build.jsr166y.dir}"/>
619      </jar>      </jar>
620    
621    </target>    </target>
622    
623    
   <target name="dist-jar" depends="clean, jar">  
624    
625      <copy file="${product.jar}" todir="${dist.dir}"/>    <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>
639    
640    
641      <target name="jsr166ydist"
642              depends="jsr166ydist-clean, jsr166ydist-jar, jsr166ydist-docs"
643              description="Puts all distributable products in single hierarchy"/>
644    
645    
646    
647      <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    
656    <target name="dist-docs" depends="filter-src"  
657      <target name="jsr166ydist-clean"
658              description="Removes all build and distribution products">
659    
660      </target>
661    
662      <target name="jsr166ydist-docs"
663            description="Builds javadocs without custom tags to dist folder">            description="Builds javadocs without custom tags to dist folder">
664    
665      <delete dir="${dist.javadocs.dir}"/>      <delete dir="${dist.jsr166yjavadocs.dir}"/>
666      <mkdir dir="${dist.javadocs.dir}"/>      <mkdir dir="${dist.jsr166yjavadocs.dir}"/>
667    
668      <javadoc destdir="${dist.javadocs.dir}"      <javadoc destdir="${dist.jsr166yjavadocs.dir}"
669                  link="http://java.sun.com/j2se/1.4.1/docs/api"               packagenames="jsr166y"
670              overview="${src.dir}/intro.html"               link="${jdkapidocs.url}"
671                source="${build.docsourcelevel}">               source="${build.sourcelevel}"
672                 sourcepath="${topsrc.dir}:${jdksrc.dir}"
673                 additionalparam="-XDignore.symbol.file=true" />
674    
675      </target>
676    
677        <packageset dir="${build.filter.src.dir}"/>    <target name="jsr166ydist-jar"
678              depends="jsr166yclean, jsr166yjar">
679    
680      </javadoc>      <copy file="${jsr166yproduct.jar}" todir="${dist.dir}"/>
681    
682    </target>    </target>
683    
684    
685    <target name="compile-ant-filter" depends="init">    <!-- extra166y -->
686    
     <mkdir dir="${build.ant.dir}"/>  
687    
688      <javac srcdir="${ant.src.dir}"    <target name="extra166ycompile"
689            destdir="${build.ant.dir}"            depends="init, configure-compiler, jsr166ycompile"
690             source="1.4"            description="Compiles extra166y sources">
691      />  
692        <mkdir dir="${build.extra166y.dir}"/>
693    
694        <javac srcdir="${extra166ysrc.dir}"
695              destdir="${build.extra166y.dir}"
696                debug="${build.debug}"
697                classpath="${jsr166yproduct.jar}"
698           debuglevel="${build.debuglevel}"
699          deprecation="${build.deprecation}"
700               source="${build.sourcelevel}"
701                 fork="true">
702    
703          <include name="**/*.java"/>
704          <compilerarg line="${build.args}"/>
705          <compilerarg value="-XDignore.symbol.file=true"/>
706          <compilerarg value="${bootclasspath.args}"/>
707    
708    <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
709    
710        </javac>
711    
712      </target>
713    
714    
715    
716      <target name="extra166yjar"
717              depends="extra166ycompile"
718              description="Builds library jar from compiled sources">
719    
720        <mkdir dir="${build.extra166ylib.dir}"/>
721    
722        <jar destfile="${extra166yproduct.jar}" index="true">
723          <fileset dir="${build.extra166y.dir}"/>
724        </jar>
725    
726    </target>    </target>
727    
728    
   <target name="filter-src" depends="compile-ant-filter">  
729    
730      <mkdir dir="${build.filter.src.dir}"/>    <target name="extra166ydocs"
731              description="Builds javadocs with custom tags to build folder">
732    
733        <delete dir="${build.extra166yjavadocs.dir}"/>
734        <mkdir dir="${build.extra166yjavadocs.dir}"/>
735    
736      <copy todir="${build.filter.src.dir}">      <javadoc destdir="${build.extra166yjavadocs.dir}"
737        <fileset dir="${src.dir}">               packagenames="extra166y"
738          <include name="**/*.java"/>               link="${jdkapidocs.url}"
739          <exclude name="**/Random.java"/>               source="${build.sourcelevel}"
740          <exclude name="**/Unsafe.java"/>               sourcepath="${topsrc.dir}:${jdksrc.dir}"
741        </fileset>               additionalparam="-XDignore.symbol.file=true" />
       <filterchain>  
         <filterreader classname="jsr166.ant.filters.ReplaceFilter"  
                       classpath="${build.ant.dir}">  
           <!--  
            # These arguments are to get rid of angle-bracketed type  
            # parameters so that javadoc can run on the result. The  
            # following heuristic that 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.)  
            -->  
           <param name="notmatching" value="^\s+\*\s.*$"/>  
           <param name="pattern" value="&lt;[^|>()]+?>+"/>  
           <param name="replacement" value=" "/>  
         </filterreader>  
         <filterreader classname="jsr166.ant.filters.ReplaceFilter"  
                       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>  
742    
743    </target>    </target>
744    
745    
746    <target name="compile-tests" depends="jar">    <target name="extra166ydist"
747              depends="extra166ydist-clean, extra166ydist-jar, extra166ydist-docs"
748              description="Puts all distributable products in single hierarchy"/>
749    
750    
     <mkdir dir="${build.testcases.dir}"/>  
751    
752      <javac srcdir="${test.src.dir}"    <target name="extra166yclean"
753            destdir="${build.testcases.dir}"            description="Removes all build products">
754    
755        <delete dir="${build.extra166y.dir}"/>
756        <delete dir="${build.extra166ylib.dir}"/>
757    
758      </target>
759    
760    
761    
762      <target name="extra166ydist-clean"
763              description="Removes all build and distribution products">
764    
765      </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      </target>
781    
782      <target name="extra166ydist-jar"
783              depends="extra166yclean, extra166yjar">
784    
785        <copy file="${extra166yproduct.jar}" todir="${dist.dir}"/>
786    
787      </target>
788    
789      <!-- jsr166e -->
790    
791    
792      <target name="jsr166ecompile"
793              depends="init, configure-compiler"
794              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}"              debug="${build.debug}"
801         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
802        deprecation="${build.deprecation}"        deprecation="${build.deprecation}"
803             source="${build.sourcelevel}"             source="1.7"
804               fork="true">               fork="true">
805    
806        <bootclasspath refid="javac.bootclasspath"/>        <include name="**/*.java"/>
807        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <compilerarg line="${build.args}"/>
808        <classpath refid="test.classpath"/>        <compilerarg value="-XDignore.symbol.file=true"/>
809          <compilerarg value="${bootclasspath.args}"/>
810    
811    <!--       <compilerarg line="-Xlint -Xmaxwarns 1000"/> -->
812    
813      </javac>      </javac>
814    
815    </target>    </target>
816    
817    
   <target name="run-tests" depends="compile-tests">  
818    
819      <!-- May be overridden by user.properties -->    <target name="jsr166ejar"
820      <property name="testcase" value="*"/>            depends="jsr166ecompile"
821              description="Builds library jar from compiled sources">
822    
823      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.jsr166elib.dir}"/>
824    
825      <junit printsummary="true"      <jar destfile="${jsr166eproduct.jar}" index="true">
826               showoutput="true"        <fileset dir="${build.jsr166e.dir}"/>
827            errorProperty="junit.failed"      </jar>
         failureProperty="junit.failed"  
                     dir="${build.reports.dir}"  
                    fork="true">  
828    
829        <jvmarg value="${test.javac.args}"/>    </target>
830    
       <formatter type="xml"/>  
831    
       <batchtest todir="${build.reports.dir}">  
         <fileset dir="${test.src.dir}">  
           <include name="**/${testcase}Test.java"/>  
         </fileset>  
       </batchtest>  
832    
833      </junit>    <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    
846    </target>    </target>
847    
848    
849    <target name="report-tests" depends="run-tests">    <target name="jsr166edist"
850      <!-- Sets junit.report.format to frames if Xalan is present,            depends="jsr166edist-clean, jsr166edist-jar, jsr166edist-docs"
851           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"/>  
852    
     <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>  
853    
854      <fail message="Test Cases Failed" if="junit.failed"/>  
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>    </target>
862    
863    
864    <target name="check-junit">  
865      <!-- FIXME: this test isn't specific enough -->    <target name="jsr166edist-clean"
866      <available property="junit.available"            description="Removes all build and distribution products">
867                 classname="junit.framework.TestCase"/>  
868      <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>    </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>    </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.27  
changed lines
  Added in v.1.91

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