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

Diff of /jsr166/build.xml

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

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

Legend:
Removed from v.1.124  
changed lines
  Added in v.1.272

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8