ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
(Generate patch)

Comparing jsr166/build.xml (file contents):
Revision 1.253 by jsr166, Sun Sep 24 00:47:54 2017 UTC vs.
Revision 1.276 by jsr166, Wed Sep 26 06:40:33 2018 UTC

# Line 1 | Line 1
1   <project name="jsr166" default="usage"
2 <  xmlns:if="ant:if" xmlns:unless="ant:unless"
2 >  xmlns:if="ant:if"
3 >  xmlns:unless="ant:unless"
4    xmlns:ivy="antlib:org.apache.ivy.ant">
5  
6    <description>
# Line 21 | Line 22
22    $HOME/jdk/jdk8
23    $HOME/jdk/jdk9
24    $HOME/jdk/jdk10
25 +  $HOME/jdk/jdk11
26 +  $HOME/jdk/jdk12
27    where each of the above is a JDK or a symlink to same, and
28    $HOME/jdk/src/jdk8
29    $HOME/jdk/src/jdk9
30    $HOME/jdk/src/jdk10
31 +  $HOME/jdk/src/jdk11
32 +  $HOME/jdk/src/jdk12
33    where each of the above is a complete JDK source tree
34    (e.g. mercurial forest) or a symlink to same.
35  
# Line 101 | Line 106
106      <property name="jdk@{v}.src.dir" location="${jdk@{v}.src.home}/jdk/src/share/classes"
107        unless:set="have.java.base"/>
108      <local name="modules"/>
109 <    <available property="modules" file="${jdk@{v}.home}/jmods" type="dir"/>
109 >    <available property="modules" file="${jdk@{v}.home}/lib/modules" type="file"/>
110      <local name="boot.jar.dir"/>
111      <property name="boot.jar.dir"   location="${jdk@{v}.home}/jre/lib" unless:set="modules"/>
112      <path id="bootclasspath@{v}" unless:set="modules">
# Line 132 | Line 137
137    <defjdklocations v="8"/>
138    <defjdklocations v="9"/>
139    <defjdklocations v="10"/>
140 +  <defjdklocations v="11"/>
141 +  <defjdklocations v="12"/>
142  
143    <!-- Source locations -->
144    <property name="src.dir"              location="${basedir}/src/main"/>
# Line 142 | Line 149
149    <property name="jtreg8.src.dir"       location="${test.src.dir}/jtreg-jdk8"/>
150    <property name="jtreg9.src.dir"       location="${test.src.dir}/jtreg"/>
151    <property name="jtreg10.src.dir"      location="${test.src.dir}/jtreg"/>
152 +  <property name="jtreg11.src.dir"      location="${test.src.dir}/jtreg"/>
153 +  <property name="jtreg12.src.dir"      location="${test.src.dir}/jtreg"/>
154    <property name="jtreg.src.dir"        location="${jtreg9.src.dir}"/>
155    <property name="lib.dir"              location="${basedir}/lib"/>
156    <property name="dist.dir"             location="${basedir}/dist"/>
# Line 181 | Line 190
190    <property name="junit.jar"        location="${lib.dir}/junit.jar"/>
191  
192    <!-- Canonical location of jdk docs root, to use with javadoc -Xdocrootparent flag -->
193 <  <property name="java5.docroot.url"  value="http://docs.oracle.com/javase/1.5.0/docs"/>
194 <  <property name="java6.docroot.url"  value="http://docs.oracle.com/javase/6/docs"/>
195 <  <property name="java7.docroot.url"  value="http://docs.oracle.com/javase/7/docs"/>
196 <  <property name="java8.docroot.url"  value="http://docs.oracle.com/javase/8/docs"/>
197 <  <property name="java9.docroot.url"  value="http://docs.oracle.com/javase/9/docs"/>
198 <  <!-- The location of jdk9 early access docs -->
193 >  <!-- Switched to https: in 2017-10 - JDK-8190312 -->
194 >  <property name="java5.docroot.url"  value="https://docs.oracle.com/javase/1.5.0/docs"/>
195 >  <property name="java6.docroot.url"  value="https://docs.oracle.com/javase/6/docs"/>
196 >  <property name="java7.docroot.url"  value="https://docs.oracle.com/javase/7/docs"/>
197 >  <property name="java8.docroot.url"  value="https://docs.oracle.com/javase/8/docs"/>
198 >  <property name="java9.docroot.url"  value="https://docs.oracle.com/javase/9/docs"/>
199 >  <property name="java10.docroot.url" value="https://docs.oracle.com/javase/10/docs"/>
200 >  <property name="java11.docroot.url" value="https://docs.oracle.com/en/java/javase/11/docs"/>
201 >  <!-- The location of jdk early access docs (RIP) -->
202    <!-- <property name="java9.docroot.url" value="http://download.java.net/java/jdk9/docs"/> -->
203 +  <!-- <property name="java10.docroot.url" value="http://download.java.net/java/jdk10/docs"/> -->
204 +  <!-- <property name="java11.docroot.url" value="http://download.java.net/java/jdk11/docs"/> -->
205 +  <property name="java12.docroot.url" value="https://download.java.net/java/jdk12/docs"/>
206    <!-- Default jdk doc location (latest stable release seems best) -->
207 <  <property name="java.docroot.url"   value="${java9.docroot.url}"/>
207 >  <property name="java.docroot.url"   value="${java11.docroot.url}"/>
208  
209    <!-- Canonical location of jdk API docs, to use with javadoc link attribute -->
210    <property name="java5.api.url"      value="${java5.docroot.url}/api/"/>
# Line 197 | Line 212
212    <property name="java7.api.url"      value="${java7.docroot.url}/api/"/>
213    <property name="java8.api.url"      value="${java8.docroot.url}/api/"/>
214    <property name="java9.api.url"      value="${java9.docroot.url}/api/"/>
215 +  <property name="java10.api.url"     value="${java10.docroot.url}/api/"/>
216 +  <property name="java11.api.url"     value="${java11.docroot.url}/api/"/>
217 +  <property name="java12.api.url"     value="${java12.docroot.url}/api/"/>
218    <property name="java.api.url"       value="${java.docroot.url}/api/"/>
219  
220    <!-- Define the "jtreg" task -->
# Line 229 | Line 247
247  
248      <local name="modules"/>
249      <condition property="modules">
250 <      <available file="${jdk@{compile-target}.home}/jmods" type="dir"/>
250 >      <available file="${jdk@{compile-target}.home}/lib/modules" type="file"/>
251      </condition>
252  
253      <local name="use-doclint"/>
# Line 296 | Line 314
314    </macrodef>
315  
316    <!-- Define jtreg test sets for different jdk versions -->
317 <  <fileset dir="${jtreg10.src.dir}">
318 <    <patternset id="jdk10.jtreg.tests">
319 <      <include name="**/*.java"/>
320 <    </patternset>
321 <  </fileset>
322 <
323 <  <fileset dir="${jtreg9.src.dir}">
324 <    <patternset id="jdk9.jtreg.tests">
325 <      <include name="**/*.java"/>
326 <    </patternset>
327 <  </fileset>
328 <
329 <  <fileset dir="${jtreg8.src.dir}">
312 <    <patternset id="jdk8.jtreg.tests">
313 <      <include name="**/*.java"/>
314 <    </patternset>
315 <  </fileset>
317 >  <!-- ant -Djtreg.test.pattern="**/ConcurrentHashMap/" -->
318 >  <!-- ant -Djtreg.test.pattern="**/ToArray.java" -->
319 >  <property name="jtreg.test.pattern" value="**/*.java"/>
320 >  <macrodef name="defjtregtests">
321 >    <attribute name="v"/>
322 >    <sequential>
323 >      <fileset dir="${jtreg@{v}.src.dir}">
324 >        <patternset id="jdk@{v}.jtreg.tests">
325 >          <include name="${jtreg.test.pattern}"/>
326 >        </patternset>
327 >      </fileset>
328 >    </sequential>
329 >  </macrodef>
330  
331 <  <fileset dir="${jtreg7.src.dir}">
332 <    <patternset id="jdk7.jtreg.tests">
333 <      <include name="**/*.java"/>
334 <    </patternset>
335 <  </fileset>
331 >  <defjtregtests v="12"/>
332 >  <defjtregtests v="11"/>
333 >  <defjtregtests v="10"/>
334 >  <defjtregtests v="9"/>
335 >  <defjtregtests v="8"/>
336 >  <defjtregtests v="7"/>
337  
338    <!-- ant -Djtreg.flags=-timeoutFactor:4 -->
339    <property name="jtreg.flags" value=""/>
# Line 328 | Line 343
343      <attribute name="target"/>
344      <attribute name="workdir"/>
345      <attribute name="classes"/>
346 +    <attribute name="verbose" default="${jtreg.verbose}"/>
347      <attribute name="jtregflags" default=""/>
348 +    <element name="jtreg-elements" optional="true"/>
349  
350      <sequential>
351  
# Line 337 | Line 354
354  
355      <local name="modules"/>
356      <condition property="modules">
357 <      <available file="${jdk@{target}.home}/jmods" type="dir"/>
357 >      <available file="${jdk@{target}.home}/lib/modules" type="file"/>
358      </condition>
359  
360      <delete dir="@{workdir}/JTwork"   quiet="true"/>
# Line 350 | Line 367
367        <arg value="-vmoptions:--patch-module=java.base=@{classes}" if:set="modules"/>
368        <arg value="-agentvm"/>
369        <arg value="-noreport"/>
370 <      <arg value="-verbose:${jtreg.verbose}"/>
370 >      <arg value="-verbose:@{verbose}"/>
371        <arg value="-vmoptions:-esa -ea"/>
372        <arg value="-automatic"/>
373        <arg value="-k:!ignore"/>
374        <arg line="@{jtregflags}"/>
375        <arg line="${jtreg.flags}"/>
376 +      <jtreg-elements/>
377      </jtreg>
378      </sequential>
379    </macrodef>
# Line 378 | Line 396
396      <sequential>
397        <property name="build.main.java"    value="${java@{v}}"/>
398        <property name="build.main.javac"   value="${javac@{v}}"/>
399 <      <property name="build.main.javadoc" value="${javadoc@{v}}"/>
399 >      <!-- Force javadoc version to be at least 10,
400 >           so we can use override-methods=summary -->
401 >      <condition property="build.main.javadoc"
402 >                 value="${javadoc11}"
403 >                 else="${javadoc@{v}}">
404 >        <equals arg1="@{v}" arg2="9"/>
405 >      </condition>
406      </sequential>
407    </macrodef>
408    <define-build-main-properties v="${build.main.java.version}"/>
# Line 472 | Line 496
496        <arg value="-XDignore.symbol.file=true"/>
497        <arg value="-html5"/>
498        <arg value="--patch-module=java.base=${src.dir}"/>
499 <      <arg value="-tag"/>
500 <      <arg value="${javadoc.jls.option}"/>
501 < <!-- @apiNote currently unused -->
502 < <!--       <arg value="-tag"/> -->
503 < <!--       <arg value="apiNote:a:API Note:"/> -->
480 <      <arg value="-tag"/>
481 <      <arg value="implSpec:a:Implementation Requirements:"/>
482 <      <arg value="-tag"/>
483 <      <arg value="implNote:a:Implementation Note:"/>
499 >      <arg value="--override-methods=summary"/>
500 >      <arg value="-tag"/> <arg value="${javadoc.jls.option}"/>
501 >      <arg value="-tag"/> <arg value="implSpec:a:Implementation Requirements:"/>
502 >      <arg value="-tag"/> <arg value="implNote:a:Implementation Note:"/>
503 >      <arg value="-tag"/> <arg value="apiNote:a:API Note:"/>
504   <!-- tags added in jdk9: currently unused -->
505 < <!--       <arg value="-tag"/> -->
506 < <!--       <arg value="revised:X"/> -->
487 < <!--       <arg value="-tag"/> -->
488 < <!--       <arg value="spec:X"/> -->
505 > <!--  <arg value="-tag"/> <arg value="revised:X"/> -->
506 > <!--  <arg value="-tag"/> <arg value="spec:X"/> -->
507      </javadoc>
508    </target>
509  
# Line 597 | Line 615
615  
616   <!--   </target> -->
617  
618 <  <target name="test910"
618 >  <target name="test9101112"
619            description="Runs tck and jtreg tests for src/main for multiple java versions">
620  
621      <antcall target="clean"/>
# Line 610 | Line 628
628        <param name="build.main.java.version" value="10"/>
629      </antcall>
630  
631 +    <antcall target="clean"/>
632 +    <antcall target="test">
633 +      <param name="build.main.java.version" value="11"/>
634 +    </antcall>
635 +
636 +    <antcall target="clean"/>
637 +    <antcall target="test">
638 +      <param name="build.main.java.version" value="12"/>
639 +    </antcall>
640 +
641      <!-- Clean up to avoid obscure wrong class file version bugs -->
642      <antcall target="clean"/>
643  
# Line 822 | Line 850
850        </fileset>
851        <arg line="-Xdocrootparent ${java8.docroot.url}"/>
852        <arg value="-XDignore.symbol.file=true"/>
853 <      <arg value="-tag"/>
854 <      <arg value="${javadoc.jls.option}"/>
855 < <!-- @apiNote currently unused -->
856 < <!--       <arg value="-tag"/> -->
857 < <!--       <arg value="apiNote:a:&lt;em&gt;API Note:&lt;/em&gt;"/> -->
830 <      <arg value="-tag"/>
831 <      <arg value="implSpec:a:&lt;em&gt;Implementation Requirements:&lt;/em&gt;"/>
832 <      <arg value="-tag"/>
833 <      <arg value="implNote:a:&lt;em&gt;Implementation Note:&lt;/em&gt;"/>
853 >      <arg value="-tag"/> <arg value="${javadoc.jls.option}"/>
854 >      <arg value="-tag"/> <arg value="implSpec:a:&lt;em&gt;Implementation Requirements:&lt;/em&gt;"/>
855 >      <arg value="-tag"/> <arg value="implNote:a:&lt;em&gt;Implementation Note:&lt;/em&gt;"/>
856 > <!-- @apiNote tag currently unused -->
857 > <!--  <arg value="-tag"/> <arg value="apiNote:a:&lt;em&gt;API Note:&lt;/em&gt;"/> -->
858      </javadoc>
859    </target>
860  
# Line 1360 | Line 1384
1384  
1385   <!-- Find buglets that can be detected by static build tools -->
1386  
1387 <  <target name="lint">
1388 <    <antcall target="dists">
1389 <      <param name="build.javadoc.access" value="public"/>
1390 <    </antcall>
1391 <  </target>
1387 > <!--   <target name="lint"> -->
1388 > <!--     <antcall target="dists"> -->
1389 > <!--       <param name="build.javadoc.access" value="protected"/> -->
1390 > <!--     </antcall> -->
1391 > <!--   </target> -->
1392  
1393   <!-- Generates all doclint warnings, even for private methods (rarely useful) -->
1394 <  <target name="lint-private">
1394 >  <target name="doclint-private">
1395      <antcall target="dist">
1396        <param name="build.javadoc.access" value="private"/>
1397      </antcall>
# Line 1377 | Line 1401
1401   <!-- ==============================================================
1402    Experimental errorprone support - http://errorprone.info
1403   =================================================================== -->
1404 +  <property name="errorprone.jar" location="${lib.dir}/error_prone_ant-2.3.1.jar"/>
1405 +  <property name="errorprone.jsr166.user.flags" value=""/>
1406 +  <property name="errorprone.jsr166.flags"
1407 +            value="-Xep:HashtableContains:OFF
1408 +                   -Xep:JdkObsolete:OFF
1409 +                   -Xep:MissingOverride:OFF
1410 +                   -Xep:MissingFail:OFF
1411 +                   -Xep:MixedArrayDimensions:ERROR
1412 +                   -Xep:RemoveUnusedImports:ERROR
1413 +                   -Xep:EmptyIf:ERROR
1414 +                   -Xep:MultipleTopLevelClasses:ERROR
1415 +                   -Xep:ClassName:ERROR
1416 +                   -Xep:LongLiteralLowerCaseSuffix:ERROR
1417 +                   -Xep:RedundantThrows:ERROR
1418 +                   -Xep:IdentityBinaryExpression:WARN
1419 +                   -Xep:MethodCanBeStatic:WARN
1420 +                   ${errorprone.jsr166.user.flags}"/>
1421 +  <!-- -Xep:WildcardImport:ERROR -->
1422 +  <property name="errorprone.jsr166.test.flags"
1423 +            value="-Xep:StringSplitter:OFF
1424 +                   -Xep:BoxedPrimitiveConstructor:OFF
1425 +                   -Xep:ModifyingCollectionWithItself:OFF"/>
1426 +  <!-- ant -emacs errorprone |& grep -EA1 '(warning|error):|warnings' -->
1427    <target name="errorprone"
1428            depends="clean, configure-compiler"
1429            description="Run errorprone over jsr166 source code (experimental)">
# Line 1398 | Line 1445
1445             fork="true">
1446  
1447        <include name="**/*.java"/>
1448 <      <compilerarg line="-processorpath ${lib.dir}/error_prone_ant-2.0.21.jar"/>
1448 >      <!-- Needed to silence -Xep:FutureReturnValueIgnored -->
1449 >      <compilerarg value="-J--illegal-access=permit"/>
1450 >      <compilerarg value="-XDcompilePolicy=simple"/>
1451 >      <compilerarg line="-processorpath ${errorprone.jar}"/>
1452        <compilerarg value="-Xplugin:ErrorProne
1453 <                          -Xep:IdentityBinaryExpression:WARN
1404 <                          -Xep:MissingOverride:OFF
1405 <                          -Xep:MixedArrayDimensions:WARN
1406 <                          -Xep:RemoveUnusedImports:ERROR
1407 <                          -Xep:ClassName:ERROR
1408 <                          -Xep:MultipleTopLevelClasses:ERROR
1409 <                          -Xep:EmptyIf:ERROR
1410 <                          -Xep:LongLiteralLowerCaseSuffix:ERROR
1411 <                          -Xep:RedundantThrows:ERROR
1412 <                          -Xep:MethodCanBeStatic:WARN"/>
1453 >                          ${errorprone.jsr166.flags}"/>
1454        <compilerarg value="--patch-module=java.base=${src.dir}"/>
1455        <compilerarg value="-Xprefer:source"/>
1456        <compilerarg value="-XDignore.symbol.file=true"/>
# Line 1428 | Line 1469
1469        workdir="${build.dir}"
1470        classes="${product.jar}">
1471        <javac-elements>
1472 <        <compilerarg line="-processorpath ${lib.dir}/error_prone_ant-2.0.21.jar"/>
1472 >        <!-- Needed to silence -Xep:FutureReturnValueIgnored -->
1473 >        <compilerarg value="-J--illegal-access=permit"/>
1474 >        <compilerarg value="-XDcompilePolicy=simple"/>
1475 >        <compilerarg line="-processorpath ${errorprone.jar}"/>
1476          <compilerarg value="-Xplugin:ErrorProne
1477 <                            -Xep:IdentityBinaryExpression:WARN
1478 <                            -Xep:BoxedPrimitiveConstructor:OFF
1435 <                            -Xep:HashtableContains:OFF
1436 <                            -Xep:ModifyingCollectionWithItself:OFF
1437 <                            -Xep:MissingOverride:OFF
1438 <                            -Xep:MixedArrayDimensions:WARN
1439 <                            -Xep:RemoveUnusedImports:ERROR
1440 <                            -Xep:ClassName:ERROR
1441 <                            -Xep:MultipleTopLevelClasses:ERROR
1442 <                            -Xep:EmptyIf:ERROR
1443 <                            -Xep:LongLiteralLowerCaseSuffix:ERROR
1444 <                            -Xep:RedundantThrows:ERROR
1445 <                            -Xep:MethodCanBeStatic:WARN"/>
1477 >                            ${errorprone.jsr166.flags}
1478 >                            ${errorprone.jsr166.test.flags}"/>
1479          <compilerarg line="-Xmaxerrs 3000 -Xmaxwarns 3000"/>
1480        </javac-elements>
1481      </run-tck-tests>
1482    </target>
1483  
1484 +  <!-- ant -emacs errorprone-jtreg |& grep -EA1 '(warning|error):' -->
1485 +  <!-- -XDcompilePolicy=simple or byfile avoids confusing UnusedImports -->
1486 +  <target name="errorprone-jtreg"
1487 +          depends="jar"
1488 +          description="Run errorprone over jtreg tests (experimental)">
1489 +
1490 +    <run-jtreg-tests
1491 +       target="${build.main.java.version}"
1492 +       workdir="${build.dir}"
1493 +       classes="${product.jar}"
1494 +       verbose="all">
1495 +      <jtreg-elements>
1496 +        <arg value="-javacoption:-XDcompilePolicy=simple"/>
1497 +        <arg value="-javacoption:-processorpath"/>
1498 +        <arg value="-javacoption:${errorprone.jar}"/>
1499 +        <arg value="-javacoption:-Xplugin:ErrorProne
1500 +                            ${errorprone.jsr166.flags}
1501 +                            ${errorprone.jsr166.test.flags}
1502 +                            -Xep:MultipleTopLevelClasses:WARN
1503 +                            -Xep:NonAtomicVolatileUpdate:OFF"/>
1504 +      </jtreg-elements>
1505 +    </run-jtreg-tests>
1506 +  </target>
1507 +
1508  
1509   <!-- ==============================================================
1510    Running guava tests against jsr166 code

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines