Fine tune dependency analysis, add CI workflow

This commit is contained in:
Olivér Falvai 2022-05-18 18:47:52 +02:00
parent 6c569e6f9d
commit 86663ec073
2 changed files with 40 additions and 1 deletions

View File

@ -117,6 +117,8 @@ jobs:
${{ runner.os }}-gradle-
- name: Lint analysis
run: ./gradlew clean :vector:lint --stacktrace
- name: Dependency analysis
run: ./gradlew buildHealth
- name: Upload reports
if: always()
uses: actions/upload-artifact@v3
@ -124,6 +126,12 @@ jobs:
name: lint-report
path: |
vector/build/reports/*.*
- name: Upload dependency analysis
if: always()
uses: actions/upload-artifact@v3
with:
name: dependency-analysis
path: build/reports/dependency-analysis/build-health-report.txt
# Lint for Gplay and Fdroid release APK
apk-lint:

View File

@ -234,7 +234,38 @@ dependencyAnalysis {
}
issues {
all {
ignoreKtx(true) // default is false
ignoreKtx(true)
onUsedTransitiveDependencies {
// Transitively used dependencies that should be declared directly
severity("ignore")
}
onUnusedDependencies {
severity("fail")
}
onUnusedAnnotationProcessors {
severity("fail")
exclude("com.airbnb.android:epoxy-processor", "com.google.dagger:hilt-compiler") // False positives
}
}
project(":library:jsonviewer") {
onUnusedDependencies {
exclude("org.json:json") // Used in unit tests, overwrites the one bundled into Android
}
}
project(":library:ui-styles") {
onUnusedDependencies {
exclude("com.github.vector-im:PFLockScreen-Android") // False positive
}
}
project(":matrix-sdk-android") {
onUnusedDependencies {
exclude("io.reactivex.rxjava2:rxkotlin") // Transitively required for mocking realm as monarchy doesn't expose Rx
}
}
project(":matrix-sdk-android-flow") {
onUnusedDependencies {
exclude("androidx.paging:paging-runtime-ktx") // False positive
}
}
}
}