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

Diff of /jsr166/build.xml

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

revision 1.68 by jsr166, Mon Jun 14 17:22:09 2004 UTC revision 1.266 by jsr166, Tue Feb 20 22:17:16 2018 UTC
# Line 1  Line 1 
1  <project name="jsr166" default="usage">  <project name="jsr166" default="usage"
2      xmlns:if="ant:if"
3      xmlns:unless="ant:unless"
4      xmlns:ivy="antlib:org.apache.ivy.ant">
5    
6    <description>    <description>
7  ------------------------------------------------------------------------------  ------------------------------------------------------------------------------
# Line 6  Line 9 
9    
10    Usage: ant [target]    Usage: ant [target]
11    
12      See http://gee.cs.oswego.edu/dl/concurrency-interest/index.html for
13      more details.
14    
15    User-specific settings are read from user.properties.    User-specific settings are read from user.properties.
16    See user.properties.sample for an explanation of some useful settings.    See user.properties.sample for an explanation of some useful settings.
17    
18      The repository contains all dependencies except for ant and the JDK
19      itself.  Because the JDK version matters and because different
20      targets require different JDKs, we assume that users have created a
21      hierarchy containing:
22      $HOME/jdk/jdk8
23      $HOME/jdk/jdk9
24      $HOME/jdk/jdk10
25      $HOME/jdk/jdk11
26      where each of the above is a JDK or a symlink to same, and
27      $HOME/jdk/src/jdk8
28      $HOME/jdk/src/jdk9
29      $HOME/jdk/src/jdk10
30      $HOME/jdk/src/jdk11
31      where each of the above is a complete JDK source tree
32      (e.g. mercurial forest) or a symlink to same.
33    
34      Alternatively, define ant variables thus:
35      ant -Djdk$N.home=... -Djdk$N.src.home=...
36      for $N in 8 9 10 ...
37    
38      As of 2016-03, the sources in src/main are for jdk9+ only.
39  ------------------------------------------------------------------------------  ------------------------------------------------------------------------------
40    </description>    </description>
41    
42    <target name="usage" description="Advises user to run with -projecthelp">    <!-- Run 'ant -projecthelp' (default target) -->
43      <echo>Run "ant -projecthelp" for full usage information.</echo>    <target name="usage">
44        <java classname="org.apache.tools.ant.Main">
45          <arg value="-projecthelp" />
46        </java>
47    </target>    </target>
48    
49      <!-- HOWTO printf debug: <echo message="prop=${prop}"/> -->
50    
51    <!-- User-specific settings -->    <!-- User-specific settings -->
52    <property file="user.properties"/>    <property file="user.properties"/>
53    
54    
55    <!-- Compilation options -->    <!-- Compilation options -->
56    <property name="build.sourcelevel"    value="1.5"/>    <property name="build.sourcelevel"    value="6"/>
57    <property name="build.debug"          value="true"/>    <property name="build.debug"          value="true"/>
58    <property name="build.debuglevel"     value="source,lines,vars"/>    <property name="build.debuglevel"     value="source,lines,vars"/>
59    <property name="build.deprecation"    value="false"/>    <property name="build.deprecation"    value="false"/>
60      <property name="build.javadoc.access" value="protected"/>
61    
62    <!-- Build locations -->    <!-- Build locations -->
63    <property name="build.dir"            location="build"/>    <property name="build.dir"                   location="build"/>
64    <property name="build.classes.dir"    location="${build.dir}/classes"/>    <property name="build.classes.dir"           location="${build.dir}/classes"/>
65    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>    <property name="build.testcases.dir"         location="${build.dir}/testcases"/>
66    <property name="build.j1.dir"         location="${build.dir}/j1"/>    <property name="build.loops.dir"             location="${build.dir}/loops"/>
67    <property name="build.loops.dir"      location="${build.dir}/loops"/>  
68    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.4jdk7.dir"             location="${build.dir}/jsr166-4jdk7"/>
69    <property name="build.ant.dir"        location="${build.dir}/ant"/>    <property name="build.4jdk7.classes.dir"     location="${build.4jdk7.dir}/classes"/>
70    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>    <property name="build.4jdk7.tck.classes.dir" location="${build.4jdk7.dir}/tck-classes"/>
71    <property name="build.reports.dir"    location="${build.dir}/reports"/>    <property name="build.4jdk7.docs.dir"        location="${build.4jdk7.dir}/docs"/>
72    <property name="build.checkstyle.dir" location="${build.dir}/checkstyle"/>  
73    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>    <property name="build.4jdk8.dir"             location="${build.dir}/jsr166-4jdk8"/>
74    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>    <property name="build.4jdk8.classes.dir"     location="${build.4jdk8.dir}/classes"/>
75    <property name="build.dc-filter.dir"  location="${build.dir}/filterdocchk"/>    <property name="build.4jdk8.tck.classes.dir" location="${build.4jdk8.dir}/tck-classes"/>
76      <property name="build.4jdk8.docs.dir"        location="${build.4jdk8.dir}/docs"/>
77    
78      <property name="build.jsr166x.dir"           location="${build.dir}/jsr166x"/>
79      <property name="build.jsr166y.dir"           location="${build.dir}/jsr166y"/>
80      <property name="build.jsr166e.dir"           location="${build.dir}/jsr166e"/>
81      <property name="build.extra166y.dir"         location="${build.dir}/extra166y"/>
82    
83      <property name="build.jsr166x.classes.dir"   location="${build.jsr166x.dir}/classes"/>
84      <property name="build.jsr166y.classes.dir"   location="${build.jsr166y.dir}/classes"/>
85      <property name="build.jsr166e.classes.dir"   location="${build.jsr166e.dir}/classes"/>
86      <property name="build.extra166y.classes.dir" location="${build.extra166y.dir}/classes"/>
87    
88      <!-- JDK locations -->
89      <property name="jdks.home"  location="${user.home}/jdk"/>
90    
91      <macrodef name="defjdklocations">
92        <attribute name="v"/>
93        <sequential>
94        <property name="jdk@{v}.home"     location="${jdks.home}/jdk@{v}"/>
95        <property name="java@{v}"         location="${jdk@{v}.home}/bin/java"/>
96        <property name="javac@{v}"        location="${jdk@{v}.home}/bin/javac"/>
97        <property name="javadoc@{v}"      location="${jdk@{v}.home}/bin/javadoc"/>
98        <property name="jdk@{v}.src.home" location="${jdks.home}/src/jdk@{v}"/>
99        <local name="have.java.base"/>
100        <available property="have.java.base"
101          file="${jdk@{v}.src.home}/jdk/src/java.base/share/classes" type="dir"/>
102        <property name="jdk@{v}.src.dir" location="${jdk@{v}.src.home}/jdk/src/java.base/share/classes"
103          if:set="have.java.base"/>
104        <property name="jdk@{v}.src.dir" location="${jdk@{v}.src.home}/jdk/src/share/classes"
105          unless:set="have.java.base"/>
106        <local name="modules"/>
107        <available property="modules" file="${jdk@{v}.home}/jmods" type="dir"/>
108        <local name="boot.jar.dir"/>
109        <property name="boot.jar.dir"   location="${jdk@{v}.home}/jre/lib" unless:set="modules"/>
110        <path id="bootclasspath@{v}" unless:set="modules">
111          <pathelement path="${boot.jar.dir}/resources.jar"/>
112          <pathelement path="${boot.jar.dir}/rt.jar"/>
113          <pathelement path="${boot.jar.dir}/jsse.jar"/>
114          <pathelement path="${boot.jar.dir}/jce.jar"/>
115          <pathelement path="${boot.jar.dir}/charsets.jar"/>
116        </path>
117        <property name="bootclasspath@{v}" value="${toString:bootclasspath@{v}}" unless:set="modules"/>
118        </sequential>
119      </macrodef>
120    
121      <macrodef name="mirror-dir">
122        <attribute name="src"/>
123        <attribute name="dst"/>
124        <sequential>
125        <delete dir="@{dst}"/>
126        <mkdir dir="@{dst}"/>
127        <copy todir="@{dst}" preservelastmodified="true">
128          <fileset dir="@{src}"/>
129        </copy>
130        </sequential>
131      </macrodef>
132    
133      <defjdklocations v="6"/>
134      <defjdklocations v="7"/>
135      <defjdklocations v="8"/>
136      <defjdklocations v="9"/>
137      <defjdklocations v="10"/>
138      <defjdklocations v="11"/>
139    
140    <!-- Source locations -->    <!-- Source locations -->
141    <property name="src.dir"              location="${basedir}/src/main"/>    <property name="src.dir"              location="${basedir}/src/main"/>
142    <property name="test.src.dir"         location="${basedir}/src/test"/>    <property name="test.src.dir"         location="${basedir}/src/test"/>
   <property name="j1.src.dir"           location="${basedir}/src/javaone"/>  
143    <property name="loops.src.dir"        location="${basedir}/src/loops"/>    <property name="loops.src.dir"        location="${basedir}/src/loops"/>
144    <property name="tck.src.dir"          location="${test.src.dir}/tck"/>    <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
145    <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>    <property name="jtreg7.src.dir"       location="${test.src.dir}/jtreg-jdk7"/>
146    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="jtreg8.src.dir"       location="${test.src.dir}/jtreg-jdk8"/>
147    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="jtreg9.src.dir"       location="${test.src.dir}/jtreg"/>
148      <property name="jtreg10.src.dir"      location="${test.src.dir}/jtreg"/>
149      <property name="jtreg11.src.dir"      location="${test.src.dir}/jtreg"/>
150      <property name="jtreg.src.dir"        location="${jtreg9.src.dir}"/>
151    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
152    <property name="dist.dir"             location="${basedir}/dist"/>    <property name="dist.dir"             location="${basedir}/dist"/>
153      <property name="topsrc.dir"           location="${basedir}/src"/>
154    <!-- Distribution locations -->    <property name="4jdk7src.dir"         location="${topsrc.dir}/jdk7"/>
155    <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>    <property name="4jdk8src.dir"         location="${topsrc.dir}/jdk8"/>
156      <property name="jsr166xsrc.dir"       location="${topsrc.dir}/jsr166x"/>
157      <property name="jsr166ysrc.dir"       location="${topsrc.dir}/jsr166y"/>
158      <property name="jsr166esrc.dir"       location="${topsrc.dir}/jsr166e"/>
159      <property name="extra166ysrc.dir"     location="${topsrc.dir}/extra166y"/>
160    
161      <!-- Javadoc locations -->
162      <property name="docs.dir"          location="${build.dir}/docs"/>
163      <property name="4jdk7docs.dir"     location="${build.4jdk7.dir}/docs"/>
164      <property name="4jdk8docs.dir"     location="${build.4jdk8.dir}/docs"/>
165      <property name="jsr166xdocs.dir"   location="${build.jsr166x.dir}/docs"/>
166      <property name="jsr166ydocs.dir"   location="${build.jsr166y.dir}/docs"/>
167      <property name="jsr166edocs.dir"   location="${build.jsr166e.dir}/docs"/>
168      <property name="extra166ydocs.dir" location="${build.extra166y.dir}/docs"/>
169    
170      <property name="dist.docs.dir"          location="${dist.dir}/docs"/>
171      <property name="dist.4jdk7docs.dir"     location="${dist.dir}/jsr166-4jdk7docs"/>
172      <property name="dist.4jdk8docs.dir"     location="${dist.dir}/jsr166-4jdk8docs"/>
173      <property name="dist.jsr166xdocs.dir"   location="${dist.dir}/jsr166xdocs"/>
174      <property name="dist.jsr166ydocs.dir"   location="${dist.dir}/jsr166ydocs"/>
175      <property name="dist.jsr166edocs.dir"   location="${dist.dir}/jsr166edocs"/>
176      <property name="dist.extra166ydocs.dir" location="${dist.dir}/extra166ydocs"/>
177    
178    <!-- Jar locations -->    <!-- Jar locations -->
179    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"      location="${build.dir}/jsr166.jar"/>
180    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="4jdk7product.jar" location="${build.4jdk7.dir}/jsr166-4jdk7.jar"/>
181    <property name="concurrent.jar"       location="${lib.dir}/concurrent.jar"/>    <property name="4jdk8product.jar" location="${build.4jdk8.dir}/jsr166-4jdk8.jar"/>
182      <property name="jsr166x.jar"      location="${build.jsr166x.dir}/jsr166x.jar"/>
183    <!-- Bootclasspath argument -->    <property name="jsr166y.jar"      location="${build.jsr166y.dir}/jsr166y.jar"/>
184    <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>    <property name="jsr166e.jar"      location="${build.jsr166e.dir}/jsr166e.jar"/>
185      <property name="extra166y.jar"    location="${build.extra166y.dir}/extra166y.jar"/>
186    <!-- Test classpath -->    <property name="junit.jar"        location="${lib.dir}/junit.jar"/>
187    <path id="test.classpath">  
188      <pathelement location="${build.testcases.dir}"/>    <!-- Canonical location of jdk docs root, to use with javadoc -Xdocrootparent flag -->
189      <pathelement location="${junit.jar}"/>    <!-- Switched to https: in 2017-10 - JDK-8190312 -->
190    </path>    <property name="java5.docroot.url"  value="https://docs.oracle.com/javase/1.5.0/docs"/>
191      <property name="java6.docroot.url"  value="https://docs.oracle.com/javase/6/docs"/>
192      <property name="java7.docroot.url"  value="https://docs.oracle.com/javase/7/docs"/>
193      <property name="java8.docroot.url"  value="https://docs.oracle.com/javase/8/docs"/>
194      <property name="java9.docroot.url"  value="https://docs.oracle.com/javase/9/docs"/>
195      <!-- The location of jdk9 early access docs (RIP) -->
196      <!-- <property name="java9.docroot.url" value="http://download.java.net/java/jdk9/docs"/> -->
197      <!-- Default jdk doc location (latest stable release seems best) -->
198      <property name="java10.docroot.url" value="http://download.java.net/java/jdk10/docs"/>
199      <property name="java11.docroot.url" value="http://download.java.net/java/jdk11/docs"/>
200      <property name="java.docroot.url"   value="${java9.docroot.url}"/>
201    
202      <!-- Canonical location of jdk API docs, to use with javadoc link attribute -->
203      <property name="java5.api.url"      value="${java5.docroot.url}/api/"/>
204      <property name="java6.api.url"      value="${java6.docroot.url}/api/"/>
205      <property name="java7.api.url"      value="${java7.docroot.url}/api/"/>
206      <property name="java8.api.url"      value="${java8.docroot.url}/api/"/>
207      <property name="java9.api.url"      value="${java9.docroot.url}/api/"/>
208      <property name="java10.api.url"     value="${java10.docroot.url}/api/"/>
209      <property name="java11.api.url"     value="${java11.docroot.url}/api/"/>
210      <property name="java.api.url"       value="${java.docroot.url}/api/"/>
211    
212      <!-- Define the "jtreg" task -->
213      <!-- See the docs in "jtreg -onlineHelp" -->
214      <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant"
215               classpath="${lib.dir}/jtreg.jar" />
216    
217      <!-- Tck options; see JSR166TestCase.java
218       To profile a single tck test class:
219       ant -Djsr166.profileTests=true -Djsr166.profileThreshold=10 -Djsr166.tckTestClass=CompletableFutureTest tck
220       To stress test a single tck test class:
221       ant -Djsr166.tckTestClass=CountedCompleterTest -Djsr166.runsPerTest=100 tck
222       To stress test a single tck test method:
223       ant -Djsr166.tckTestClass=RecursiveTaskTest -Djsr166.runsPerTest=1000 -Djsr166.methodFilter=testAbnormalInvokeAll3 tck
224      -->
225      <property name="jsr166.tckTestClass"     value="JSR166TestCase"/>
226      <macrodef name="run-tck-tests">
227        <attribute name="tck.src.dir" default="${tck.src.dir}"/>
228        <attribute name="target"/>
229        <attribute name="compile-target" default="@{target}"/>
230        <attribute name="workdir"/>
231        <attribute name="classes"/>
232        <!--
233            <attribute name="jvmflags" default="-XX:+UseParallelGC -XX:-UseBiasedLocking -ea -esa -Djsr166.testImplementationDetails=true"/>
234        -->
235            <attribute name="jvmflags" default="-ea -esa -Djsr166.testImplementationDetails=true"/>
236        <element name="javac-elements" optional="true"/>
237    
238        <sequential>
239    
240        <local name="modules"/>
241        <condition property="modules">
242          <available file="${jdk@{compile-target}.home}/jmods" type="dir"/>
243        </condition>
244    
245        <local name="use-doclint"/>
246        <condition property="use-doclint">
247          <not> <equals arg1="@{target}" arg2="7"/> </not>
248        </condition>
249    
250        <mkdir dir="@{workdir}/tck-classes"/>
251    
252        <javac srcdir="@{tck.src.dir}"
253               destdir="@{workdir}/tck-classes"
254               debug="${build.debug}"
255               debuglevel="${build.debuglevel}"
256               deprecation="${build.deprecation}"
257               source="@{compile-target}"
258               target="@{compile-target}"
259               classpath="${junit.jar}"
260               includeAntRuntime="false"
261               includeJavaRuntime="false"
262               encoding="ASCII"
263               executable="${javac@{compile-target}}"
264               fork="true">
265    
266          <include name="*.java"/>
267          <compilerarg value="-XDignore.symbol.file=true"/>
268          <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation,-try"/>
269          <compilerarg value="-Xdoclint:reference/private" if:set="use-doclint"/>
270          <compilerarg value="-Xbootclasspath/p:@{classes}" unless:set="modules"/>
271          <compilerarg value="--patch-module=java.base=@{classes}" if:set="modules"/>
272          <compilerarg line="${build.args}"/>
273          <javac-elements/>
274    
275        </javac>
276    
277        <java classname="${jsr166.tckTestClass}"
278              failonerror="true"
279              jvm="${java@{target}}"
280              fork="true">
281            <jvmarg value="-Xbootclasspath/p:@{classes}" unless:set="modules"/>
282            <jvmarg value="--patch-module=java.base=@{classes}" if:set="modules"/>
283            <jvmarg value="--add-opens=java.base/java.lang=ALL-UNNAMED" if:set="modules"/>
284            <jvmarg value="--add-opens=java.base/java.util=ALL-UNNAMED" if:set="modules"/>
285            <jvmarg value="--add-opens=java.base/java.util.concurrent=ALL-UNNAMED" if:set="modules"/>
286            <jvmarg value="--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED" if:set="modules"/>
287            <jvmarg value="--add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED" if:set="modules"/>
288            <jvmarg line="@{jvmflags}"/>
289            <!-- ant -Dvmoptions="-Xmx8m" -Djsr166.tckTestClass=CompletableFutureTest tck -->
290            <jvmarg line="${vmoptions}" if:set="vmoptions"/>
291    
292            <!-- ant -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 tck -->
293            <syspropertyset id="system-properties-used-by-tck">
294              <propertyref prefix="java.util.concurrent.ForkJoinPool"/>
295              <propertyref prefix="jsr166."/>
296              <propertyref name="test.timeout.factor"/>
297            </syspropertyset>
298    
299            <classpath>
300              <pathelement location="${junit.jar}"/>
301              <pathelement location="@{workdir}/tck-classes"/>
302            </classpath>
303        </java>
304    
305        </sequential>
306      </macrodef>
307    
308      <!-- Define jtreg test sets for different jdk versions -->
309      <!-- ant -Djtreg.test.pattern="**/ConcurrentHashMap/" -->
310      <!-- ant -Djtreg.test.pattern="**/ToArray.java" -->
311      <property name="jtreg.test.pattern" value="**/*.java"/>
312      <macrodef name="defjtregtests">
313        <attribute name="v"/>
314        <sequential>
315          <fileset dir="${jtreg@{v}.src.dir}">
316            <patternset id="jdk@{v}.jtreg.tests">
317              <include name="${jtreg.test.pattern}"/>
318            </patternset>
319          </fileset>
320        </sequential>
321      </macrodef>
322    
323      <defjtregtests v="11"/>
324      <defjtregtests v="10"/>
325      <defjtregtests v="9"/>
326      <defjtregtests v="8"/>
327      <defjtregtests v="7"/>
328    
329      <!-- ant -Djtreg.flags=-timeoutFactor:4 -->
330      <property name="jtreg.flags" value=""/>
331    
332      <macrodef name="run-jtreg-tests">
333        <!-- ant -Djtreg9.src.dir=src/test/jtreg/util/concurrent/CompletableFuture jtreg -->
334        <attribute name="target"/>
335        <attribute name="workdir"/>
336        <attribute name="classes"/>
337        <attribute name="verbose" default="${jtreg.verbose}"/>
338        <attribute name="jtregflags" default=""/>
339        <element name="jtreg-elements" optional="true"/>
340    
341        <sequential>
342    
343        <!-- ant -Djtreg.verbose=time,fail,error jtreg -->
344        <property name="jtreg.verbose" value="nopass,fail,error"/>
345    
346        <local name="modules"/>
347        <condition property="modules">
348          <available file="${jdk@{target}.home}/jmods" type="dir"/>
349        </condition>
350    
351        <delete dir="@{workdir}/JTwork"   quiet="true"/>
352        <jtreg dir="${jtreg@{target}.src.dir}"
353               jdk="${jdk@{target}.home}"
354               workDir="@{workdir}/JTwork">
355          <patternset refid="jdk@{target}.jtreg.tests"/>
356          <arg value="-Xbootclasspath/p:@{classes}" unless:set="modules"/>
357          <arg value="-javacoptions:--patch-module=java.base=@{classes}" if:set="modules"/>
358          <arg value="-vmoptions:--patch-module=java.base=@{classes}" if:set="modules"/>
359          <arg value="-agentvm"/>
360          <arg value="-noreport"/>
361          <arg value="-verbose:@{verbose}"/>
362          <arg value="-vmoptions:-esa -ea"/>
363          <arg value="-automatic"/>
364          <arg value="-k:!ignore"/>
365          <arg line="@{jtregflags}"/>
366          <arg line="${jtreg.flags}"/>
367          <jtreg-elements/>
368        </jtreg>
369        </sequential>
370      </macrodef>
371    
372    <!-- ALoops classpath -->    <!-- ALoops classpath -->
373    <path id="loops.classpath">    <path id="loops.classpath">
374      <pathelement location="${build.loops.dir}"/>      <pathelement location="${build.loops.dir}"/>
375    </path>    </path>
376    
377    <!-- J1 classpath -->    <!-- Support @jls tag, used in jdk8+ javadoc -->
378    <path id="j1.classpath">    <property name="javadoc.jls.cite" value="The Java&amp;trade; Language Specification"/>
379      <pathelement location="${build.j1.dir}"/>    <property name="javadoc.jls.option" value="jls:a:See &lt;cite&gt;${javadoc.jls.cite}&lt;/cite&gt;:"/>
     <pathelement location="${junit.jar}"/>  
     <pathelement location="${concurrent.jar}"/>  
   </path>  
   
380    
381    <!-- Main targets -->    <!-- Main targets -->
382    
383      <property name="build.main.java.version" value="9"/>
384      <!-- Workaround "no nested properties in ant" -->
385      <macrodef name="define-build-main-properties">
386        <attribute name="v"/>
387        <sequential>
388          <property name="build.main.java"    value="${java@{v}}"/>
389          <property name="build.main.javac"   value="${javac@{v}}"/>
390          <!-- Force javadoc version to be at least 10,
391               so we can use override-methods=summary -->
392          <condition property="build.main.javadoc"
393                     value="${javadoc10}"
394                     else="${javadoc@{v}}">
395            <equals arg1="@{v}" arg2="9"/>
396          </condition>
397        </sequential>
398      </macrodef>
399      <define-build-main-properties v="${build.main.java.version}"/>
400    
401      <target name="dists"
402              depends="dist, 4jdk8dist"
403              description="Builds all public jars and docs"/>
404              <!--
405                  depends="dist, 4jdk8dist, 4jdk7dist, jsr166edist, jsr166ydist, extra166ydist, jsr166xdist"
406              -->
407    
408    <target name="compile"    <target name="compile"
409            depends="init, configure-compiler"            depends="configure-compiler"
410            description="Compiles main sources to build folder">            description="Compiles src/main sources to build dir">
411    
412        <local name="destdir"/>
413        <property name="destdir" value="${build.classes.dir}/java.base"/>
414    
415      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${destdir}"/>
416    
417      <javac srcdir="${src.dir}"      <javac srcdir="${src.dir}"
418            destdir="${build.classes.dir}"             destdir="${destdir}"
419              debug="${build.debug}"             debug="${build.debug}"
420         debuglevel="${build.debuglevel}"             debuglevel="${build.debuglevel}"
421        deprecation="${build.deprecation}"             deprecation="${build.deprecation}"
422             source="${build.sourcelevel}"             classpath=""
423               fork="true">             includeAntRuntime="false"
424               includeJavaRuntime="false"
425               encoding="ASCII"
426               executable="${build.main.javac}"
427               fork="true">
428    
429        <include name="**/*.java"/>        <include name="**/*.java"/>
430        <exclude name="java/lang/**"/>        <compilerarg value="--patch-module=java.base=${src.dir}"/>
431          <compilerarg value="-Xprefer:source"/>
432          <compilerarg value="-XDignore.symbol.file=true"/>
433          <compilerarg value="-Xlint:all"/>
434          <compilerarg line="--doclint-format html5"/>
435          <compilerarg value="-Xdoclint:all/protected,reference/private"/>
436          <compilerarg value="-Werror"/>
437          <compilerarg line="-Xmaxerrs 1000 -Xmaxwarns 1000"/>
438        <compilerarg line="${build.args}"/>        <compilerarg line="${build.args}"/>
439    
440      </javac>      </javac>
   
441    </target>    </target>
442    
443    
   
444    <target name="jar"    <target name="jar"
445            depends="compile"            depends="compile"
446            description="Builds library jar from compiled sources">            description="Builds library jar for src/main from compiled sources">
447        <local name="subdir"/>
448      <mkdir dir="${build.lib.dir}"/>      <available property="subdir" file="${build.classes.dir}/java.base" type="dir" value="/java.base"/>
   
449      <jar destfile="${product.jar}">      <jar destfile="${product.jar}">
450        <fileset dir="${build.classes.dir}"/>        <fileset dir="${build.classes.dir}${subdir}"/>
451          <manifest>
452            <attribute name="Built-By" value="${user.name}"/>
453            <attribute name="Implementation-Vendor" value="JCP JSR-166 Expert Group."/>
454          </manifest>
455      </jar>      </jar>
   
456    </target>    </target>
457    
458    
   
   <target name="test"  
           depends="init, configure-tests, report-tests"  
           description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />  
   
   
   
459    <target name="docs"    <target name="docs"
460            description="Builds javadocs with custom tags to build folder">            description="Builds javadocs for src/main to dist dir">
461    
462      <delete dir="${build.javadocs.dir}"/>      <delete dir="${docs.dir}"/>
463      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${docs.dir}"/>
464    
465      <javadoc destdir="${build.javadocs.dir}"      <!-- the packagenames="none" hack below prevents scanning the -->
466                  link="http://java.sun.com/j2se/1.4.1/docs/api"      <!-- sourcepath for packages -->
             overview="${src.dir}/intro.html"  
               source="${build.sourcelevel}">  
467    
468        <tag name="revised" description="Last revised:"/>  <!-- TODO: sourcepath="${src.dir}:${jdk9.src.dir}" -->
469        <tag name="spec"    description="Specified by:"/>  <!-- TODO: sourcepath="${src.dir}:${jdk9.src.dir}:${jdk9.src.home}/jdk/src/java.logging/share/classes" -->
470    <!-- TODO: sourcepath="${src.dir}:${jdk9.home}/src.zip" -->
471        <packageset dir="${src.dir}"/>  <!-- TODO: <arg line="-sourcepath ${src.dir}:${jdk9.home}/src.zip"/> -->
472    <!-- TODO: <arg line="- -module-source-path ${jdk9.home}/src.zip"/> -->
473      </javadoc>      <javadoc destdir="${docs.dir}"
474                 packagenames="none"
475    </target>               link="${java9.api.url}"
476                 overview="${src.dir}/intro.html"
477                 access="${build.javadoc.access}"
478                 sourcepath="${src.dir}"
479    <target name="doccheck"               classpath=""
480            depends="filter-doccheck"               source="9"
481            description="Reports on javadoc style errors">               executable="${build.main.javadoc}">
482          <fileset dir="${src.dir}" defaultexcludes="yes">
483      <delete dir="${build.doccheck.dir}"/>          <include name="**/*.java"/>
484      <mkdir dir="${build.doccheck.dir}"/>        </fileset>
485          <arg line="-Xdocrootparent ${java9.docroot.url}"/>
486      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"        <arg line="-Xmaxerrs 1000 -Xmaxwarns 1000"/>
487           docletpath="${lib.dir}/doccheck.jar"        <arg value="-XDignore.symbol.file=true"/>
488              destdir="${build.doccheck.dir}">        <arg value="-html5"/>
489        <packageset dir="${build.dc-filter.dir}"/>        <arg value="--patch-module=java.base=${src.dir}"/>
490          <arg value="--override-methods=summary"/>
491          <arg value="-tag"/> <arg value="${javadoc.jls.option}"/>
492          <arg value="-tag"/> <arg value="implSpec:a:Implementation Requirements:"/>
493          <arg value="-tag"/> <arg value="implNote:a:Implementation Note:"/>
494    <!-- @apiNote tag currently unused -->
495    <!--  <arg value="-tag"/> <arg value="apiNote:a:API Note:"/> -->
496    <!-- tags added in jdk9: currently unused -->
497    <!--  <arg value="-tag"/> <arg value="revised:X"/> -->
498    <!--  <arg value="-tag"/> <arg value="spec:X"/> -->
499      </javadoc>      </javadoc>
   
     <echo>DocCheck output is in ${build.doccheck.dir}</echo>  
   
   </target>  
   
   
   
   <target name="checkstyle"  
           depends="filter-src"  
           description="Reports on style errors in Java source (verbose, mostly chaff)">  
   
     <taskdef resource="checkstyletask.properties"  
             classpath="${lib.dir}/checkstyle-all-3.1.jar"/>  
   
     <mkdir dir="${build.checkstyle.dir}"/>  
   
     <checkstyle config="etc/checkstyle/sun_checks.xml"  
        failOnViolation="false">  
       <formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/>  
       <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>  
     </checkstyle>  
   
     <style in="${build.checkstyle.dir}/checkstyle-report.xml"  
           out="${build.checkstyle.dir}/checkstyle-report.html"  
         style="${stylesheet.dir}/checkstyle-frames.xsl"/>  
   
500    </target>    </target>
501    
502    
   
503    <target name="dist"    <target name="dist"
504            depends="init, dist-clean, dist-jar, dist-docs"            depends="dist-clean, dist-jar, dist-docs"
505            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
506    
507    
   
508    <target name="release"    <target name="release"
509            depends="dist"            depends="dist"
510            description="Puts entire CVS tree, plus distribution productions, in a jar">            description="Puts entire CVS tree, plus distribution productions, in a jar">
# Line 214  Line 519 
519        <exclude name="src/emulation/**"/>        <exclude name="src/emulation/**"/>
520        <exclude name="**/SyntaxTest.java"/>        <exclude name="**/SyntaxTest.java"/>
521        <exclude name="**/SuperfluousAbstract.java"/>        <exclude name="**/SuperfluousAbstract.java"/>
522          <manifest>
523            <attribute name="Built-By" value="${user.name}"/>
524            <attribute name="Implementation-Vendor" value="JCP JSR-166 Expert Group."/>
525          </manifest>
526      </jar>      </jar>
   
527    </target>    </target>
528    
529    
   
530    <target name="clean"    <target name="clean"
531            description="Removes all build products">            description="Removes all build products">
   
532      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
     <delete dir="${build.classes.dir}"/>  
     <delete dir="${build.lib.dir}"/>  
   
533    </target>    </target>
534    
535    
   
536    <target name="dist-clean"    <target name="dist-clean"
537            description="Removes all build and distribution products">            description="Removes all build and distribution products">
538        <delete dir="${build.dir}"/>
539      <delete dir="${dist.dir}"/>      <delete dir="${dist.dir}"/>
   
   </target>  
   
   
   
   <target name="dist-docs"  
           description="Builds javadocs without custom tags to dist folder">  
   
     <delete dir="${dist.javadocs.dir}"/>  
     <mkdir dir="${dist.javadocs.dir}"/>  
   
     <javadoc destdir="${dist.javadocs.dir}"  
                 link="http://java.sun.com/j2se/1.4.2/docs/api"  
             overview="${src.dir}/intro.html"  
               source="${build.sourcelevel}">  
   
       <packageset dir="${src.dir}"/>  
   
     </javadoc>  
   
   </target>  
   
   
   
   <!-- Internal targets -->  
   
   
   <target name="init">  
   
     <!-- Version is kept in a separate file -->  
     <loadfile property="version" srcFile="version.properties"/>  
     <echo>Building JSR-166 version ${version}</echo>  
     <echo>java.home is ${java.home}</echo>  
   
540    </target>    </target>
541    
542    
543    <target name="dist-jar"    <target name="dist-jar"
544            depends="clean, jar">            depends="clean, jar">
   
545      <copy file="${product.jar}" todir="${dist.dir}"/>      <copy file="${product.jar}" todir="${dist.dir}"/>
   
546    </target>    </target>
547    
548      <target name="dist-docs"
549    <target name="compile-ant-filter"            depends="clean, docs">
550            depends="init">      <mirror-dir src="${docs.dir}" dst="${dist.docs.dir}"/>
   
     <mkdir dir="${build.ant.dir}"/>  
   
     <javac srcdir="${ant.src.dir}"  
           destdir="${build.ant.dir}"  
            source="1.4"/>  
   
551    </target>    </target>
552    
553      <target name="tck"
554              depends="jar"
555              description="Runs tck tests for src/main directly">
556    
557        <run-tck-tests
558          target="${build.main.java.version}"
559          workdir="${build.dir}"
560          classes="${product.jar}">
561          <javac-elements>
562            <compilerarg value="-Werror"/>
563          </javac-elements>
564        </run-tck-tests>
565      </target>
566    
567      <target name="tck-parallelism-1"
568              description="Runs tck with common pool parallelism 1">
569        <antcall target="tck">
570          <param name="java.util.concurrent.ForkJoinPool.common.parallelism" value="1"/>
571        </antcall>
572      </target>
573    
574      <target name="tck-parallelism-0"
575              description="Runs tck with common pool parallelism 0">
576        <antcall target="tck">
577          <param name="java.util.concurrent.ForkJoinPool.common.parallelism" value="0"/>
578        </antcall>
579      </target>
580    
581      <target name="tck-security-manager"
582              description="Runs tck with a security manager">
583        <antcall target="tck">
584          <param name="jsr166.useSecurityManager" value="true"/>
585        </antcall>
586      </target>
587    
588      <target name="jtreg"
589              depends="jar"
590              description="Runs jtreg tests for src/main using the jtreg ant task">
591        <run-jtreg-tests
592           target="${build.main.java.version}"
593           workdir="${build.dir}"
594           classes="${product.jar}"/>
595      </target>
596    
597    <target name="filter-src"    <target name="test"
598            depends="compile-ant-filter">            depends="tck, tck-parallelism-1, tck-parallelism-0, jtreg"
599              description="Runs tck and jtreg tests for src/main"/>
600    
601      <mkdir dir="${build.filter.src.dir}"/>  <!--   <target name="jtreg8" description="Runs jtreg tests with jdk8"> -->
602    
603      <copy todir="${build.filter.src.dir}">  <!--     <antcall target="jtreg"> -->
604        <fileset dir="${src.dir}">  <!--       <param name="build.main.java.version" value="8"/> -->
605          <include name="**/*.html"/>  <!--       <param name="build.main.javac" value="${javac8}"/> -->
606        </fileset>  <!--     </antcall> -->
607      </copy>  
608    <!--   </target> -->
609    
610      <target name="test91011"
611              description="Runs tck and jtreg tests for src/main for multiple java versions">
612    
613        <antcall target="clean"/>
614        <antcall target="test">
615          <param name="build.main.java.version" value="9"/>
616        </antcall>
617    
618        <antcall target="clean"/>
619        <antcall target="test">
620          <param name="build.main.java.version" value="10"/>
621        </antcall>
622    
623        <antcall target="clean"/>
624        <antcall target="test">
625          <param name="build.main.java.version" value="11"/>
626        </antcall>
627    
628      <copy todir="${build.filter.src.dir}">      <!-- Clean up to avoid obscure wrong class file version bugs -->
629        <fileset dir="${src.dir}">      <antcall target="clean"/>
         <exclude name="**/*.html"/>  
         <!-- Files excluded from dist-docs -->  
         <exclude name="java/util/Random.*"/>  
         <exclude name="sun/misc/Unsafe.*"/>  
       </fileset>  
       <!--  
       <filterchain>  
       -->  
   
         <!--  
          # This filter gets rid of angle-bracketed type parameters  
          # so that javadoc can run on the result. The following  
          # heuristic seems to work:  
          #  
          # For all lines not starting with space(s)-asterisk-space(s),  
          #   replace <something> with a space, where there may be more  
          #   than one right angle bracket at the end, and "something"  
          #   must not contain parens or pipes. (This may need some  
          #   tweaking.)  
          -->  
   
         <!--  
         <filterreader classname="jsr166.ant.filters.ReplaceFilter"  
                       classpath="${build.ant.dir}">  
           <param name="notmatching" value="^\s+\*\s.*$"/>  
           <param name="pattern"     value="&lt;[^|>()]+?>+"/>  
           <param name="replacement" value=" "/>  
         </filterreader>  
         -->  
   
       <!--  
       </filterchain>  
       -->  
     </copy>  
630    
631    </target>    </target>
632    
633    
   <target name="filter-doccheck"  
           depends="filter-src">  
   
     <mkdir dir="${build.dc-filter.dir}"/>  
   
     <copy todir="${build.dc-filter.dir}">  
       <fileset dir="${build.filter.src.dir}">  
         <include name="**/*.html"/>  
       </fileset>  
     </copy>  
   
     <property name="generic.declarations"  
              value="/** Fake type parameter. */ public interface E {} /** Fake type parameter. */ public interface T {} /** Fake type parameter. */ public interface K {} /** Fake type parameter. */ public interface V {}"  
     />  
   
     <copy todir="${build.dc-filter.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>  
634    
635        </filterchain>    <target name="configure-compiler">
636      </copy>      <fail message="ant version too old">
637          <condition> <not> <antversion atleast="1.9.1"/> </not> </condition>
638        </fail>
639    
640    </target>      <property name="unchecked.option" value="-Xlint:unchecked"/>
641    
642        <condition property="warnunchecked.arg" value="${unchecked.option}">
643          <istrue value="${build.warnunchecked}"/>
644        </condition>
645    
646    <target name="compile-tests"      <property name="warnunchecked.arg" value=""/>
           depends="jar">  
647    
     <mkdir dir="${build.testcases.dir}"/>  
648    
649      <javac srcdir="${tck.src.dir}"      <!-- Common options in javac invocations -->
650            destdir="${build.testcases.dir}"      <property name="build.args" value="${warnunchecked.arg}"/>
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
651    
652        <compilerarg value="${bootclasspath.args}"/>    </target>
       <compilerarg line="${build.args}"/>  
653    
       <classpath refid="test.classpath"/>  
654    
     </javac>  
655    
656      <javac srcdir="${test.src.dir}"    <!-- Various demos and test programs -->
           destdir="${build.testcases.dir}"  
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
   
       <include name="jsr166/test/**"/>  
657    
       <compilerarg value="${bootclasspath.args}"/>  
       <compilerarg line="${build.args}"/>  
658    
659        <classpath refid="test.classpath"/>    <!-- description="Benchmark from Doug Lea's AQS paper" -->
660      <target name="loops" depends="configure-compiler">
661    
662      </javac>      <mkdir dir="${build.loops.dir}"/>
663    
664  <!--      <javac srcdir="${loops.src.dir}"
665      <javac srcdir="${jtreg.src.dir}"            destdir="${build.loops.dir}"
           destdir="${build.testcases.dir}"  
666              debug="${build.debug}"              debug="${build.debug}"
667         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
668        deprecation="${build.deprecation}"        deprecation="${build.deprecation}"
669             source="${build.sourcelevel}"             source="${build.sourcelevel}"
670               target="${build.sourcelevel}"
671             encoding="ASCII"
672               fork="true">               fork="true">
673    
       <compilerarg value="${bootclasspath.args}"/>  
674        <compilerarg line="${build.args}"/>        <compilerarg line="${build.args}"/>
675          <classpath refid="loops.classpath"/>
676        <classpath refid="test.classpath"/>        <compilerarg value="-XDignore.symbol.file=true"/>
677    
678      </javac>      </javac>
 -->  
679    
680        <java classname="ALoops" fork="true">
681          <classpath refid="loops.classpath"/>
682        </java>
683    </target>    </target>
684    
685    
686    <target name="run-tests"    <target name="compile-test-loops" depends="jar"
687            depends="compile-tests">            description="Compiles all the perf tests in src/test/loops">
   
     <!-- May be overridden by user.properties -->  
     <property name="testcase" value="*"/>  
   
     <mkdir dir="${build.reports.dir}"/>  
   
     <junit printsummary="true"  
              showoutput="true"  
           errorProperty="junit.failed"  
         failureProperty="junit.failed"  
                     dir="${build.reports.dir}"  
                    fork="true">  
   
       <jvmarg value="${bootclasspath.args}"/>  
       <jvmarg value="-server"/>  
       <jvmarg value="-showversion"/>  
   
       <classpath refid="test.classpath"/>  
   
       <formatter type="xml"/>  
688    
689        <batchtest todir="${build.reports.dir}" unless="no.test.tck">      <mkdir dir="${build.dir}/test/loops"/>
         <fileset dir="${tck.src.dir}">  
           <include name="**/${testcase}Test.java"/>  
         </fileset>  
       </batchtest>  
   
       <batchtest todir="${build.reports.dir}" if="do.test.old">  
         <fileset dir="${test.src.dir}">  
           <include name="jsr166/test/**/${testcase}Test.java"/>  
         </fileset>  
       </batchtest>  
   
 <!--  
       <batchtest todir="${build.reports.dir}" if="do.test.jtreg">  
         <fileset dir="${jtreg.src.dir}">  
           <include name="**/${testcase}Test.java"/>  
         </fileset>  
       </batchtest>  
 -->  
   
     </junit>  
690    
691        <javac srcdir="${basedir}/src/test/loops"
692               destdir="${build.dir}/test/loops"
693               debug="${build.debug}"
694               debuglevel="${build.debuglevel}"
695               deprecation="${build.deprecation}"
696               includeAntRuntime="false"
697               includeJavaRuntime="false"
698               encoding="ASCII"
699               executable="${build.main.javac}"
700               fork="true">
701    
702          <include name="*.java"/>
703          <compilerarg value="-XDignore.symbol.file=true"/>
704          <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial"/>
705          <compilerarg value="-Xbootclasspath/p:${product.jar}"/>
706          <compilerarg line="${build.args}"/>
707        </javac>
708    </target>    </target>
709    
710    
711    <target name="report-tests"    <!-- jsr166 4jdk8 -->
           depends="run-tests">  
   
     <!-- 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"/>  
   
     <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>  
   
     <fail message="Test Cases Failed" if="junit.failed"/>  
712    
713      <target name="4jdk8compile"
714              depends="configure-compiler"
715              description="Compiles src/jdk8 sources, targeting jdk8">
716    
717        <mkdir dir="${build.4jdk8.classes.dir}"/>
718    
719        <javac srcdir="${4jdk8src.dir}"
720               destdir="${build.4jdk8.classes.dir}"
721               debug="${build.debug}"
722               debuglevel="${build.debuglevel}"
723               deprecation="${build.deprecation}"
724               source="8"
725               target="8"
726               classpath=""
727               bootclasspath="${bootclasspath8}"
728               includeAntRuntime="false"
729               includeJavaRuntime="false"
730               encoding="ASCII"
731               executable="${javac8}"
732               fork="true">
733          <include name="**/*.java"/>
734          <compilerarg value="-Xprefer:source"/>
735          <compilerarg value="-XDignore.symbol.file=true"/>
736          <compilerarg value="-Xlint:all"/>
737          <compilerarg value="-Werror"/>
738          <compilerarg line="${build.args}"/>
739        </javac>
740    </target>    </target>
741    
742      <target name="4jdk8doclint"
743    <target name="configure-compiler">            depends="configure-compiler"
744              description="Finds doclint warnings">
745      <property name="unchecked.option" value="-Xlint:unchecked"/>  
746        <mkdir dir="${build.4jdk8.classes.dir}"/>
747      <condition property="warnunchecked.arg" value="${unchecked.option}">  
748        <istrue value="${build.warnunchecked}"/>      <javac srcdir="${4jdk8src.dir}"
749      </condition>             destdir="${build.4jdk8.classes.dir}"
750               debug="${build.debug}"
751      <property name="warnunchecked.arg" value=""/>             debuglevel="${build.debuglevel}"
752               deprecation="${build.deprecation}"
753               source="8"
754      <!-- Common options in javac invocations -->             target="8"
755      <property name="build.args" value="${warnunchecked.arg}"/>             classpath=""
756               bootclasspath="${bootclasspath8}"
757               includeAntRuntime="false"
758               includeJavaRuntime="false"
759               encoding="ASCII"
760               executable="${javac8}"
761               fork="true">
762          <include name="**/*.java"/>
763          <compilerarg value="-Xprefer:source"/>
764          <compilerarg value="-XDignore.symbol.file=true"/>
765          <compilerarg value="-Xlint:all"/>
766          <compilerarg value="-Xdoclint:all/protected,reference/private"/>
767          <compilerarg line="${build.args}"/>
768        </javac>
769    </target>    </target>
770    
771    
772    <target name="configure-tests"    <target name="4jdk8jar"
773         depends="configure-compiler">            depends="4jdk8compile"
774              description="Builds library jar from compiled sources">
     <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->  
     <available property="junit.available"  
                classname="junit.framework.Protectable"/>  
   
     <!-- Xalan -->  
     <available property="xalan.available"  
                classname="org.apache.xalan.Version"/>  
   
   
     <!-- Ant 1.6beta and later don't need or want this check -->  
     <!--  
     <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"  
           unless="junit.available"/>  
   
     <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"  
           unless="xalan.available"/>  
     -->  
775    
776        <jar destfile="${4jdk8product.jar}">
777          <fileset dir="${build.4jdk8.classes.dir}"/>
778          <manifest>
779            <attribute name="Built-By" value="${user.name}"/>
780            <attribute name="Implementation-Vendor" value="JCP JSR-166 Expert Group."/>
781          </manifest>
782        </jar>
783    </target>    </target>
784    
785    
786      <target name="4jdk8-tck"
787    <!-- Anthill targets -->            depends="4jdk8jar"
788              description="Runs tck tests for jsr166-4jdk8 directly">
789    <target name="anthill-build">  
790        <run-tck-tests
791      <!-- Override this in user.properties -->        target="8"
792      <property name="tiger.home" location="e:/j2sdk1.5.0"/>        workdir="${build.4jdk8.dir}"
793          classes="${4jdk8product.jar}">
794      <exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java">        <javac-elements>
795        <arg value="-Xmx256000000"/>          <!-- JDK9+ test classes -->
796        <!-- classpath of new JVM -->          <exclude name="*9Test.java"/>
797        <arg value="-classpath"/> <arg path="${java.class.path}"/>          <exclude name="*10Test.java"/>
798        <!-- location of Ant home directory -->          <compilerarg value="-Werror"/>
799        <arg value="-Dant.home=${ant.home}"/>        </javac-elements>
800        <!-- the Ant main class -->      </run-tck-tests>
       <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>  
801    </target>    </target>
802    
   <target name="do-anthill-build"  
           depends="jar, test, docs, dist-docs"/>  
   
   <target name="anthill-publish">  
   
     <copy todir="${deployDir}/docs/private">  
       <fileset dir="${build.javadocs.dir}"/>  
     </copy>  
   
     <copy todir="${deployDir}/docs/public">  
       <fileset dir="${dist.javadocs.dir}"/>  
     </copy>  
   
     <copy tofile="${deployDir}/index.html"  
           file="${basedir}/etc/anthill-index.html"/>  
   
     <copy todir="${deployDir}/notes">  
       <fileset dir="${basedir}/etc/notes"/>  
     </copy>  
803    
804      <target name="4jdk8-jtreg"
805              depends="4jdk8jar"
806              description="Runs jtreg tests for jsr166-4jdk8 using the jtreg ant task">
807        <run-jtreg-tests
808           target="8"
809           workdir="${build.4jdk8.dir}"
810           classes="${4jdk8product.jar}"/>
811    </target>    </target>
812    
813    
814      <target name="4jdk8-test"
815              depends="4jdk8-tck, 4jdk8-jtreg"
816              description="Runs tck and jtreg tests for jsr166-4jdk8"/>
817    
818    
819      <target name="4jdk8docs"
820              description="Builds javadocs for src/jdk8 to dist dir">
821    
822        <delete dir="${4jdk8docs.dir}"/>
823        <mkdir dir="${4jdk8docs.dir}"/>
824    
825        <javadoc destdir="${4jdk8docs.dir}"
826                 packagenames="none"
827                 link="${java8.api.url}"
828                 overview="${4jdk8src.dir}/intro.html"
829                 access="${build.javadoc.access}"
830                 sourcepath="${4jdk8src.dir}:${jdk8.src.dir}"
831                 classpath=""
832                 source="8"
833                 executable="${javadoc8}"
834                 failonerror = "true">
835          <fileset dir="${4jdk8src.dir}" defaultexcludes="yes">
836            <include name="**/*.java"/>
837          </fileset>
838          <arg line="-Xdocrootparent ${java8.docroot.url}"/>
839          <arg value="-XDignore.symbol.file=true"/>
840          <arg value="-tag"/> <arg value="${javadoc.jls.option}"/>
841          <arg value="-tag"/> <arg value="implSpec:a:&lt;em&gt;Implementation Requirements:&lt;/em&gt;"/>
842          <arg value="-tag"/> <arg value="implNote:a:&lt;em&gt;Implementation Note:&lt;/em&gt;"/>
843    <!-- @apiNote tag currently unused -->
844    <!--  <arg value="-tag"/> <arg value="apiNote:a:&lt;em&gt;API Note:&lt;/em&gt;"/> -->
845        </javadoc>
846      </target>
847    
   <!-- Various demos and test programs -->  
   
   
   <target name="sample" depends="init, configure-compiler"  
           description="Standalone demo program">  
848    
849      <mkdir dir="${build.testcases.dir}"/>    <target name="4jdk8dist"
850              depends="4jdk8dist-jar, 4jdk8dist-docs"
851              description="Puts all distributable products in single hierarchy"/>
852    
     <javac srcdir="${test.src.dir}"  
           destdir="${build.testcases.dir}"  
             debug="${build.debug}"  
        debuglevel="${build.debuglevel}"  
       deprecation="${build.deprecation}"  
            source="${build.sourcelevel}"  
              fork="true">  
853    
854        <include name="jsr166/test/Sample.java"/>    <target name="4jdk8clean"
855              description="Removes all 4jdk8 build products">
856        <delete dir="${build.4jdk8.dir}"/>
857      </target>
858    
     </javac>  
859    
860      <copy todir="${build.testcases.dir}">    <target name="4jdk8dist-jar"
861        <fileset dir="${test.src.dir}">            depends="4jdk8clean, 4jdk8jar">
862          <include name="**/*.properties"/>      <copy file="${4jdk8product.jar}" todir="${dist.dir}"/>
863        </fileset>    </target>
     </copy>  
864    
865    
866      <java classname="jsr166.test.Sample" fork="true">    <target name="4jdk8dist-docs"
867        <classpath refid="test.classpath"/>            depends="4jdk8clean, 4jdk8docs">
868        <!-- <jvmarg value="-ea"/> -->      <mirror-dir src="${4jdk8docs.dir}" dst="${dist.4jdk8docs.dir}"/>
       <!-- <jvmarg value="-server"/> -->  
       <!-- <arg value="1000"/> -->  
     </java>  
869    </target>    </target>
870    
871    
872    <target name="loops" depends="init, configure-compiler"    <!-- jsr166 4jdk7 (no longer maintained) -->
           description="Benchmark from Doug Lea's AQS paper">  
873    
874      <mkdir dir="${build.loops.dir}"/>    <target name="4jdk7compile" depends="configure-compiler">
875        <mkdir dir="${build.4jdk7.classes.dir}"/>
876    
877      <javac srcdir="${loops.src.dir}"      <javac srcdir="${4jdk7src.dir}"
878            destdir="${build.loops.dir}"             destdir="${build.4jdk7.classes.dir}"
879              debug="${build.debug}"             debug="${build.debug}"
880         debuglevel="${build.debuglevel}"             debuglevel="${build.debuglevel}"
881        deprecation="${build.deprecation}"             deprecation="${build.deprecation}"
882             source="${build.sourcelevel}"             source="6"
883               fork="true">             target="6"
884               classpath=""
885               bootclasspath="${bootclasspath6}"
886               includeAntRuntime="false"
887               includeJavaRuntime="false"
888               encoding="ASCII"
889               executable="${javac7}"
890               fork="true">
891    
892          <include name="**/*.java"/>
893          <compilerarg value="-Xprefer:source"/>
894          <compilerarg value="-XDignore.symbol.file=true"/>
895          <compilerarg value="-Xlint:all"/>
896          <compilerarg value="-Werror"/>
897        <compilerarg line="${build.args}"/>        <compilerarg line="${build.args}"/>
       <classpath refid="loops.classpath"/>  
   
898      </javac>      </javac>
   
     <java classname="ALoops" fork="true">  
       <classpath refid="loops.classpath"/>  
     </java>  
   
899    </target>    </target>
900    
901      <target name="4jdk7doclint" depends="configure-compiler">
902        <mkdir dir="${build.4jdk7.classes.dir}"/>
903    
904    <target name="compile-j1" depends="init, configure-compiler">      <javac srcdir="${4jdk7src.dir}"
905               destdir="${build.4jdk7.classes.dir}"
906      <mkdir dir="${build.j1.dir}"/>             debug="${build.debug}"
907               debuglevel="${build.debuglevel}"
908      <javac srcdir="${j1.src.dir}"             deprecation="${build.deprecation}"
909            destdir="${build.j1.dir}"             source="6"
910              debug="${build.debug}"             target="6"
911         debuglevel="${build.debuglevel}"             classpath=""
912        deprecation="${build.deprecation}"             bootclasspath="${bootclasspath6}"
913             source="${build.sourcelevel}" >             includeAntRuntime="false"
914               includeJavaRuntime="false"
915               encoding="ASCII"
916               executable="${javac8}"
917               fork="true">
918    
919        <include name="**/*.java"/>        <include name="**/*.java"/>
920        <exclude name="**/dijkstra/**"/>        <compilerarg value="-Xprefer:source"/>
921          <compilerarg value="-XDignore.symbol.file=true"/>
922          <compilerarg value="-Xlint:all"/>
923          <compilerarg value="-Xdoclint:all/protected"/>
924        <compilerarg line="${build.args}"/>        <compilerarg line="${build.args}"/>
       <classpath refid="j1.classpath"/>  
   
925      </javac>      </javac>
926      </target>
927    
928      <target name="4jdk7jar" depends="4jdk7compile">
929        <jar destfile="${4jdk7product.jar}">
930          <fileset dir="${build.4jdk7.classes.dir}"/>
931          <manifest>
932            <attribute name="Built-By" value="${user.name}"/>
933            <attribute name="Implementation-Vendor" value="JCP JSR-166 Expert Group."/>
934          </manifest>
935        </jar>
936    </target>    </target>
937    
938      <target name="4jdk7-tck" depends="4jdk7jar">
939        <run-tck-tests
940          target="7"
941          workdir="${build.4jdk7.dir}"
942          classes="${4jdk7product.jar}">
943          <javac-elements>
944            <!-- JDK8+ test classes -->
945            <exclude name="*8Test.java"/>
946            <exclude name="*9Test.java"/>
947            <exclude name="*10Test.java"/>
948            <exclude name="DoubleAccumulatorTest.java"/>
949            <exclude name="DoubleAdderTest.java"/>
950            <exclude name="LongAccumulatorTest.java"/>
951            <exclude name="LongAdderTest.java"/>
952            <exclude name="CompletableFutureTest.java"/>
953            <exclude name="SplittableRandomTest.java"/>
954            <exclude name="StampedLockTest.java"/>
955            <exclude name="SubmissionPublisherTest.java"/>
956            <compilerarg value="-Werror"/>
957          </javac-elements>
958        </run-tck-tests>
959      </target>
960    
961    <target name="sw" depends="compile-j1"    <!-- Runs tck tests for jsr166-4jdk7 via junit task (dead experiment) -->
962            description="Runs the SwingWorker demo">    <target name="4jdk7-tck-junit" depends="4jdk7compile">
963    
964      <!--      <junit printsummary="true"
965      <java classname="jsr166.swing.SwingWorkerDemo" fork="true">             showoutput="true"
966        <classpath refid="j1.classpath"/>             errorProperty="junit.failed"
967      </java>             failureProperty="junit.failed"
968      -->             includeantruntime="true"
969               jvm="${java7}"
970               fork="true">
971    
972      <copy todir="${build.j1.dir}" file="${j1.src.dir}/jsr166/swing/SwingWorker.html"/>        <jvmarg value="-Xbootclasspath/p:${4jdk7product.jar}"/>
973          <jvmarg value="-server"/>
974    
975      <exec dir="${build.j1.dir}" executable="appletviewer.exe">        <classpath>
976        <arg value="${build.j1.dir}/SwingWorker.html"/>          <pathelement location="${junit.jar}"/>
977      </exec>          <pathelement location="${build.4jdk7.tck.classes.dir}"/>
978          </classpath>
979    
980    </target>        <formatter type="brief"/>
981    
982    <target name="j1" depends="compile-j1"        <test name="${jsr166.tckTestClass}" haltonfailure="no">
983            description="Runs a standalone JavaOne program">        </test>
984        </junit>
985      </target>
986    
987      <java classname="${j1.test}" fork="true">    <target name="4jdk7-jtreg" depends="4jdk7jar">
988        <classpath refid="j1.classpath"/>      <run-jtreg-tests
989        <jvmarg value="-client"/>         target="7"
990           workdir="${build.4jdk7.dir}"
991           classes="${4jdk7product.jar}"/>
992      </target>
993    
994      <target name="4jdk7-test" depends="4jdk7-tck, 4jdk7-jtreg"/>
995    
996      <target name="4jdk7docs">
997        <delete dir="${4jdk7docs.dir}"/>
998        <mkdir dir="${4jdk7docs.dir}"/>
999    
1000        <javadoc destdir="${4jdk7docs.dir}"
1001                 packagenames="none"
1002                 link="${java7.api.url}"
1003                 overview="${4jdk7src.dir}/intro.html"
1004                 access="${build.javadoc.access}"
1005                 sourcepath="${4jdk7src.dir}:${jdk7.src.dir}"
1006                 classpath=""
1007                 executable="${javadoc7}"
1008                 failonerror = "true">
1009          <fileset dir="${4jdk7src.dir}" defaultexcludes="yes">
1010            <include name="**/*.java"/>
1011          </fileset>
1012          <arg line="-Xdocrootparent ${java7.docroot.url}"/>
1013          <arg value="-XDignore.symbol.file=true"/>
1014        </javadoc>
1015      </target>
1016    
1017        <!-- WebCrawler args -->    <target name="4jdk7dist" depends="4jdk7dist-jar, 4jdk7dist-docs"/>
       <arg value="jsr166.webcrawler.WebCrawler3"/>  
       <arg value="http://www.priorartisans.com"/>  
       <arg value="25"/>  
1018    
1019      </java>    <target name="4jdk7clean">
1020        <delete dir="${build.4jdk7.dir}"/>
1021      </target>
1022    
1023      <target name="4jdk7dist-jar" depends="4jdk7clean, 4jdk7jar">
1024        <copy file="${4jdk7product.jar}" todir="${dist.dir}"/>
1025    </target>    </target>
1026    
1027      <target name="4jdk7dist-docs" depends="4jdk7clean, 4jdk7docs">
1028        <mirror-dir src="${4jdk7docs.dir}" dst="${dist.4jdk7docs.dir}"/>
1029      </target>
1030    
   <target name="test-j1" depends="compile-j1"  
           description="Runs testcases from the JavaOne source directories">  
1031    
1032      <junit printsummary="true"    <!-- jsr166x (no longer maintained) -->
              showoutput="true"  
           errorProperty="junit.failed"  
         failureProperty="junit.failed"  
                     dir="${build.j1.dir}"  
                    fork="true">  
   
       <!-- <jvmarg value="-server"/> -->  
       <classpath refid="j1.classpath"/>  
       <formatter type="xml"/>  
   
       <batchtest todir="${build.j1.dir}">  
         <fileset dir="${j1.src.dir}">  
           <include name="**/*Test.java"/>  
         </fileset>  
       </batchtest>  
1033    
1034      </junit>    <target name="jsr166xcompile" depends="configure-compiler">
1035        <mkdir dir="${build.jsr166x.classes.dir}"/>
1036    
1037      <available property="junit.report.format"      <javac srcdir="${topsrc.dir}"
1038                    value="frames"             destdir="${build.jsr166x.classes.dir}"
1039                classname="org.apache.xalan.lib.Redirect"/>             debug="${build.debug}"
1040      <property name="junit.report.format" value="noframes"/>             debuglevel="${build.debuglevel}"
1041               deprecation="${build.deprecation}"
1042      <junitreport todir="${build.j1.dir}">             classpath=""
1043        <fileset dir="${build.j1.dir}">             bootclasspath="${bootclasspath6}"
1044          <include name="TEST-*.xml"/>             source="5"
1045        </fileset>             target="5"
1046        <report styledir="${stylesheet.dir}"             includeAntRuntime="false"
1047                  format="${junit.report.format}"             includeJavaRuntime="false"
1048                   todir="${build.j1.dir}"             encoding="ASCII"
1049        />             executable="${javac7}"
1050      </junitreport>             fork="true">
1051          <include name="jsr166x/**/*.java"/>
1052          <compilerarg value="-XDignore.symbol.file=true"/>
1053          <compilerarg value="-Xlint:all,-unchecked,-rawtypes"/>
1054          <compilerarg value="-Werror"/>
1055          <compilerarg line="${build.args}"/>
1056        </javac>
1057      </target>
1058    
1059      <fail message="Test Cases Failed" if="junit.failed"/>    <target name="jsr166xjar" depends="jsr166xcompile">
1060        <jar destfile="${jsr166x.jar}">
1061          <fileset dir="${build.jsr166x.classes.dir}"/>
1062          <manifest>
1063            <attribute name="Built-By" value="${user.name}"/>
1064            <attribute name="Implementation-Vendor" value="JCP JSR-166 Expert Group."/>
1065          </manifest>
1066        </jar>
1067      </target>
1068    
1069      <target name="jsr166xdocs">
1070        <delete dir="${jsr166xdocs.dir}"/>
1071        <mkdir dir="${jsr166xdocs.dir}"/>
1072    
1073        <javadoc destdir="${jsr166xdocs.dir}"
1074                 packagenames="jsr166x.*"
1075                 link="${java.api.url}"
1076                 access="${build.javadoc.access}"
1077                 sourcepath="${topsrc.dir}:${jdk6.src.dir}"
1078                 bootclasspath="${bootclasspath6}"
1079                 source="5"
1080                 executable="${javadoc7}"
1081                 failonerror = "true">
1082          <arg line="-Xdocrootparent ${java.docroot.url}"/>
1083          <arg value="-XDignore.symbol.file=true"/>
1084        </javadoc>
1085    </target>    </target>
1086    
1087      <target name="jsr166xdist" depends="jsr166xdist-jar, jsr166xdist-docs"/>
1088    
1089      <target name="jsr166xclean">
1090        <delete dir="${build.jsr166x.dir}"/>
1091      </target>
1092    
1093    <!-- C++ and JNI definitions and demos -->    <target name="jsr166xdist-jar" depends="jsr166xclean, jsr166xjar">
1094        <copy file="${jsr166x.jar}" todir="${dist.dir}"/>
1095      </target>
1096    
1097    <target name="configure-cpp">    <target name="jsr166xdist-docs" depends="jsr166xclean, jsr166xdocs">
1098        <mirror-dir src="${jsr166xdocs.dir}" dst="${dist.jsr166xdocs.dir}"/>
1099      </target>
1100    
     <!-- Define tasks and types -->  
1101    
1102      <path id="cpptasks.path">    <!-- jsr166y (no longer maintained) -->
       <pathelement location="${lib.dir}/cpptasks.jar"/>  
     </path>  
     <taskdef resource="cpptasks.tasks" classpathref="cpptasks.path"/>  
     <typedef resource="cpptasks.types" classpathref="cpptasks.path"/>  
1103    
1104      <!-- Set platform property for JNI includes -->    <target name="jsr166ycompile" depends="configure-compiler">
1105        <mkdir dir="${build.jsr166y.classes.dir}"/>
1106    
1107      <condition property="platform" value="linux">      <javac srcdir="${topsrc.dir}"
1108        <os name="Linux"/>             destdir="${build.jsr166y.classes.dir}"
1109      </condition>             debug="${build.debug}"
1110      <condition property="platform" value="win32">             debuglevel="${build.debuglevel}"
1111        <os family="windows"/>             deprecation="${build.deprecation}"
1112      </condition>             source="6"
1113      <condition property="platform" value="solaris">             target="6"
1114        <os name="SunOS"/>             classpath=""
1115      </condition>             bootclasspath="${bootclasspath6}"
1116               includeAntRuntime="false"
1117               includeJavaRuntime="false"
1118               encoding="ASCII"
1119               executable="${javac7}"
1120               fork="true">
1121    
1122          <include name="jsr166y/**/*.java"/>
1123          <compilerarg value="-XDignore.symbol.file=true"/>
1124          <compilerarg value="-Xlint:all"/>
1125          <compilerarg value="-Werror"/>
1126          <compilerarg line="${build.args}"/>
1127        </javac>
1128    </target>    </target>
1129    
1130      <target name="jsr166yjar" depends="jsr166ycompile">
1131        <jar destfile="${jsr166y.jar}" index="true">
1132          <fileset dir="${build.jsr166y.classes.dir}"/>
1133          <manifest>
1134            <attribute name="Built-By" value="${user.name}"/>
1135            <attribute name="Implementation-Vendor" value="JCP JSR-166 Expert Group."/>
1136          </manifest>
1137        </jar>
1138      </target>
1139    
1140    <target name="cppdemo" depends="configure-cpp">    <target name="jsr166ydocs">
1141        <delete dir="${jsr166ydocs.dir}"/>
1142        <mkdir dir="${jsr166ydocs.dir}"/>
1143    
1144        <javadoc destdir="${jsr166ydocs.dir}"
1145                 packagenames="jsr166y.*"
1146                 link="${java.api.url}"
1147                 access="${build.javadoc.access}"
1148                 sourcepath="${topsrc.dir}:${jdk6.src.dir}"
1149                 bootclasspath="${bootclasspath6}"
1150                 source="6"
1151                 executable="${javadoc7}"
1152                 failonerror = "true">
1153          <arg line="-Xdocrootparent ${java.docroot.url}"/>
1154          <arg value="-XDignore.symbol.file=true"/>
1155        </javadoc>
1156      </target>
1157    
1158      <mkdir dir="${build.dir}"/>    <target name="jsr166ydist" depends="jsr166ydist-jar, jsr166ydist-docs"/>
1159    
1160      <cc multithreaded="true"    <target name="jsr166yclean">
1161                   name="g++"      <delete dir="${build.jsr166y.dir}"/>
1162                 objdir="${build.dir}"    </target>
               outfile="${build.dir}/CppDemo">  
       <fileset dir="${test.src.dir}" includes="CppDemo.cpp"/>  
       <libset libs="stdc++"/>  
     </cc>  
1163    
1164      <exec executable="${build.dir}/CppDemo">    <target name="jsr166ydist-jar" depends="jsr166yclean, jsr166yjar">
1165        <arg line="count in word frequency of word in command line count"/>      <copy file="${jsr166y.jar}" todir="${dist.dir}"/>
1166      </exec>    </target>
1167    
1168      <target name="jsr166ydist-docs" depends="jsr166yclean, jsr166ydocs">
1169        <mirror-dir src="${jsr166ydocs.dir}" dst="${dist.jsr166ydocs.dir}"/>
1170    </target>    </target>
1171    
1172    
1173    <target name="jnidemo" depends="init, configure-compiler, configure-cpp">    <!-- extra166y (no longer maintained) -->
1174    
1175      <mkdir dir="${build.testcases.dir}"/>    <target name="extra166ycompile" depends="configure-compiler, jsr166yjar">
1176        <mkdir dir="${build.extra166y.classes.dir}"/>
1177    
1178      <javac srcdir="${test.src.dir}"      <javac srcdir="${topsrc.dir}"
1179            destdir="${build.testcases.dir}"             destdir="${build.extra166y.classes.dir}"
1180              debug="${build.debug}"             debug="${build.debug}"
1181         debuglevel="${build.debuglevel}"             debuglevel="${build.debuglevel}"
1182        deprecation="${build.deprecation}"             deprecation="${build.deprecation}"
1183             source="${build.sourcelevel}"             bootclasspath="@{jsr166y.jar}:${bootclasspath6}"
1184               fork="true">             classpath=""
1185        <compilerarg value="${bootclasspath.args}"/>             source="6"
1186               target="6"
1187               includeAntRuntime="false"
1188               includeJavaRuntime="false"
1189               encoding="ASCII"
1190               executable="${javac7}"
1191               fork="true">
1192    
1193          <include name="extra166y/**/*.java"/>
1194          <compilerarg value="-XDignore.symbol.file=true"/>
1195          <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial"/>
1196          <compilerarg value="-Werror"/>
1197        <compilerarg line="${build.args}"/>        <compilerarg line="${build.args}"/>
       <classpath refid="test.classpath"/>  
       <include name="JniDemo.java"/>  
1198      </javac>      </javac>
1199      </target>
1200    
1201      <javah destdir="${build.testcases.dir}"    <target name="extra166yjar" depends="extra166ycompile">
1202        classpathref="test.classpath">      <jar destfile="${extra166y.jar}" index="true">
1203        <class name="JniDemo"/>        <fileset dir="${build.extra166y.classes.dir}"/>
1204      </javah>        <manifest>
1205            <attribute name="Built-By" value="${user.name}"/>
1206      <cc multithreaded="true"          <attribute name="Implementation-Vendor" value="JCP JSR-166 Expert Group."/>
1207                   name="g++"        </manifest>
1208                 objdir="${build.dir}"      </jar>
1209                outfile="${build.dir}/JniDemo"    </target>
               outtype="shared">  
   
       <compiler>  
         <defineset>  
           <define name="__int64" value="long long"/>  
         </defineset>  
         <includepath location="${java.home}/../include"/>  
         <includepath location="${java.home}/../include/${platform}"/>  
         <compilerarg value="-mno-cygwin"/>  
       </compiler>  
   
       <linker>  
         <linkerarg value="--add-stdcall-alias"/>  
       </linker>  
   
       <includepath location="${build.testcases.dir}"/>  
   
       <fileset dir="${test.src.dir}" includes="JniDemo.cpp"/>  
   
       <libset libs="stdc++"/>  
1210    
1211      </cc>    <target name="extra166ydocs">
1212        <delete dir="${extra166ydocs.dir}"/>
1213        <mkdir dir="${extra166ydocs.dir}"/>
1214    
1215        <javadoc destdir="${extra166ydocs.dir}"
1216                 packagenames="extra166y.*"
1217                 link="${java.api.url}"
1218                 access="${build.javadoc.access}"
1219                 sourcepath="${topsrc.dir}:${jdk6.src.dir}"
1220                 bootclasspath="${bootclasspath6}"
1221                 source="6"
1222                 executable="${javadoc7}">
1223          <arg line="-Xdocrootparent ${java.docroot.url}"/>
1224          <arg value="-XDignore.symbol.file=true"/>
1225        </javadoc>
1226      </target>
1227    
1228      <!-- Necessary if windows, harmless if not -->    <target name="extra166ydist" depends="extra166ydist-jar, extra166ydist-docs"/>
     <copy file="${build.dir}/libJniDemo.so" tofile="${build.dir}/JniDemo.dll"/>  
1229    
1230      <java classname="JniDemo" fork="true">    <target name="extra166yclean">
1231        <!-- Watch out: path separator hardwired to semicolon here! -->      <delete dir="${build.extra166y.dir}"/>
1232        <sysproperty key="java.library.path" path="${java.library.path};${build.dir}"/>    </target>
       <classpath refid="test.classpath"/>  
       <arg line="count in word frequency of word in command line count"/>  
     </java>  
1233    
1234      <target name="extra166ydist-jar" depends="extra166yclean, extra166yjar">
1235        <copy file="${extra166y.jar}" todir="${dist.dir}"/>
1236    </target>    </target>
1237    
1238      <target name="extra166ydist-docs" depends="extra166yclean, extra166ydocs">
1239        <mirror-dir src="${extra166ydocs.dir}" dst="${dist.extra166ydocs.dir}"/>
1240      </target>
1241    
1242    
1243    <!-- Backward compatibility, work in progress (some files not checked in) -->    <!-- jsr166e (no longer maintained) -->
1244    
1245      <property name="build.jsr166e.java.version" value="6"/>
1246      <property name="build.jsr166e.javac" value="${javac6}"/>
1247    
1248      <target name="jsr166ecompile" depends="configure-compiler">
1249        <mkdir dir="${build.jsr166e.classes.dir}"/>
1250    
1251    <property name="pretiger.src.dir"     location="${build.dir}/pretiger/src"/>      <javac srcdir="${topsrc.dir}"
1252    <property name="build.pretiger.dir"   location="${build.dir}/pretiger/classes"/>             destdir="${build.jsr166e.classes.dir}"
1253    <property name="pretiger.jar"         location="${build.lib.dir}/jsr166-pretiger.jar"/>             debug="${build.debug}"
1254    <property name="pretiger.sourcelevel" value="1.4"/>             debuglevel="${build.debuglevel}"
1255               deprecation="${build.deprecation}"
1256               source="${build.jsr166e.java.version}"
1257               target="${build.jsr166e.java.version}"
1258               classpath=""
1259               includeAntRuntime="false"
1260               includeJavaRuntime="false"
1261               executable="${build.jsr166e.javac}"
1262               fork="true">
1263    
1264    <target name="defang"        <include name="jsr166e/**/*.java"/>
1265         depends="init"        <compilerarg value="-XDignore.symbol.file=true"/>
1266     description="Generates pre-Tiger compatible source">        <compilerarg value="-Xlint:all"/>
1267          <compilerarg value="-Werror"/>
1268          <compilerarg line="${build.args}"/>
1269        </javac>
1270      </target>
1271    
1272      <delete dir="${pretiger.src.dir}"/>    <target name="jsr166edoclint">
1273      <mkdir dir="${pretiger.src.dir}"/>      <mkdir dir="${build.jsr166e.classes.dir}"/>
1274    
1275      <exec executable="perl">      <javac srcdir="${topsrc.dir}"
1276        <arg file="etc/defang.pl"/>             destdir="${build.jsr166e.classes.dir}"
1277        <!-- <arg value="-v"/> -->             debug="${build.debug}"
1278        <arg value="-s"/> <arg file="${src.dir}"/>             debuglevel="${build.debuglevel}"
1279        <arg value="-t"/> <arg file="${pretiger.src.dir}"/>             deprecation="${build.deprecation}"
1280      </exec>             source="${build.jsr166e.java.version}"
1281               target="${build.jsr166e.java.version}"
1282               classpath=""
1283               bootclasspath="${bootclasspath6}"
1284               includeAntRuntime="false"
1285               includeJavaRuntime="false"
1286               executable="${javac8}"
1287               fork="true">
1288    
1289          <include name="jsr166e/**/*.java"/>
1290          <compilerarg value="-XDignore.symbol.file=true"/>
1291          <compilerarg value="-Xlint:all"/>
1292          <compilerarg value="-Werror"/>
1293          <compilerarg value="-Xdoclint:all/protected"/>
1294        </javac>
1295      </target>
1296    
1297      <target name="jsr166ejar" depends="jsr166ecompile">
1298        <jar destfile="${jsr166e.jar}" index="true">
1299          <fileset dir="${build.jsr166e.classes.dir}"/>
1300          <manifest>
1301            <attribute name="Built-By" value="${user.name}"/>
1302            <attribute name="Implementation-Vendor" value="JCP JSR-166 Expert Group."/>
1303          </manifest>
1304        </jar>
1305    </target>    </target>
1306    
1307    <target name="compile-pretiger"    <target name="jsr166edocs">
1308            depends="init, configure-compiler, defang"      <delete dir="${jsr166edocs.dir}"/>
1309            description="Compiles pre-Tiger sources to build folder">      <mkdir dir="${jsr166edocs.dir}"/>
1310    
1311        <javadoc destdir="${jsr166edocs.dir}"
1312                 packagenames="jsr166e.*"
1313                 link="${java.api.url}"
1314                 access="${build.javadoc.access}"
1315                 sourcepath="${topsrc.dir}:${jdk6.src.dir}"
1316                 source="${build.jsr166e.java.version}"
1317                 executable="${javadoc7}"
1318                 failonerror = "true">
1319          <arg line="-Xdocrootparent ${java.docroot.url}"/>
1320          <arg value="-XDignore.symbol.file=true"/>
1321        </javadoc>
1322      </target>
1323    
1324      <mkdir dir="${build.pretiger.dir}"/>    <target name="jsr166e-tck-one-java-version" depends="jsr166ejar">
1325        <echo message="Testing with jdk${build.jsr166e.java.version} ..."/>
1326        <run-tck-tests
1327          tck.src.dir="${test.src.dir}/tck-jsr166e"
1328          target="${build.jsr166e.java.version}"
1329          workdir="${build.jsr166e.dir}"
1330          classes="${jsr166e.jar}"/>
1331      </target>
1332    
1333      <target name="jsr166e-tck">
1334    
1335    <!--     <antcall target="clean"/> -->
1336    <!--     <antcall target="jsr166e-tck-one-java-version"> -->
1337    <!--       <param name="build.jsr166e.java.version" value="8"/> -->
1338    <!--       <param name="build.jsr166e.javac" value="${javac8}"/> -->
1339    <!--     </antcall> -->
1340    
1341        <antcall target="clean"/>
1342        <antcall target="jsr166e-tck-one-java-version">
1343          <param name="build.jsr166e.java.version" value="7"/>
1344          <param name="build.jsr166e.javac" value="${javac7}"/>
1345        </antcall>
1346    
1347        <antcall target="clean"/>
1348        <antcall target="jsr166e-tck-one-java-version">
1349          <param name="build.jsr166e.java.version" value="6"/>
1350          <param name="build.jsr166e.javac" value="${javac6}"/>
1351        </antcall>
1352      </target>
1353    
1354      <target name="jsr166e-test" depends="jsr166e-tck"/>
1355    
1356      <target name="jsr166edist" depends="jsr166edist-jar, jsr166edist-docs"/>
1357    
1358      <target name="jsr166eclean">
1359        <delete dir="${build.jsr166e.dir}"/>
1360      </target>
1361    
1362      <target name="jsr166edist-jar"
1363              depends="jsr166eclean, jsr166ejar">
1364        <copy file="${jsr166e.jar}" todir="${dist.dir}"/>
1365      </target>
1366    
1367      <target name="jsr166edist-docs" depends="jsr166eclean, jsr166edocs">
1368        <mirror-dir src="${jsr166edocs.dir}" dst="${dist.jsr166edocs.dir}"/>
1369      </target>
1370    
1371    
1372    <!-- Find buglets that can be detected by static build tools -->
1373    
1374      <target name="lint">
1375        <antcall target="dists">
1376          <param name="build.javadoc.access" value="public"/>
1377        </antcall>
1378      </target>
1379    
1380    <!-- Generates all doclint warnings, even for private methods (rarely useful) -->
1381      <target name="lint-private">
1382        <antcall target="dist">
1383          <param name="build.javadoc.access" value="private"/>
1384        </antcall>
1385      </target>
1386    
1387    
1388    <!-- ==============================================================
1389      Experimental errorprone support - http://errorprone.info
1390    =================================================================== -->
1391      <property name="errorprone.jar" location="${lib.dir}/error_prone_ant-2.2.0.jar"/>
1392      <property name="errorprone.jsr166.flags"
1393                value="-Xep:HashtableContains:OFF
1394                       -Xep:JdkObsolete:OFF
1395                       -Xep:MissingOverride:OFF
1396                       -Xep:MissingFail:OFF
1397                       -Xep:MixedArrayDimensions:ERROR
1398                       -Xep:RemoveUnusedImports:ERROR
1399                       -Xep:EmptyIf:ERROR
1400                       -Xep:MultipleTopLevelClasses:ERROR
1401                       -Xep:ClassName:ERROR
1402                       -Xep:LongLiteralLowerCaseSuffix:ERROR
1403                       -Xep:RedundantThrows:ERROR
1404                       -Xep:IdentityBinaryExpression:WARN
1405                       -Xep:MethodCanBeStatic:WARN"/>
1406      <!-- -Xep:WildcardImport:ERROR -->
1407      <property name="errorprone.jsr166.test.flags"
1408                value="-Xep:StringSplitter:OFF
1409                       -Xep:BoxedPrimitiveConstructor:OFF
1410                       -Xep:ModifyingCollectionWithItself:OFF"/>
1411      <!-- ant -emacs errorprone |& grep -EA1 '(warning|error):|warnings' -->
1412      <target name="errorprone"
1413              depends="clean, configure-compiler"
1414              description="Run errorprone over jsr166 source code (experimental)">
1415    
1416        <local name="destdir"/>
1417        <property name="destdir" value="${build.classes.dir}/java.base"/>
1418        <mkdir dir="${destdir}"/>
1419    
1420      <javac srcdir="${pretiger.src.dir}"      <javac srcdir="${src.dir}"
1421            destdir="${build.pretiger.dir}"             destdir="${destdir}"
1422              debug="${build.debug}"             debug="${build.debug}"
1423         debuglevel="${build.debuglevel}"             debuglevel="${build.debuglevel}"
1424        deprecation="${build.deprecation}"             deprecation="${build.deprecation}"
1425             source="${pretiger.sourcelevel}"             classpath=""
1426               fork="true">             includeAntRuntime="false"
1427               includeJavaRuntime="false"
1428               encoding="ASCII"
1429               executable="${build.main.javac}"
1430               fork="true">
1431    
1432          <include name="**/*.java"/>
1433          <compilerarg value="-XDcompilePolicy=simple"/>
1434          <compilerarg line="-processorpath ${errorprone.jar}"/>
1435          <compilerarg value="-Xplugin:ErrorProne
1436                              ${errorprone.jsr166.flags}"/>
1437          <compilerarg value="--patch-module=java.base=${src.dir}"/>
1438          <compilerarg value="-Xprefer:source"/>
1439          <compilerarg value="-XDignore.symbol.file=true"/>
1440          <compilerarg value="-Xlint:all"/>
1441          <compilerarg value="-Xdoclint:all/protected,reference/private"/>
1442          <compilerarg line="-Xmaxerrs 3000 -Xmaxwarns 3000"/>
1443        <compilerarg line="${build.args}"/>        <compilerarg line="${build.args}"/>
       <exclude name="**/Thread.java"/>  
   
1444      </javac>      </javac>
1445    
1446    </target>      <jar destfile="${product.jar}">
1447          <fileset dir="${destdir}"/>
   <target name="pretiger" depends="compile-pretiger">  
   
     <mkdir dir="${build.lib.dir}"/>  
   
     <jar destfile="${pretiger.jar}">  
       <fileset dir="${build.pretiger.dir}">  
       </fileset>  
1448      </jar>      </jar>
1449    
1450        <run-tck-tests
1451          target="${build.main.java.version}"
1452          workdir="${build.dir}"
1453          classes="${product.jar}">
1454          <javac-elements>
1455            <compilerarg value="-XDcompilePolicy=simple"/>
1456            <compilerarg line="-processorpath ${errorprone.jar}"/>
1457            <compilerarg value="-Xplugin:ErrorProne
1458                                ${errorprone.jsr166.flags}
1459                                ${errorprone.jsr166.test.flags}"/>
1460            <compilerarg line="-Xmaxerrs 3000 -Xmaxwarns 3000"/>
1461          </javac-elements>
1462        </run-tck-tests>
1463      </target>
1464    
1465      <!-- ant -emacs errorprone-jtreg |& grep -EA1 '(warning|error):' -->
1466      <!-- -XDcompilePolicy=simple or byfile avoids confusing UnusedImports -->
1467      <target name="errorprone-jtreg"
1468              depends="jar"
1469              description="Run errorprone over jtreg tests (experimental)">
1470    
1471        <run-jtreg-tests
1472           target="${build.main.java.version}"
1473           workdir="${build.dir}"
1474           classes="${product.jar}"
1475           verbose="all">
1476          <jtreg-elements>
1477            <arg value="-javacoption:-XDcompilePolicy=simple"/>
1478            <arg value="-javacoption:-processorpath"/>
1479            <arg value="-javacoption:${errorprone.jar}"/>
1480            <arg value="-javacoption:-Xplugin:ErrorProne
1481                                ${errorprone.jsr166.flags}
1482                                ${errorprone.jsr166.test.flags}
1483                                -Xep:NonAtomicVolatileUpdate:OFF"/>
1484          </jtreg-elements>
1485        </run-jtreg-tests>
1486      </target>
1487    
1488    
1489    <!-- ==============================================================
1490      Running guava tests against jsr166 code
1491    =================================================================== -->
1492    
1493    <!-- <ivy:cachepath pathid="lib.path.id" inline="true" conf="*" -->
1494    <!--   organisation="com.google.guava" module="guava-testlib" revision="21.0"/> -->
1495    <!-- <property name="guava.version" value="21.0"/> -->
1496    
1497    <!-- HOWTO debug print a path id -->
1498    <!-- <pathconvert property="guava.testlib.classpath" refid="guava.testlib.classpath" /> -->
1499    <!-- <echo message="guava.testlib.classpath=${guava.testlib.classpath}"/> -->
1500    
1501    <!-- <ivy:retrieve pathid="guava.tests.classpath" type="jar" inline="true" conf="*" pattern="${lib.dir}/[type]/[artifact].[ext]" -->
1502    <!--   organisation="com.google.guava" module="guava-tests"/> -->
1503    <!-- <get src="http://repo2.maven.org/maven2/com/google/guava/guava-tests/${guava.version}/guava-tests-${guava.version}-tests.jar" -->
1504    <!--   dest="${lib.dir}/jar/guava-tests-tests.jar" usetimestamp="true"/> -->
1505    <!--     <ivy:cachepath pathid="lib.path.id" inline="true" conf="*" type="*" -->
1506    <!--       organisation="com.google.guava" module="guava-testlib" revision="${guava.version}"/> -->
1507    
1508    <!-- <test name="com.google.common.collect.testing.TestsForQueuesInJavaUtil"/> -->
1509    <!-- <test name="com.google.common.collect.testing.TestsForListsInJavaUtil"/> -->
1510    <!-- <test name="com.google.common.collect.testing.TestsForSetsInJavaUtil"/> -->
1511    <!-- <test name="com.google.common.collect.testing.TestsForMapsInJavaUtil"/> -->
1512    
1513    <!-- <ivy:retrieve pathid="guava.testlib.classpath" -->
1514    <!--   type="*" inline="true" conf="*(private),*(public)" -->
1515    <!--   pattern="${guava.dir}/[artifact].[ext]" -->
1516    <!--   organisation="com.google.guava" module="guava-testlib"/> -->
1517    
1518    <!-- Work around bug below by downloading guava-testlib-tests.jar "by hand": -->
1519    <!-- https://issues.apache.org/jira/browse/IVY-1444 -->
1520    <!-- maven tests artifacts cannot be downloaded because they are mapped to private configurations -->
1521    
1522      <target name="init-ivy">
1523        <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar"
1524             dest="${build.dir}/ivy.jar" usetimestamp="true" skipexisting="true"/>
1525        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant"
1526                 classpath="${build.dir}/ivy.jar"/>
1527      </target>
1528    
1529      <target name="guava-tests" depends="jar, init-ivy"
1530              description="Guava tests run against jsr166 collections">
1531        <property name="guava.dir" value="${build.dir}/guava-testlib"/>
1532        <mkdir dir="${guava.dir}"/>
1533        <ivy:retrieve pathid="guava.testlib.classpath"
1534          type="jar,bundle" inline="true" conf="default,master"
1535          pattern="${guava.dir}/[artifact].[ext]"
1536          organisation="com.google.guava" module="guava-testlib"/>
1537        <property name="guava.version" value="21.0"/>
1538        <get src="http://repo2.maven.org/maven2/com/google/guava/guava-testlib/${guava.version}/guava-testlib-${guava.version}-tests.jar"
1539             dest="${guava.dir}/guava-testlib-tests.jar" usetimestamp="true"/>
1540        <junit printsummary="true" showoutput="true" haltonfailure="true"
1541               jvm="${build.main.java}" fork="true">
1542          <jvmarg line="-ea -esa --patch-module=java.base=${product.jar}"/>
1543          <formatter type="brief"/>
1544          <classpath>
1545            <pathelement location="${guava.dir}/guava-testlib-tests.jar"/>
1546            <path refid="guava.testlib.classpath"/>
1547          </classpath>
1548    
1549          <!-- "6" in "OpenJdk6Tests" misleadingly means "6+" -->
1550          <test name="com.google.common.collect.testing.OpenJdk6Tests"/>
1551        </junit>
1552    </target>    </target>
1553    
1554  </project>  </project>

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.266

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