Skip to content

Commit 148c017

Browse files
committed
Android : added review comments point
1 parent dbfe6d4 commit 148c017

2 files changed

Lines changed: 12 additions & 17 deletions

File tree

android/build.gradle

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,7 @@ android {
2020
versionName "1.0"
2121
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2222
}
23-
24-
// fail on android lint warnings if failOnWarning is set true
25-
lintOptions {
26-
abortOnError true
27-
if (rootProject.hasProperty("failOnWarnings") && rootProject.failOnWarnings.toBoolean()) {
28-
warningsAsErrors true
29-
}
30-
}
31-
23+
lintOptions { abortOnError true }
3224
publishing {
3325
singleVariant('release') {
3426
withSourcesJar()
@@ -52,14 +44,6 @@ dependencies {
5244
testImplementation libraries.truth
5345
}
5446

55-
// Enforce -Werror on java compiler if failOnWarning is set
56-
tasks.withType(JavaCompile).configureEach {
57-
it.options.compilerArgs += ["-Xlint:all"]
58-
if (rootProject.hasProperty("failOnWarnings") && rootProject.failOnWarnings.toBoolean()) {
59-
it.options.compilerArgs += ["-Werror"]
60-
}
61-
}
62-
6347
tasks.register("javadocs", Javadoc) {
6448
source = android.sourceSets.main.java.srcDirs
6549
classpath += files(android.getBootClasspath())

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ subprojects {
2323
group = "io.grpc"
2424
version = "1.73.0-SNAPSHOT" // CURRENT_GRPC_VERSION
2525

26+
plugins.withId("com.android.base") {
27+
android {
28+
lint {
29+
abortOnError true
30+
if (rootProject.hasProperty('failOnWarnings') && rootProject.failOnWarnings.toBoolean()) {
31+
warningsAsErrors true
32+
}
33+
}
34+
}
35+
}
36+
2637
repositories {
2738
maven { // The google mirror is less flaky than mavenCentral()
2839
url "https://maven-central.storage-download.googleapis.com/maven2/"

0 commit comments

Comments
 (0)