Reputation: 431
Does anyone know if it's possible to have single Gradle task for Lint check in the multi-modular Android project? The aim is to have the only one HTML/XML report for all modules (app + a few Android libraries).
Upvotes: 14
Views: 4114
Reputation: 13617
In order to do that configure android lint only in the module where other modules are used as dependencies and enable checkDependencies
in lintOptions
.
ex:
There is an application module called app
which uses feature_1
, feature_2
, feature_3
library modules as dependencies, so set checkDependencies
to true
in lintOptions
of app
module build.gradle
file.
android{
lintOptions{
checkDependencies true // <---
xmlReport false
htmlReport true
htmlOutput file("${project.rootDir}/build/reports/android-lint.html")
}
}
Note:
when you run ./gradlew lint
this will generate reports for every dependency module at each modules build/reports
directory, BUT a report with all lint issues related to the project will be generated at the specified location.
Reference: https://groups.google.com/d/msg/lint-dev/TpTMBMlwPPs/WZHCu59TAwAJ
Upvotes: 20