From 71825b09d121c108668bc37e684fcd5b1eff8723 Mon Sep 17 00:00:00 2001 From: Yusuke Matsubara Date: Thu, 16 Mar 2017 15:40:45 +0900 Subject: [PATCH] Add PMD settings --- app/quality.gradle | 26 ++++++++++++++++++++++++-- ruleset.xml | 14 ++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 ruleset.xml diff --git a/app/quality.gradle b/app/quality.gradle index e4cdd64e7..a63a02720 100644 --- a/app/quality.gradle +++ b/app/quality.gradle @@ -1,6 +1,7 @@ apply plugin: 'checkstyle' +apply plugin: 'pmd' -check.dependsOn 'checkstyle' +check.dependsOn 'checkstyle', 'pmd' checkstyle { toolVersion = '7.5.1' @@ -17,7 +18,28 @@ task checkstyle(type: Checkstyle) { reports { html { enabled true - destination "$project.buildDir/reports/checkstyle/checkstyle.html" + destination "${project.buildDir}/reports/checkstyle/checkstyle.html" + } + } +} + +task pmd(type: Pmd) { + ignoreFailures = true + ruleSetFiles = files("${project.rootDir}/ruleset.xml") + ruleSets = [] + + source 'src' + include '**/*.java' + exclude '**/gen/**' + + reports { + xml.enabled = false + html.enabled = true + xml { + destination "${project.buildDir}/reports/pmd/pmd.xml" + } + html { + destination "${project.buildDir}/reports/pmd/pmd.html" } } } diff --git a/ruleset.xml b/ruleset.xml new file mode 100644 index 000000000..eac101491 --- /dev/null +++ b/ruleset.xml @@ -0,0 +1,14 @@ + + + + Custom ruleset for Commons Android app + + .*/R.java + .*/gen/.* + + + +