mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add PMD settings
This commit is contained in:
parent
816a234187
commit
71825b09d1
2 changed files with 38 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
apply plugin: 'checkstyle'
|
apply plugin: 'checkstyle'
|
||||||
|
apply plugin: 'pmd'
|
||||||
|
|
||||||
check.dependsOn 'checkstyle'
|
check.dependsOn 'checkstyle', 'pmd'
|
||||||
|
|
||||||
checkstyle {
|
checkstyle {
|
||||||
toolVersion = '7.5.1'
|
toolVersion = '7.5.1'
|
||||||
|
|
@ -17,7 +18,28 @@ task checkstyle(type: Checkstyle) {
|
||||||
reports {
|
reports {
|
||||||
html {
|
html {
|
||||||
enabled true
|
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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
ruleset.xml
Normal file
14
ruleset.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Commons Android App Rules"
|
||||||
|
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||||
|
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||||
|
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||||
|
|
||||||
|
<description>Custom ruleset for Commons Android app</description>
|
||||||
|
|
||||||
|
<exclude-pattern>.*/R.java</exclude-pattern>
|
||||||
|
<exclude-pattern>.*/gen/.*</exclude-pattern>
|
||||||
|
|
||||||
|
<rule ref="rulesets/java/android.xml" />
|
||||||
|
<rule ref="rulesets/java/basic.xml" />
|
||||||
|
</ruleset>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue