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

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

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