-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
51 lines (41 loc) · 1.46 KB
/
build.gradle.kts
File metadata and controls
51 lines (41 loc) · 1.46 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
import org.jetbrains.kotlin.gradle.dsl.JvmDefaultMode
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.spring.dependencyManagement) apply false
alias(libs.plugins.spring.boot) apply false
alias(libs.plugins.detekt) apply false
}
// Почему-то внутри subprojects libs не доступен
val kotlinPlugin = libs.plugins.kotlin.asProvider().get()
val detektPlugin = libs.plugins.detekt.get()
subprojects {
apply(plugin = kotlinPlugin.pluginId)
apply(plugin = detektPlugin.pluginId)
repositories {
mavenCentral()
}
configure<JavaPluginExtension> {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
configure<dev.detekt.gradle.extensions.DetektExtension> {
toolVersion = detektPlugin.version.requiredVersion
config.setFrom(file(rootProject.rootDir.resolve("config/detekt/detekt.yml")))
buildUponDefaultConfig = false
}
tasks.withType<KotlinCompile> {
compilerOptions {
freeCompilerArgs = listOf("-Xjsr305=strict", "-Xwhen-guards")
jvmTarget.set(JvmTarget.JVM_21)
jvmDefault.set(JvmDefaultMode.NO_COMPATIBILITY)
allWarningsAsErrors = true
}
}
tasks.withType<Test> {
this.systemProperty("file.encoding", "utf-8")
useJUnitPlatform()
}
}