forked from gradle/gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
76 lines (69 loc) · 1.79 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
// 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()
}
dependencies {
implementation(localGroovy())
testImplementation("junit:junit:4.13")
}
// tag::customize-checkstyle-memory[]
tasks.withType<Checkstyle>().configureEach {
minHeapSize.set("200m")
maxHeapSize.set("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.set(true)
// end::enable-checkstyle-sarif-report[]
// tag::customize-checkstyle-report[]
xml.required.set(false)
html.required.set(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 = "6.21.0"
rulesMinimumPriority.set(5)
ruleSets = listOf("category/java/errorprone.xml", "category/java/bestpractices.xml")
}
// end::customize-pmd[]
// tag::pmd-threads[]
pmd {
threads.set(4)
}
// end::pmd-threads[]