mirror of https://github.com/grpc/grpc-java.git
Ignore proto-generated code for ErrorProne
Previously if protobuf-generated code triggered ErrorProne we'd have to disable the failing check for all code in that task. With -XepExcludedPaths we can disable the ErrorProne-checking just for protobuf. Note that we continue using ErrorProne on our generated code. Also note this only applies to ErrorProne checks; JDK checks still require task-level disabling.
This commit is contained in:
parent
7fd22080e9
commit
1fb72ef6c1
|
|
@ -175,8 +175,10 @@ subprojects {
|
||||||
[compileJava, compileTestJava, compileJmhJava].each() {
|
[compileJava, compileTestJava, compileJmhJava].each() {
|
||||||
// Protobuf-generated code produces some warnings.
|
// Protobuf-generated code produces some warnings.
|
||||||
// https://github.com/google/protobuf/issues/2718
|
// https://github.com/google/protobuf/issues/2718
|
||||||
it.options.compilerArgs += ["-Xlint:-cast", "-Xep:MissingOverride:OFF",
|
it.options.compilerArgs += [
|
||||||
"-Xep:ReferenceEquality:OFF", "-Xep:FunctionalInterfaceClash:OFF"]
|
"-Xlint:-cast",
|
||||||
|
"-XepExcludedPaths:.*/src/generated/[^/]+/java/.*",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,15 +151,16 @@ sourceSets {
|
||||||
}
|
}
|
||||||
|
|
||||||
compileTestJava {
|
compileTestJava {
|
||||||
options.compilerArgs += ["-Xlint:-cast", "-Xep:MissingOverride:OFF",
|
options.compilerArgs += [
|
||||||
"-Xep:ReferenceEquality:OFF", "-Xep:FunctionalInterfaceClash:OFF"]
|
"-Xlint:-cast",
|
||||||
|
"-XepExcludedPaths:.*/build/generated/source/proto/.*",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
compileTestLiteJava {
|
compileTestLiteJava {
|
||||||
|
options.compilerArgs = compileTestJava.options.compilerArgs
|
||||||
// Protobuf-generated Lite produces quite a few warnings.
|
// Protobuf-generated Lite produces quite a few warnings.
|
||||||
options.compilerArgs += ["-Xlint:-rawtypes", "-Xlint:-unchecked",
|
options.compilerArgs += ["-Xlint:-rawtypes", "-Xlint:-unchecked", "-Xlint:-fallthrough"]
|
||||||
"-Xep:MissingOverride:OFF", "-Xep:ReferenceEquality:OFF",
|
|
||||||
"-Xep:FallThrough:OFF"]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
compileTestNanoJava {
|
compileTestNanoJava {
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,7 @@ dependencies {
|
||||||
compileTestJava {
|
compileTestJava {
|
||||||
// Protobuf-generated Lite produces quite a few warnings.
|
// Protobuf-generated Lite produces quite a few warnings.
|
||||||
options.compilerArgs += ["-Xlint:-rawtypes", "-Xlint:-unchecked", "-Xlint:-fallthrough",
|
options.compilerArgs += ["-Xlint:-rawtypes", "-Xlint:-unchecked", "-Xlint:-fallthrough",
|
||||||
"-Xep:MissingOverride:OFF", "-Xep:ReferenceEquality:OFF", "-Xep:FallThrough:OFF",
|
"-XepExcludedPaths:.*/build/generated/source/proto/.*"]
|
||||||
"-Xep:JavaLangClash:OFF" /* The Enum protobuf clashes */]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protobuf {
|
protobuf {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue