From f83b780c41f3757dd565e9d3892000634d795b0c Mon Sep 17 00:00:00 2001 From: John Watson Date: Fri, 9 Jul 2021 08:57:56 -0700 Subject: [PATCH] Provide an option for disabling errorprone for a smoother dev experience (#3380) * Provide an option for disabling errorprone for a smoother dev experience * add a warning if you have turned off errorprone --- .../src/main/kotlin/otel.errorprone-conventions.gradle.kts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/buildSrc/src/main/kotlin/otel.errorprone-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.errorprone-conventions.gradle.kts index fc541a9d6a5..e04b56104fb 100644 --- a/buildSrc/src/main/kotlin/otel.errorprone-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.errorprone-conventions.gradle.kts @@ -9,10 +9,17 @@ plugins { val enableNullaway: String? by project +val disableErrorProne = properties["disableErrorProne"]?.toString()?.toBoolean() ?: false + tasks { withType().configureEach { with(options) { errorprone { + if (disableErrorProne) { + logger.warn("Errorprone has been disabled. Build may not result in a valid PR build.") + enabled = false + } + disableWarningsInGeneratedCode.set(true) allDisabledChecksAsWarnings.set(true)