Skip to content

Commit

Permalink
Get tests running on latest JDK 16 EA
Browse files Browse the repository at this point in the history
* set necessary `--add-exports=` and `--add-opens=` flags to allow the
  Error Prone plugin to access internal javac APIs when running on
  JDK 16

* set `--illegal-access=permit` to allow access of internal javac APIs
  by tests

PiperOrigin-RevId: 353304282
  • Loading branch information
cushon authored and Javac Team committed Jan 22, 2021
1 parent ba757a3 commit 622b591
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,20 @@
<source>8</source>
<target>8</target>
<encoding>UTF-8</encoding>
<fork>true</fork>
<compilerArgs>
<arg>-parameters</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
Expand Down Expand Up @@ -199,7 +209,7 @@
<version>2.19.1</version>
<configuration>
<!-- set heap size to work around http://github.com/travis-ci/travis-ci/issues/3396 -->
<argLine>-Xmx2g</argLine>
<argLine>-Xmx2g --illegal-access=permit</argLine>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -256,7 +266,10 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
<compilerArgs combine.children="append">
<compilerArgs>
<arg>-parameters</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
<arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</arg>
</compilerArgs>
</configuration>
Expand Down

0 comments on commit 622b591

Please sign in to comment.