X-Git-Url: https://git.mdrn.pl/wl-app.git/blobdiff_plain/48b2fe9f7c2dc3d9aeaaa6dbfb27c7da4f3235ff..269195b3729c1bdc22e9053ee4ebca667ea8549d:/Android/r2-streamer/config/quality/quality.gradle diff --git a/Android/r2-streamer/config/quality/quality.gradle b/Android/r2-streamer/config/quality/quality.gradle new file mode 100755 index 0000000..e57b911 --- /dev/null +++ b/Android/r2-streamer/config/quality/quality.gradle @@ -0,0 +1,90 @@ +/** + * Set up Checkstyle, Findbugs and PMD to perform extensive code analysis. + * + * Gradle tasks added: + * - checkstyle + * - findbugs + * - pmd + * + * The three tasks above are added as dependencies of the check task so running check will + * run all of them. + */ + +apply plugin: 'checkstyle' +apply plugin: 'findbugs' +apply plugin: 'pmd' + +dependencies { + checkstyle 'com.puppycrawl.tools:checkstyle:6.5' +} + +def qualityConfigDir = "$project.rootDir/config/quality"; +def reportsDir = "$project.buildDir/reports" + +check.dependsOn 'checkstyle', 'findbugs', 'pmd' + +task checkstyle(type: Checkstyle, group: 'Verification', description: 'Runs code style checks') { + configFile file("$qualityConfigDir/checkstyle/checkstyle-config.xml") + source 'src' + include '**/*.java' + + reports { + xml.enabled = true + xml { + destination "$reportsDir/checkstyle/checkstyle.xml" + } + } + + classpath = files( ) +} + +task findbugs(type: FindBugs, + group: 'Verification', + description: 'Inspect java bytecode for bugs', + dependsOn: ['compileDebugSources','compileReleaseSources']) { + + ignoreFailures = false + effort = "max" + reportLevel = "high" + excludeFilter = new File("$qualityConfigDir/findbugs/android-exclude-filter.xml") + classes = files("$project.rootDir/folioreader/build/intermediates/classes") + + source 'src' + include '**/*.java' + exclude '**/gen/**' + + reports { + xml.enabled = false + html.enabled = true + xml { + destination "$reportsDir/findbugs/findbugs.xml" + } + html { + destination "$reportsDir/findbugs/findbugs.html" + } + } + + classpath = files() +} + + +task pmd(type: Pmd, group: 'Verification', description: 'Inspect sourcecode for bugs') { + ruleSetFiles = files("$qualityConfigDir/pmd/pmd-ruleset.xml") + ignoreFailures = false + ruleSets = [] + + source 'src' + include '**/*.java' + exclude '**/gen/**' + + reports { + xml.enabled = true + html.enabled = true + xml { + destination "$reportsDir/pmd/pmd.xml" + } + html { + destination "$reportsDir/pmd/pmd.html" + } + } +} \ No newline at end of file