Skip to content

Commit

Permalink
Re-enables errorprone on JDK 10+
Browse files Browse the repository at this point in the history
This uses the commandline instructions here:
  http://errorprone.info/docs/installation

However, there's a glitch as I'm not sure why
`-XepDisableWarningsInGeneratedCode` doesn't work.

See google/error-prone#860
  • Loading branch information
Adrian Cole committed Aug 20, 2018
1 parent bb3be5c commit 805726b
Showing 1 changed file with 43 additions and 4 deletions.
47 changes: 43 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,9 @@

<profiles>
<profile>
<id>error-prone</id>
<id>error-prone-1.8</id>
<activation>
<!-- error-prone isn't happy in jdk 10 yet https://github.com/google/error-prone/issues/860#issuecomment-396154710 -->
<jdk>[1.8,10)</jdk>
<jdk>1.8</jdk>
<activeByDefault>false</activeByDefault>
</activation>
<build>
Expand All @@ -617,8 +616,8 @@
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<!-- error-prone doesn't like generated code -->
<compilerArgs>
<!-- error-prone doesn't like generated code -->
<arg>-XepDisableWarningsInGeneratedCode</arg>
</compilerArgs>
</configuration>
Expand All @@ -640,6 +639,46 @@
</plugins>
</build>
</profile>
<profile>
<id>error-prone-9+</id>
<activation>
<jdk>[9,)</jdk>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<!-- only use errorprone on main source tree -->
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
<!-- TODO: why does this not work? -->
<!--<arg>-XepDisableWarningsInGeneratedCode</arg>-->
</compilerArgs>
<annotationProcessorPaths>
<processorPath>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_ant</artifactId>
<version>2.3.1</version>
</processorPath>
</annotationProcessorPaths>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
Expand Down

0 comments on commit 805726b

Please sign in to comment.