aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle
diff options
context:
space:
mode:
authorKristen Kozak <sebright@google.com>2018-06-13 16:28:51 -0700
committerKristen Kozak <sebright@google.com>2018-06-13 16:28:51 -0700
commit372aa6d83035fb6d0bda2a2a8acaf0ce1825d4ba (patch)
treeb7b4cc7b462790b1693118d5152b1d29ba22eed4 /build.gradle
parent529688f2b63ec98e4e78bf071f8d1b4fbde96eb5 (diff)
downloadplatform_external_opencensus-java-372aa6d83035fb6d0bda2a2a8acaf0ce1825d4ba.tar.gz
platform_external_opencensus-java-372aa6d83035fb6d0bda2a2a8acaf0ce1825d4ba.tar.bz2
platform_external_opencensus-java-372aa6d83035fb6d0bda2a2a8acaf0ce1825d4ba.zip
Error Prone: 2.2.0 -> 2.3.1
This commit contains several other changes as part of the upgrade: - Use -XepAllDisabledChecksAsWarnings to enable all available warnings so that we don't need to enable each warning explicitly. - Remove explicit suppression of warnings in generated code, since -XepDisableWarningsInGeneratedCode is now sufficient to suppress all warnings in AutoValue and Protocol Buffer generated classes. - Remove a suppression of "ConstructorLeaksThis", since https://github.com/google/error-prone/pull/789 was fixed. - Fix a few occurrences of "FieldCanBeFinal".
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle37
1 files changed, 12 insertions, 25 deletions
diff --git a/build.gradle b/build.gradle
index e5bd13d4..b466c3f8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -73,30 +73,17 @@ subprojects {
it.options.compilerArgs += ["-Xlint:all", "-Xlint:-try", "-Xlint:-processing"]
if (useErrorProne) {
if (JavaVersion.current().isJava8Compatible()) {
- it.options.compilerArgs += ["-XepDisableWarningsInGeneratedCode"]
- // Exclude generated protobuf from error-prone checks.
- it.options.compilerArgs += ["-XepExcludedPaths:.*/gen_gradle/.*"]
- // TODO(bdrutu): Read files directly instead of reading from properties.
- if (rootProject.hasProperty("errorProneWarnings")) {
- it.options.compilerArgs += rootProject.properties["errorProneWarnings"].split(',').collect {
- it as String
- }
- }
- if (rootProject.hasProperty("errorProneExperimentalErrors")) {
- it.options.compilerArgs += rootProject.properties["errorProneExperimentalErrors"].split(',').collect {
- it as String
- }
- }
- if (rootProject.hasProperty("errorProneExperimentalWarnings")) {
- it.options.compilerArgs += rootProject.properties["errorProneExperimentalWarnings"].split(',').collect {
- it as String
- }
- }
- if (rootProject.hasProperty("errorProneExperimentalSuggestions")) {
- it.options.compilerArgs += rootProject.properties["errorProneExperimentalSuggestions"].split(',').collect {
- it as String
- }
- }
+ it.options.compilerArgs += ["-XepAllDisabledChecksAsWarnings", "-XepDisableWarningsInGeneratedCode"]
+
+ // MutableMethodReturnType can suggest returning Guava types from
+ // API methods (https://github.com/google/error-prone/issues/982).
+ it.options.compilerArgs += ["-Xep:MutableMethodReturnType:OFF"]
+
+ // ReturnMissingNullable conflicts with Checker Framework null analysis.
+ it.options.compilerArgs += ["-Xep:ReturnMissingNullable:OFF"]
+
+ // OpenCensus doesn't currently use Var annotations.
+ it.options.compilerArgs += ["-Xep:Var:OFF"]
}
}
if (useCheckerFramework) {
@@ -159,7 +146,7 @@ subprojects {
appengineVersion = '1.9.63'
autoValueVersion = '1.4'
findBugsVersion = '3.0.1'
- errorProneVersion = '2.2.0'
+ errorProneVersion = '2.3.1'
grpcVersion = '1.12.0'
guavaVersion = '20.0'
googleAuthVersion = '0.9.1'