diff --git a/build.gradle b/build.gradle index 0788895cdfa..ad02a7ec8dc 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,26 @@ subprojects { group = "io.grpc" version = "1.73.0-SNAPSHOT" // CURRENT_GRPC_VERSION + plugins.withId("com.android.base") { + android { + lint { + abortOnError true + if (rootProject.hasProperty('failOnWarnings') && rootProject.failOnWarnings.toBoolean()) { + warningsAsErrors true + } + } + } + } + + tasks.withType(JavaCompile).configureEach { + it.options.compilerArgs += [ + "-Xlint:all" + ] + if (rootProject.hasProperty('failOnWarnings') && rootProject.failOnWarnings.toBoolean()) { + it.options.compilerArgs += ["-Werror"] + } + } + repositories { maven { // The google mirror is less flaky than mavenCentral() url "https://maven-central.storage-download.googleapis.com/maven2/"