-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
52 lines (47 loc) · 1.19 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
plugins {
kotlin("jvm") version "1.7.22" apply false
id("io.gitlab.arturbosch.detekt") version "1.22.0"
id("com.diffplug.spotless") version "6.12.0"
}
group = "me.fth"
version = "1.0"
allprojects {
tasks {
withType<Test> { useJUnitPlatform() }
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
languageVersion = "1.8"
freeCompilerArgs += listOf(
"-Xcontext-receivers",
"-opt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlin.ExperimentalStdlibApi"
)
}
}
withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
jvmTarget = "1.8"
}
}
}
detekt {
buildUponDefaultConfig = true
allRules = true
}
spotless {
val editorConfigOverrides = mapOf(
"ktlint_code_style" to "official",
"insert_final_newline" to true,
"indent_size" to 2,
"indent_style" to "space",
"max_line_length" to 140
)
kotlin {
target("**/*.kt")
ktlint().setUseExperimental(true).editorConfigOverride(editorConfigOverrides)
}
kotlinGradle {
target("**/*.kts")
ktlint().setUseExperimental(true).editorConfigOverride(editorConfigOverrides)
}
}