diff options
-rw-r--r-- | build.gradle | 6 | ||||
-rw-r--r-- | compiler/build.gradle | 11 | ||||
-rw-r--r-- | protobuf-lite/build.gradle | 3 |
3 files changed, 11 insertions, 9 deletions
diff --git a/build.gradle b/build.gradle index 7e5d0096f..9a60aba1a 100644 --- a/build.gradle +++ b/build.gradle @@ -175,8 +175,10 @@ subprojects { [compileJava, compileTestJava, compileJmhJava].each() { // Protobuf-generated code produces some warnings. // https://github.com/google/protobuf/issues/2718 - it.options.compilerArgs += ["-Xlint:-cast", "-Xep:MissingOverride:OFF", - "-Xep:ReferenceEquality:OFF", "-Xep:FunctionalInterfaceClash:OFF"] + it.options.compilerArgs += [ + "-Xlint:-cast", + "-XepExcludedPaths:.*/src/generated/[^/]+/java/.*", + ] } } diff --git a/compiler/build.gradle b/compiler/build.gradle index 1fef805fa..53a735278 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -151,15 +151,16 @@ sourceSets { } compileTestJava { - options.compilerArgs += ["-Xlint:-cast", "-Xep:MissingOverride:OFF", - "-Xep:ReferenceEquality:OFF", "-Xep:FunctionalInterfaceClash:OFF"] + options.compilerArgs += [ + "-Xlint:-cast", + "-XepExcludedPaths:.*/build/generated/source/proto/.*", + ] } compileTestLiteJava { + options.compilerArgs = compileTestJava.options.compilerArgs // Protobuf-generated Lite produces quite a few warnings. - options.compilerArgs += ["-Xlint:-rawtypes", "-Xlint:-unchecked", - "-Xep:MissingOverride:OFF", "-Xep:ReferenceEquality:OFF", - "-Xep:FallThrough:OFF"] + options.compilerArgs += ["-Xlint:-rawtypes", "-Xlint:-unchecked", "-Xlint:-fallthrough"] } compileTestNanoJava { diff --git a/protobuf-lite/build.gradle b/protobuf-lite/build.gradle index e7342be75..719910fa1 100644 --- a/protobuf-lite/build.gradle +++ b/protobuf-lite/build.gradle @@ -28,8 +28,7 @@ dependencies { compileTestJava { // Protobuf-generated Lite produces quite a few warnings. options.compilerArgs += ["-Xlint:-rawtypes", "-Xlint:-unchecked", "-Xlint:-fallthrough", - "-Xep:MissingOverride:OFF", "-Xep:ReferenceEquality:OFF", "-Xep:FallThrough:OFF", - "-Xep:JavaLangClash:OFF" /* The Enum protobuf clashes */] + "-XepExcludedPaths:.*/build/generated/source/proto/.*"] } protobuf { |