forked from openMF/mobile-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquality.gradle
executable file
·59 lines (49 loc) · 1.38 KB
/
quality.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* Set up Checkstyle, Findbugs and PMD to perform extensive code analysis.
*
* Gradle tasks added:
* - checkstyle
* - findbugs
* - pmd
*
* The three tasks above are added as dependencies of the check task so running check will
* run all of them.
*/
apply plugin: 'checkstyle'
apply plugin: 'pmd'
dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:6.19'
}
def qualityConfigDir = "$project.rootDir/config/quality"
def reportsDir = "$project.buildDir/reports"
check.dependsOn 'checkstyle', 'pmd'
task checkstyle(type: Checkstyle, group: 'Verification', description: 'Runs code style checks') {
configFile file("$qualityConfigDir/checkstyle/checkstyle-config.xml")
source 'src'
include '**/*.java'
reports {
xml.enabled = true
xml {
destination file("$reportsDir/checkstyle/checkstyle.xml")
}
}
classpath = files( )
}
task pmd(type: Pmd, group: 'Verification', description: 'Inspect sourcecode for bugs') {
ruleSetFiles = files("$qualityConfigDir/pmd/pmd-ruleset.xml")
ignoreFailures = false
ruleSets = []
source 'src'
include '**/*.java'
exclude '**/gen/**'
reports {
xml.enabled = true
html.enabled = true
xml {
destination file("$reportsDir/pmd/pmd.xml")
}
html {
destination file("$reportsDir/pmd/pmd.html")
}
}
}