-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
72 lines (62 loc) · 1.78 KB
/
build.gradle.kts
File metadata and controls
72 lines (62 loc) · 1.78 KB
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
plugins {
id("java")
id("checkstyle")
id("com.github.spotbugs") version "6.4.4"
id("com.diffplug.spotless") version "8.0.0"
id("net.ltgt.errorprone") version "4.3.0"
id("pmd")
}
spotless {
java {
googleJavaFormat("1.30.0").aosp()
target("src/**/*.java")
toggleOffOn()
}
}
checkstyle {
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
toolVersion = "12.1.0"
configFile = file("config/checkstyle/checkstyle.xml")
isIgnoreFailures = false
maxWarnings = 0
}
spotbugs {
// https://plugins.gradle.org/plugin/com.github.spotbugs
effort.set(com.github.spotbugs.snom.Effort.MAX)
reportLevel.set(com.github.spotbugs.snom.Confidence.LOW)
ignoreFailures.set(false)
}
pmd {
toolVersion = "7.17.0"
isIgnoreFailures = false
isConsoleOutput = true
rulesMinimumPriority = 5
// https://docs.pmd-code.org/pmd-doc-7.13.0/pmd_rules_java.html
ruleSets = listOf(
"category/java/bestpractices.xml",
"category/java/errorprone.xml",
"category/java/design.xml",
"category/java/performance.xml",
"category/java/security.xml",
"category/java/multithreading.xml",
)
}
group = "org.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(platform("org.junit:junit-bom:6.0.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
errorprone("com.google.errorprone:error_prone_core:2.42.0")
}
tasks.test {
useJUnitPlatform()
}
tasks.register("codeQuality") {
group = "verification"
description = "Run all code style and static analysis checks"
dependsOn("spotlessCheck", "checkstyleMain", "spotbugsMain", "pmdMain")
}