Skip to content

Commit 2b097a1

Browse files
committed
build: resolve lint warnings and enforce warnings-as-errors
Disable GradleDependency nag; enable lint and Kotlin warnings-as-errors.
1 parent 8a65a97 commit 2b097a1

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ jobs:
2626
- uses: android-actions/setup-android@v4
2727
- name: Install SDK packages
2828
run: sdkmanager "platforms;android-35" "build-tools;36.0.0"
29-
- name: Test and assemble
30-
run: ./gradlew :cobs:testDebugUnitTest :cobs:assembleRelease --console=plain
29+
- name: Test, lint, and assemble
30+
run: >-
31+
./gradlew :cobs:testDebugUnitTest :cobs:lint :cobs:assembleRelease
32+
--console=plain
3133
- name: Upload AAR artifact
3234
uses: actions/upload-artifact@v7
3335
with:

cobs/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ android {
3333
}
3434
}
3535

36+
lint {
37+
// Fail the build on any real lint issue.
38+
abortOnError = true
39+
warningsAsErrors = true
40+
// GradleDependency only nags that a newer compileSdk/dependency exists;
41+
// this pure-Kotlin library uses no Android APIs, so the compileSdk level
42+
// is immaterial and version bumps are made deliberately.
43+
disable += "GradleDependency"
44+
}
45+
3646
publishing {
3747
singleVariant("release") {
3848
withSourcesJar()
@@ -43,6 +53,7 @@ android {
4353
kotlin {
4454
compilerOptions {
4555
jvmTarget = JvmTarget.JVM_17
56+
allWarningsAsErrors = true
4657
}
4758
}
4859

0 commit comments

Comments
 (0)