Partial sync of gradle conventions with sdk repo (#4836)

* Sync gradle conventions

* oops
This commit is contained in:
Trask Stalnaker 2021-12-08 03:50:32 -08:00 committed by GitHub
parent f5016109f2
commit d52f62522d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 52 deletions

View File

@ -8,13 +8,16 @@ dependencies {
errorprone("com.google.errorprone:error_prone_core")
}
val disableErrorProne = gradle.startParameter.projectProperties.get("disableErrorProne")?.toBoolean()
?: false
val disableErrorProne = properties["disableErrorProne"]?.toString()?.toBoolean() ?: false
tasks {
withType<JavaCompile>().configureEach {
options.errorprone {
isEnabled.set(!disableErrorProne)
with(options) {
errorprone {
if (disableErrorProne) {
logger.warn("Errorprone has been disabled. Build may not result in a valid PR build.")
isEnabled.set(false)
}
disableWarningsInGeneratedCode.set(true)
allDisabledChecksAsWarnings.set(true)
@ -83,4 +86,5 @@ tasks {
}
}
}
}
}

View File

@ -32,5 +32,7 @@ jmhReport {
tasks {
named("jmh") {
finalizedBy(named("jmhReport"))
outputs.cacheIf { false }
}
}