2 * Set up Checkstyle, Findbugs and PMD to perform extensive code analysis.
9 * The three tasks above are added as dependencies of the check task so running check will
13 apply plugin: 'checkstyle'
14 apply plugin: 'findbugs'
18 checkstyle 'com.puppycrawl.tools:checkstyle:6.5'
21 def qualityConfigDir = "$project.rootDir/config/quality"
22 def reportsDir = "$project.buildDir/reports"
24 check.dependsOn 'checkstyle', 'findbugs', 'pmd'
26 task checkstyle(type: Checkstyle, group: 'Verification', description: 'Runs code style checks') {
27 configFile file("$qualityConfigDir/checkstyle/checkstyle-config.xml")
34 destination "$reportsDir/checkstyle/checkstyle.xml"
41 task findbugs(type: FindBugs,
42 group: 'Verification',
43 description: 'Inspect java bytecode for bugs',
44 dependsOn: ['compileDebugSources','compileReleaseSources']) {
46 ignoreFailures = false
49 excludeFilter = new File("$qualityConfigDir/findbugs/android-exclude-filter.xml")
50 classes = files("$project.rootDir/folioreader/build/intermediates/classes")
60 destination "$reportsDir/findbugs/findbugs.xml"
63 destination "$reportsDir/findbugs/findbugs.html"
71 task pmd(type: Pmd, group: 'Verification', description: 'Inspect sourcecode for bugs') {
72 ruleSetFiles = files("$qualityConfigDir/pmd/pmd-ruleset.xml")
73 ignoreFailures = false
84 destination "$reportsDir/pmd/pmd.xml"
87 destination "$reportsDir/pmd/pmd.html"