From 78d15dd4a8649832e27051f0519a7980d8888136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 1 Mar 2016 17:30:48 +0000 Subject: [PATCH] Add PMD, for now with no rules Unlike findbugs, PMD is very easy to configure. Should be very useful as long as we set a correct ruleSet. --- F-Droid/build.gradle | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/F-Droid/build.gradle b/F-Droid/build.gradle index 7236d7c19..a58edd30d 100644 --- a/F-Droid/build.gradle +++ b/F-Droid/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'com.android.application' apply plugin: 'witness' apply plugin: 'checkstyle' +apply plugin: 'pmd' repositories { jcenter() @@ -203,11 +204,24 @@ task checkstyle(type: Checkstyle) { configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml") source 'src', 'test/src' include '**/*.java' - exclude '**/gen/**' classpath = files() } +pmd { + toolVersion = '5.4.1' + consoleOutput = true +} + +task pmd(type: Pmd, dependsOn: assembleDebug) { + ruleSets = [ + //'java-basic', + //'java-unusedcode', + ] + source 'src' + include '**/org/fdroid/**/*.java' +} + // This person took the example code below from another blogpost online, however // I lost the reference to it: // http://stackoverflow.com/questions/23297562/gradle-javadoc-and-android-documentation