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

Diff of /jsr166/build.xml

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

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

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.104

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