forked from Tapadoo/Alerter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quality.gradle
66 lines (54 loc) · 1.74 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
60
61
62
63
64
65
66
//noinspection GrPackage
apply plugin: 'checkstyle'
apply plugin: 'pmd'
final String QUALITY_DIR = "quality"
final String SOURCE = "src"
final String INCLUDE_JAVA = "**/*.java"
final String EXCLUDE_GENERATED = "**/gen/**"
android {
lintOptions {
abortOnError true
xmlReport false
htmlReport true
lintConfig file("${project.rootDir}/${QUALITY_DIR}/lint/lint.xml")
htmlOutput file("$project.buildDir/reports/lint/lint-result.html")
xmlOutput file("$project.buildDir/reports/lint/lint-result.xml")
}
}
checkstyle {
toolVersion = '7.5'
}
/*
* Check Styles - is a development tool to help programmers write Java code that adheres to a coding standard.
*/
task checkstyle(type: Checkstyle) {
configFile = file("${rootProject.rootDir}/${QUALITY_DIR}/checkstyle/checkstyle.xml")
def suppressionsFile = new File("${project.rootDir}/${QUALITY_DIR}/checkstyle/suppressions.xml")
configProperties.checkstyleSuppressionsPath = suppressionsFile.absolutePath
source SOURCE
include INCLUDE_JAVA
exclude EXCLUDE_GENERATED
classpath = files()
}
/*
* Programming Mistake Detector - a source code analyzer. It finds common programming flaws.
*/
task pmd(type: Pmd) {
ignoreFailures = false
ruleSetFiles = files("${project.rootDir}/${QUALITY_DIR}/pmd/pmd-ruleset.xml")
ruleSets = []
source SOURCE
include INCLUDE_JAVA
exclude EXCLUDE_GENERATED
reports {
xml.enabled = false
html.enabled = true
xml {
destination new File("$project.buildDir/reports/pmd/pmd.xml")
}
html {
destination new File("$project.buildDir/reports/pmd/pmd.html")
}
}
}
check.dependsOn 'lint'