-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheckstyle.gradle
41 lines (35 loc) · 945 Bytes
/
checkstyle.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
apply plugin: 'checkstyle'
configurations {
checkstyleConfig
}
def versions = [
checkstyle: '10.23.0',
]
checkstyle {
showViolations = true
ignoreFailures = false
toolVersion = "${versions.checkstyle}"
config = resources.text.fromArchiveEntry(configurations.checkstyleConfig, 'google_checks.xml')
}
// http://dplatz.de/blog/2018/gradle-checkstyle-2.html
// https://discuss.gradle.org/t/checkstyle-how-to-use-an-official-style-configuration/6952/6
dependencies {
checkstyleConfig ("com.puppycrawl.tools:checkstyle:${versions.checkstyle}") {
transitive = false
}
}
task checkstyle(type: Checkstyle) {
description 'Check code standard'
group 'verification'
source 'src'
include '**/*.kt'
include '**/*.java'
exclude '**/gen/**'
classpath = files()
showViolations = true
ignoreFailures = false
reports {
xml.enabled true
html.enabled true
}
}