Skip to content

Commit

Permalink
Re-enables errorprone on JDK 10+ (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancole authored Aug 20, 2018
1 parent bb3be5c commit f7974f4
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 71 deletions.
51 changes: 18 additions & 33 deletions instrumentation/benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,39 +218,24 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration combine.self="override">
<!-- instead of javac-with-errorprone -->
<compilerId>javac</compilerId>
<!-- scrub errorprone compiler args -->
<compilerArgs/>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- disable errorprone on JMH source tree -->
<id>error-prone-off</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>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<compilerArgs>
<arg>-XepDisableAllChecks</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
36 changes: 3 additions & 33 deletions instrumentation/kafka-clients/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<main.java.version>1.8</main.java.version>
<main.signature.artifact>java18</main.signature.artifact>

<!-- disable errorprone override warning as we do this intentionally to allow old clients -->
<errorprone.args>-Xep:MissingOverride:OFF</errorprone.args>

<kafka.version>2.0.0</kafka.version>
<!-- must align with kafka version https://github.com/charithe/kafka-junit -->
<kafka-junit.version>4.1.2</kafka-junit.version>
Expand Down Expand Up @@ -84,37 +87,4 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- disable errorprone override warning as we do this intentionally to allow old clients -->
<id>error-prone-off</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>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<compilerArgs>
<arg>-Xep:MissingOverride:OFF</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
50 changes: 45 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

<!-- override to set exclusions per-project -->
<!-- error-prone doesn't like generated code -->
<errorprone.args>-XepDisableWarningsInGeneratedCode</errorprone.args>

<!-- use the same values in bom/pom.xml -->
<zipkin.version>2.10.4</zipkin.version>
<zipkin-reporter.version>2.7.7</zipkin-reporter.version>
Expand Down Expand Up @@ -596,10 +600,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,9 +620,8 @@
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<!-- error-prone doesn't like generated code -->
<compilerArgs>
<arg>-XepDisableWarningsInGeneratedCode</arg>
<arg>${errorprone.args}</arg>
</compilerArgs>
</configuration>
</execution>
Expand All @@ -640,6 +642,44 @@
</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 ${errorprone.args}</arg>
</compilerArgs>
<annotationProcessorPaths>
<processorPath>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</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 f7974f4

Please sign in to comment.