/
build.gradle.kts
82 lines (75 loc) · 2 KB
/
build.gradle.kts
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// tag::use-checkstyle-plugin[]
// tag::use-codenarc-plugin[]
// tag::use-pmd-plugin[]
plugins {
// end::use-checkstyle-plugin[]
// end::use-codenarc-plugin[]
// end::use-pmd-plugin[]
groovy
// tag::use-checkstyle-plugin[]
checkstyle
// end::use-checkstyle-plugin[]
// tag::use-codenarc-plugin[]
codenarc
// end::use-codenarc-plugin[]
// tag::use-pmd-plugin[]
pmd
// tag::use-checkstyle-plugin[]
// tag::use-codenarc-plugin[]
}
// end::use-checkstyle-plugin[]
// end::use-codenarc-plugin[]
// end::use-pmd-plugin[]
repositories {
mavenCentral()
}
// tag::specify-groovy-version[]
dependencies {
// end::specify-groovy-version[]
implementation(localGroovy())
testImplementation("junit:junit:4.13")
// tag::specify-groovy-version[]
"codenarc"("org.codehaus.groovy:groovy-all:3.0.3")
"codenarc"("org.codenarc:CodeNarc:1.6.1")
}
// end::specify-groovy-version[]
// tag::customize-checkstyle-memory[]
tasks.withType<Checkstyle>().configureEach {
minHeapSize = "200m"
maxHeapSize = "1g"
}
// end::customize-checkstyle-memory[]
// tag::enable-checkstyle-sarif-report[]
checkstyle {
toolVersion = "10.3.3"
}
// end::enable-checkstyle-sarif-report[]
// tag::enable-checkstyle-sarif-report[]
// tag::customize-checkstyle-report[]
tasks.withType<Checkstyle>().configureEach {
reports {
// end::customize-checkstyle-report[]
sarif.required = true
// end::enable-checkstyle-sarif-report[]
// tag::customize-checkstyle-report[]
xml.required = false
html.required = true
html.stylesheet = resources.text.fromFile("config/xsl/checkstyle-custom.xsl")
// tag::enable-checkstyle-sarif-report[]
}
}
// end::enable-checkstyle-sarif-report[]
// end::customize-checkstyle-report[]
// tag::customize-pmd[]
pmd {
isConsoleOutput = true
toolVersion = "7.0.0"
rulesMinimumPriority = 5
ruleSets = listOf("category/java/errorprone.xml", "category/java/bestpractices.xml")
}
// end::customize-pmd[]
// tag::pmd-threads[]
pmd {
threads = 4
}
// end::pmd-threads[]