Add static code analyzers to an Android project.
In order to properly work, node
, npm
and browser-sync
.
- Install nodejs:
- Linux:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
- Mac:
brew install node
- Linux:
- Install Browsersync:
npm install -g browser-sync
Place showQualityReports.sh
and config
in the project root.
Add to app build.gradle:
apply from: "${rootDir}/config/quality/checkstyle/codequality-checkstyle.gradle"
apply from: "${rootDir}/config/quality/findbugs/codequality-findbugs.gradle"
apply from: "${rootDir}/config/quality/pmd/codequality-pmd.gradle"
apply from: "${rootDir}/config/quality/infer/codequality-infer.gradle"
Add to app build.gradle, inside application tag:
lintOptions {
//lint rules
apply from: "${rootDir}/config/quality/lint/codequality-lint.gradle", to: it
//locations for the rules and output
lintConfig file("${rootDir}/config/quality/lint/lint-config.xml")
htmlOutput file("${buildDir}/reports/lint/index.html")
xmlOutput file("${buildDir}/reports/lint/index.xml")
}