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.265 by jsr166, Sun Feb 4 20:00:47 2018 UTC vs.
Revision 1.283 by jsr166, Wed Oct 24 22:31:14 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 22 | Line 23
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 103 | 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 135 | Line 138
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 146 | Line 150
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 191 | Line 196
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 <  <!-- The location of jdk9 early access docs (RIP) -->
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="java10.docroot.url" value="http://download.java.net/java/jdk10/docs"/>
208 <  <property name="java11.docroot.url" value="http://download.java.net/java/jdk11/docs"/>
209 <  <property name="java.docroot.url"   value="${java9.docroot.url}"/>
207 >  <!-- But pin to jdk 10 until fix for -->
208 >  <!-- 8211194: javadoc -link doesn't take module path into consideration -->
209 >  <property name="java.docroot.url"   value="${java10.docroot.url}"/>
210  
211    <!-- Canonical location of jdk API docs, to use with javadoc link attribute -->
212    <property name="java5.api.url"      value="${java5.docroot.url}/api/"/>
# Line 206 | Line 216
216    <property name="java9.api.url"      value="${java9.docroot.url}/api/"/>
217    <property name="java10.api.url"     value="${java10.docroot.url}/api/"/>
218    <property name="java11.api.url"     value="${java11.docroot.url}/api/"/>
219 +  <property name="java12.api.url"     value="${java12.docroot.url}/api/"/>
220    <property name="java.api.url"       value="${java.docroot.url}/api/"/>
221  
222    <!-- Define the "jtreg" task -->
# Line 238 | Line 249
249  
250      <local name="modules"/>
251      <condition property="modules">
252 <      <available file="${jdk@{compile-target}.home}/jmods" type="dir"/>
252 >      <available file="${jdk@{compile-target}.home}/lib/modules" type="file"/>
253      </condition>
254  
255      <local name="use-doclint"/>
# Line 305 | Line 316
316    </macrodef>
317  
318    <!-- Define jtreg test sets for different jdk versions -->
319 <  <fileset dir="${jtreg11.src.dir}">
320 <    <patternset id="jdk11.jtreg.tests">
321 <      <include name="**/*.java"/>
322 <    </patternset>
323 <  </fileset>
324 <
325 <  <fileset dir="${jtreg10.src.dir}">
326 <    <patternset id="jdk10.jtreg.tests">
327 <      <include name="**/*.java"/>
328 <    </patternset>
329 <  </fileset>
330 <
331 <  <fileset dir="${jtreg9.src.dir}">
321 <    <patternset id="jdk9.jtreg.tests">
322 <      <include name="**/*.java"/>
323 <    </patternset>
324 <  </fileset>
325 <
326 <  <fileset dir="${jtreg8.src.dir}">
327 <    <patternset id="jdk8.jtreg.tests">
328 <      <include name="**/*.java"/>
329 <    </patternset>
330 <  </fileset>
319 >  <!-- ant -Djtreg.test.pattern="**/ConcurrentHashMap/" -->
320 >  <!-- ant -Djtreg.test.pattern="**/ToArray.java" -->
321 >  <property name="jtreg.test.pattern" value="**/*.java"/>
322 >  <macrodef name="defjtregtests">
323 >    <attribute name="v"/>
324 >    <sequential>
325 >      <fileset dir="${jtreg@{v}.src.dir}">
326 >        <patternset id="jdk@{v}.jtreg.tests">
327 >          <include name="${jtreg.test.pattern}"/>
328 >        </patternset>
329 >      </fileset>
330 >    </sequential>
331 >  </macrodef>
332  
333 <  <fileset dir="${jtreg7.src.dir}">
334 <    <patternset id="jdk7.jtreg.tests">
335 <      <include name="**/*.java"/>
336 <    </patternset>
337 <  </fileset>
333 >  <defjtregtests v="12"/>
334 >  <defjtregtests v="11"/>
335 >  <defjtregtests v="10"/>
336 >  <defjtregtests v="9"/>
337 >  <defjtregtests v="8"/>
338 >  <defjtregtests v="7"/>
339  
340    <!-- ant -Djtreg.flags=-timeoutFactor:4 -->
341    <property name="jtreg.flags" value=""/>
# Line 354 | Line 356
356  
357      <local name="modules"/>
358      <condition property="modules">
359 <      <available file="${jdk@{target}.home}/jmods" type="dir"/>
359 >      <available file="${jdk@{target}.home}/lib/modules" type="file"/>
360      </condition>
361  
362      <delete dir="@{workdir}/JTwork"   quiet="true"/>
# Line 389 | Line 391
391  
392    <!-- Main targets -->
393  
394 <  <property name="build.main.java.version" value="9"/>
394 >  <property name="build.main.java.version" value="11"/>
395    <!-- Workaround "no nested properties in ant" -->
396    <macrodef name="define-build-main-properties">
397      <attribute name="v"/>
398      <sequential>
399        <property name="build.main.java"    value="${java@{v}}"/>
400        <property name="build.main.javac"   value="${javac@{v}}"/>
401 <      <!-- Force javadoc version to be at least 10,
402 <           so we can use override-methods=summary -->
401 >      <!-- Force javadoc version to be at least 10, so we can use override-methods=summary -->
402 >      <!-- Force javadoc version to be at least 12, due to JDK-8202628 -->
403        <condition property="build.main.javadoc"
404 <                 value="${javadoc10}"
404 >                 value="${javadoc12}"
405                   else="${javadoc@{v}}">
406 <        <equals arg1="@{v}" arg2="9"/>
406 >        <matches pattern="^(9|10|11)$" string="@{v}"/>
407        </condition>
408      </sequential>
409    </macrodef>
# Line 410 | Line 412
412    <target name="dists"
413            depends="dist, 4jdk8dist"
414            description="Builds all public jars and docs"/>
415 <          <!--
414 <              depends="dist, 4jdk8dist, 4jdk7dist, jsr166edist, jsr166ydist, extra166ydist, jsr166xdist"
415 <          -->
415 >          <!-- no longer supported: 4jdk7dist, jsr166edist, jsr166ydist, extra166ydist, jsr166xdist -->
416  
417    <target name="compile"
418            depends="configure-compiler"
# Line 481 | Line 481
481   <!-- TODO: <arg line="- -module-source-path ${jdk9.home}/src.zip"/> -->
482      <javadoc destdir="${docs.dir}"
483               packagenames="none"
484 <             link="${java9.api.url}"
484 >             link="${java11.api.url}"
485               overview="${src.dir}/intro.html"
486               access="${build.javadoc.access}"
487               sourcepath="${src.dir}"
488               classpath=""
489 <             source="9"
489 >             source="11"
490               executable="${build.main.javadoc}">
491        <fileset dir="${src.dir}" defaultexcludes="yes">
492          <include name="**/*.java"/>
493        </fileset>
494 <      <arg line="-Xdocrootparent ${java9.docroot.url}"/>
494 >      <arg line="-Xdocrootparent ${java10.docroot.url}"/>
495        <arg line="-Xmaxerrs 1000 -Xmaxwarns 1000"/>
496        <arg value="-XDignore.symbol.file=true"/>
497        <arg value="-html5"/>
498        <arg value="--patch-module=java.base=${src.dir}"/>
499 +      <arg value="--frames"/>
500        <arg value="--override-methods=summary"/>
501        <arg value="-tag"/> <arg value="${javadoc.jls.option}"/>
502        <arg value="-tag"/> <arg value="implSpec:a:Implementation Requirements:"/>
503        <arg value="-tag"/> <arg value="implNote:a:Implementation Note:"/>
504 < <!-- @apiNote tag currently unused -->
504 < <!--  <arg value="-tag"/> <arg value="apiNote:a:API Note:"/> -->
504 >      <arg value="-tag"/> <arg value="apiNote:a:API Note:"/>
505   <!-- tags added in jdk9: currently unused -->
506   <!--  <arg value="-tag"/> <arg value="revised:X"/> -->
507   <!--  <arg value="-tag"/> <arg value="spec:X"/> -->
# Line 514 | Line 514
514            description="Puts all distributable products in single hierarchy"/>
515  
516  
517  <target name="release"
518          depends="dist"
519          description="Puts entire CVS tree, plus distribution productions, in a jar">
520
521    <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
522
523    <jar basedir="${basedir}" destfile="${release.jar}">
524      <!-- <exclude name="build/**"/> -->
525      <exclude name="${release.jar}"/>
526      <exclude name="user.properties"/>
527      <exclude name="etc/notes/**"/>
528      <exclude name="src/emulation/**"/>
529      <exclude name="**/SyntaxTest.java"/>
530      <exclude name="**/SuperfluousAbstract.java"/>
531      <manifest>
532        <attribute name="Built-By" value="${user.name}"/>
533        <attribute name="Implementation-Vendor" value="JCP JSR-166 Expert Group."/>
534      </manifest>
535    </jar>
536  </target>
537
538
517    <target name="clean"
518            description="Removes all build products">
519      <delete dir="${build.dir}"/>
# Line 616 | Line 594
594  
595   <!--   </target> -->
596  
597 <  <target name="test91011"
597 >  <target name="test9101112"
598            description="Runs tck and jtreg tests for src/main for multiple java versions">
599  
600      <antcall target="clean"/>
601      <antcall target="test">
602        <param name="build.main.java.version" value="9"/>
603 +      <param name="build.main.java" value="${java9}"/>
604 +      <param name="build.main.javac" value="${javac9}"/>
605      </antcall>
606  
607      <antcall target="clean"/>
608      <antcall target="test">
609        <param name="build.main.java.version" value="10"/>
610 +      <param name="build.main.java" value="${java10}"/>
611 +      <param name="build.main.javac" value="${javac10}"/>
612      </antcall>
613  
614      <antcall target="clean"/>
615      <antcall target="test">
616        <param name="build.main.java.version" value="11"/>
617 +      <param name="build.main.java" value="${java11}"/>
618 +      <param name="build.main.javac" value="${javac11}"/>
619 +    </antcall>
620 +
621 +    <antcall target="clean"/>
622 +    <antcall target="test">
623 +      <param name="build.main.java.version" value="12"/>
624 +      <param name="build.main.java" value="${java12}"/>
625 +      <param name="build.main.javac" value="${javac12}"/>
626 +    </antcall>
627 +    <antcall target="docs">
628 +      <param name="build.main.java.version" value="12"/>
629 +      <param name="build.main.java" value="${java12}"/>
630 +      <param name="build.main.javac" value="${javac12}"/>
631 +      <param name="build.main.javadoc" value="${javadoc12}"/>
632      </antcall>
633  
634      <!-- Clean up to avoid obscure wrong class file version bugs -->
# Line 1380 | Line 1377
1377  
1378   <!-- Find buglets that can be detected by static build tools -->
1379  
1380 <  <target name="lint">
1381 <    <antcall target="dists">
1382 <      <param name="build.javadoc.access" value="public"/>
1383 <    </antcall>
1384 <  </target>
1380 > <!--   <target name="lint"> -->
1381 > <!--     <antcall target="dists"> -->
1382 > <!--       <param name="build.javadoc.access" value="protected"/> -->
1383 > <!--     </antcall> -->
1384 > <!--   </target> -->
1385  
1386   <!-- Generates all doclint warnings, even for private methods (rarely useful) -->
1387 <  <target name="lint-private">
1387 >  <target name="doclint-private">
1388      <antcall target="dist">
1389        <param name="build.javadoc.access" value="private"/>
1390      </antcall>
# Line 1395 | Line 1392
1392  
1393  
1394   <!-- ==============================================================
1395 <  Experimental errorprone support - http://errorprone.info
1395 >  Experimental errorprone support - https://errorprone.info
1396   =================================================================== -->
1397 <  <property name="errorprone.jar" location="${lib.dir}/error_prone_ant-2.2.0.jar"/>
1397 >  <property name="errorprone.jar" location="${lib.dir}/error_prone_ant-2.3.1.jar"/>
1398 >  <property name="errorprone.jsr166.user.flags" value=""/>
1399    <property name="errorprone.jsr166.flags"
1400              value="-Xep:HashtableContains:OFF
1401                     -Xep:JdkObsolete:OFF
# Line 1411 | Line 1409
1409                     -Xep:LongLiteralLowerCaseSuffix:ERROR
1410                     -Xep:RedundantThrows:ERROR
1411                     -Xep:IdentityBinaryExpression:WARN
1412 <                   -Xep:MethodCanBeStatic:WARN"/>
1412 >                   -Xep:MethodCanBeStatic:WARN
1413 >                   ${errorprone.jsr166.user.flags}"/>
1414    <!-- -Xep:WildcardImport:ERROR -->
1415    <property name="errorprone.jsr166.test.flags"
1416              value="-Xep:StringSplitter:OFF
# Line 1439 | Line 1438
1438             fork="true">
1439  
1440        <include name="**/*.java"/>
1441 +      <!-- Needed to silence -Xep:FutureReturnValueIgnored -->
1442 +      <compilerarg value="-J--illegal-access=permit"/>
1443        <compilerarg value="-XDcompilePolicy=simple"/>
1444        <compilerarg line="-processorpath ${errorprone.jar}"/>
1445        <compilerarg value="-Xplugin:ErrorProne
# Line 1461 | Line 1462
1462        workdir="${build.dir}"
1463        classes="${product.jar}">
1464        <javac-elements>
1465 +        <!-- Needed to silence -Xep:FutureReturnValueIgnored -->
1466 +        <compilerarg value="-J--illegal-access=permit"/>
1467          <compilerarg value="-XDcompilePolicy=simple"/>
1468          <compilerarg line="-processorpath ${errorprone.jar}"/>
1469          <compilerarg value="-Xplugin:ErrorProne
# Line 1489 | Line 1492
1492          <arg value="-javacoption:-Xplugin:ErrorProne
1493                              ${errorprone.jsr166.flags}
1494                              ${errorprone.jsr166.test.flags}
1495 +                            -Xep:MultipleTopLevelClasses:WARN
1496                              -Xep:NonAtomicVolatileUpdate:OFF"/>
1497        </jtreg-elements>
1498      </run-jtreg-tests>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines