-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
97 lines (80 loc) · 2.25 KB
/
build.gradle.kts
File metadata and controls
97 lines (80 loc) · 2.25 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
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "3.2.1" apply false
id("io.spring.dependency-management") version "1.1.4" apply false
id("org.jlleitschuh.gradle.ktlint") version "12.0.3"
id("jacoco")
kotlin("jvm") version "1.9.21"
kotlin("plugin.spring") version "1.9.21" apply false
}
val projectGroup: String by project
val applicationVersion: String by project
java {
sourceCompatibility = JavaVersion.VERSION_21
}
tasks.withType<JavaCompile> {
options.release.set(21) // compileJava 타겟 설정
}
allprojects {
group = "org.fastcampus"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
apply {
plugin("org.jlleitschuh.gradle.ktlint")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = JavaVersion.VERSION_21.toString()
}
}
tasks.register("addGitPreCommitHook", Copy::class) {
from(file("script/pre-commit"))
into(file(".git/hooks"))
}
}
subprojects {
apply {
plugin("java")
plugin("io.spring.dependency-management")
plugin("org.springframework.boot")
plugin("org.jetbrains.kotlin.plugin.spring")
plugin("kotlin")
plugin("kotlin-spring")
plugin("jacoco")
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.jetbrains.kotlin:kotlin-reflect")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.strikt:strikt-core:0.34.0")
}
tasks.withType<Test> {
useJUnitPlatform()
finalizedBy("jacocoTestReport")
}
tasks.jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(true)
}
}
tasks.jacocoTestCoverageVerification {
dependsOn(tasks.jacocoTestReport)
violationRules {
rule {
limit {
minimum = "0.60".toBigDecimal()
}
}
}
}
tasks.getByName("bootJar") {
enabled = false
}
tasks.getByName("jar") {
enabled = true
}
}