-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
75 lines (64 loc) · 2.27 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
plugins {
java
`project-report`
alias(libs.plugins.catalog.update)
alias(libs.plugins.spotless)
}
allprojects {
apply(plugin = "java")
apply(plugin = "com.diffplug.spotless")
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
testing {
suites {
withType<JvmTestSuite> {
useJUnitJupiter()
targets {
all {
testTask.configure {
testLogging {
exceptionFormat = FULL
showStandardStreams = true
events("skipped", "failed")
}
}
}
}
}
}
}
dependencies {
testImplementation(platform(rootProject.libs.junit))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testImplementation(rootProject.libs.assertj)
testImplementation(rootProject.libs.mockito.junit)
testRuntimeOnly(platform(rootProject.libs.log4j))
testRuntimeOnly("org.apache.logging.log4j:log4j-api")
testRuntimeOnly("org.apache.logging.log4j:log4j-core")
testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j2-impl")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
spotless {
java {
palantirJavaFormat()
removeUnusedImports()
toggleOffOn()
cleanthat()
.addMutator("SafeButNotConsensual")
.addMutator("SafeButControversial")
.addMutator("LocalVariableTypeInference")
// Allow ternary operators
.excludeMutator("AvoidInlineConditionals")
// Allow comparison with literal last
.excludeMutator("LiteralsFirstInComparisons")
// This gets very confused with e.g. ISO8601 dates
.excludeMutator("UseUnderscoresInNumericLiterals")
.sourceCompatibility(java.sourceCompatibility.toString())
}
}
}