File tree 2 files changed +38
-2
lines changed
2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 1
1
apply plugin : ' checkstyle'
2
+ apply plugin : ' pmd'
2
3
3
- check. dependsOn ' checkstyle'
4
+ check. dependsOn ' checkstyle' , ' pmd '
4
5
5
6
checkstyle {
6
7
toolVersion = ' 7.5.1'
@@ -17,7 +18,28 @@ task checkstyle(type: Checkstyle) {
17
18
reports {
18
19
html {
19
20
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"
21
43
}
22
44
}
23
45
}
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