Upgrade error-prone's EqualsHashCode and EqualsIncompatibleType from Warn -> Error
Fixes
Enables [`EqualsHashCode`](http://errorprone.info/bugpattern/EqualsHashCode) and [`EqualsIncompatibleType`](http://errorprone.info/bugpattern/EqualsIncompatibleType) as `ERROR` for Errorprone.
@@ -19,6 +19,7 @@ package com.palantir.baseline.plugins
import net.ltgt.gradle.errorprone.ErrorPronePlugin
import org.gradle.api.GradleException
import org.gradle.api.Project
+import org.gradle.api.tasks.compile.JavaCompile
class BaselineErrorProne extends AbstractBaselinePlugin {
@@ -30,6 +31,14 @@ class BaselineErrorProne extends AbstractBaselinePlugin {
// TODO(rfink): This is somewhat ugly. Is there a better to add the processor dependency on the library?
errorprone "com.palantir.baseline:baseline-error-prone:${extractVersionString()}"
}
+
+ project.tasks.withType(JavaCompile) {
+ options.compilerArgs += [
+ "-XepDisableWarningsInGeneratedCode",
+ "-Xep:EqualsHashCode:ERROR",
+ "-Xep:EqualsIncompatibleType:ERROR",
+ ]
+ }
}
private String extractVersionString() {
