-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
118 lines (98 loc) · 3.2 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import io.gitlab.arturbosch.detekt.Detekt
plugins {
id("org.springframework.boot") version "3.4.2"
id("io.spring.dependency-management") version "1.1.6"
kotlin("jvm") version "2.0.10"
kotlin("plugin.spring") version "2.0.10"
kotlin("plugin.jpa") version "2.0.10"
id("io.gitlab.arturbosch.detekt") version "1.23.7"
id("org.jetbrains.kotlinx.kover") version "0.9.1"
}
val javaVersion = JavaVersion.VERSION_21
java.sourceCompatibility = javaVersion
java.targetCompatibility = javaVersion
allprojects {
group = "org.depromeet"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
}
val reportMerge by tasks.registering(io.gitlab.arturbosch.detekt.report.ReportMergeTask::class) {
output.set(rootProject.layout.buildDirectory.file("reports/detekt/merge.xml"))
}
subprojects {
apply(plugin = "org.springframework.boot")
apply(plugin = "io.spring.dependency-management")
apply(plugin = "org.jetbrains.kotlin.plugin.spring")
apply(plugin = "org.jetbrains.kotlin.plugin.jpa")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "io.gitlab.arturbosch.detekt")
apply(plugin = "org.jetbrains.kotlinx.kover")
dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.github.oshai:kotlin-logging-jvm:7.0.4")
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
testImplementation(kotlin("test"))
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.7")
kover(project(project.path))
}
detekt {
config.setFrom(
files("$rootDir/config/detekt.yml")
)
autoCorrect = true
buildUponDefaultConfig = true
debug = true
allRules = false
parallel = true
tasks.withType<Detekt>().configureEach {
reports {
html.required.set(true)
sarif.required.set(true)
}
}
}
kover {
reports {
total {
xml {
onCheck = true
}
html {
onCheck = true
}
}
}
}
java.sourceCompatibility = javaVersion
java.targetCompatibility = javaVersion
tasks {
compileKotlin {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = javaVersion.toString()
}
}
test {
useJUnitPlatform()
}
detekt {
configureEach {
finalizedBy(reportMerge)
}
}
}
reportMerge {
input.from(tasks.detekt.map { it.xmlReportFile })
}
}
tasks.configureEach {
onlyIf { false }
}