-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
149 lines (122 loc) · 4.55 KB
/
build.gradle.kts
File metadata and controls
149 lines (122 loc) · 4.55 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot")
id("io.spring.dependency-management")
id("jacoco")
kotlin("jvm")
kotlin("plugin.spring")
kotlin("plugin.jpa")
kotlin("plugin.allopen")
kotlin("kapt") version "1.7.10"
idea
}
allOpen {
annotation("jakarta.persistence.Entity")
annotation("jakarta.persistence.MappedSuperclass")
annotation("jakarta.persistence.Embeddable")
}
group = "kr.bomiza"
version = "0.0.2-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
}
extra["springCloudVersion"] = "2021.0.1"
dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
}
}
dependencies {
implementation(project(":domain"))
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
// QueryDsl
implementation("com.querydsl:querydsl-jpa:5.0.0:jakarta")
kapt("com.querydsl:querydsl-apt:5.0.0:jakarta")
kapt("jakarta.annotation:jakarta.annotation-api")
kapt("jakarta.persistence:jakarta.persistence-api")
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
implementation("io.jsonwebtoken:jjwt-impl:0.11.5")
implementation("io.jsonwebtoken:jjwt-jackson:0.11.5")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2")
implementation("com.fasterxml.jackson.core:jackson-databind")
implementation("com.google.code.gson:gson:2.8.9")
implementation("com.h2database:h2")
implementation("io.github.microutils:kotlin-logging:3.0.4")
implementation("org.springframework.boot:spring-boot-starter-mustache")
testImplementation("org.springframework.boot:spring-boot-starter-test")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
}
idea {
module {
val kaptMain = file("build/generated/source/kapt/main")
sourceDirs.add(kaptMain)
generatedSourceDirs.add(kaptMain)
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
// finalizedBy("jacocoTestReport")
}
// jacoco start
tasks.jacocoTestReport {
reports {
// html로 report 생성하기
// 빌드경로/jacoco/report.html 폴더 내부로 경로 설정
html.destination = file("$buildDir/jacoco/report.html")
}
dependsOn("test")
finalizedBy("jacocoTestCoverageVerification")
}
// jacoco 커버리지 검증 설정
tasks.jacocoTestCoverageVerification {
violationRules {
rule {
isEnabled = true // 커버리지 적용 여부
element = "CLASS" // 커버리지 적용 단위
// 라인 커버리지 설정
// 적용 대상 전체 소스 코드들을 한줄 한줄 따졌을 때 테스트 코드가 작성되어 있는 줄의 빈도
// 테스트 코드가 작성되어 있는 비율이 0% 이상이어야 함
limit {
counter = "LINE"
value = "COVEREDRATIO"
minimum = "0.00".toBigDecimal()
}
// 브랜치 커버리지 설정
// if-else 등을 활용하여 발생되는 분기들 중 테스트 코드가 작성되어 있는 빈도
// 테스트 코드가 작성되어 있는 비율이 0% 이상이어야 함
limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = "0.00".toBigDecimal()
}
// 라인 최대 갯수 설정
// 빈 줄을 제외하고 하나의 자바 파일에서 작성될 수 있는 최대 라인 갯수
// 한 파일에 최대 500줄까지 작성되어야 함
limit {
counter = "LINE"
value = "TOTALCOUNT"
maximum = "500".toBigDecimal()
}
}
}
}
// jacoco end
val jar: Jar by tasks
jar.enabled = false
tasks.withType<org.springframework.boot.gradle.tasks.bundling.BootJar> {
enabled = true
archiveFileName.set("app.jar")
}