File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed
Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 11apply plugin : ' checkstyle'
2+ apply plugin : ' pmd'
23
3- check. dependsOn ' checkstyle'
4+ check. dependsOn ' checkstyle' , ' pmd '
45
56checkstyle {
67 toolVersion = ' 7.5.1'
@@ -17,7 +18,28 @@ task checkstyle(type: Checkstyle) {
1718 reports {
1819 html {
1920 enabled true
20- destination " $project . buildDir /reports/checkstyle/checkstyle.html"
21+ destination " ${ project.buildDir} /reports/checkstyle/checkstyle.html"
22+ }
23+ }
24+ }
25+
26+ task pmd (type : Pmd ) {
27+ ignoreFailures = true
28+ ruleSetFiles = files(" ${ project.rootDir} /ruleset.xml" )
29+ ruleSets = []
30+
31+ source ' src'
32+ include ' **/*.java'
33+ exclude ' **/gen/**'
34+
35+ reports {
36+ xml. enabled = false
37+ html. enabled = true
38+ xml {
39+ destination " ${ project.buildDir} /reports/pmd/pmd.xml"
40+ }
41+ html {
42+ destination " ${ project.buildDir} /reports/pmd/pmd.html"
2143 }
2244 }
2345}
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <ruleset xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" name =" Commons Android App Rules"
3+ xmlns =" http://pmd.sf.net/ruleset/1.0.0"
4+ xsi : noNamespaceSchemaLocation =" http://pmd.sf.net/ruleset_xml_schema.xsd"
5+ xsi : schemaLocation =" http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" >
6+
7+ <description >Custom ruleset for Commons Android app</description >
8+
9+ <exclude-pattern >.*/R.java</exclude-pattern >
10+ <exclude-pattern >.*/gen/.*</exclude-pattern >
11+
12+ <rule ref =" rulesets/java/android.xml" />
13+ <rule ref =" rulesets/java/basic.xml" />
14+ </ruleset >
You can’t perform that action at this time.
0 commit comments