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

View file

@ -234,7 +234,38 @@ dependencyAnalysis {
} }
issues { issues {
all { 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
}
} }
} }
} }