-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
197 lines (159 loc) · 4.75 KB
/
build.gradle
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.1'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'jacoco'
id 'com.google.cloud.tools.jib' version '3.2.1'
}
group = 'online.partyrun'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
targetCompatibility = 17
}
jib {
from {
image = "openjdk:17"
}
to {
tags = ["latest"]
}
container {
jvmFlags = ["-Xms128m", "-Xmx128m"]
}
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
configurations {
asciidoctorExt
compileOnly {
extendsFrom annotationProcessor
}
asciidoctorExtensions
}
ext {
set('snippetsDir', file("build/generated-snippets"))
}
task createDocument(type: Copy) {
dependsOn asciidoctor
from file("${asciidoctor.outputDir}")
into file("build/resources/main/static/docs")
}
bootJar {
dependsOn createDocument
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-aop'
//test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'org.testcontainers:junit-jupiter:1.19.0'
//rest docs
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'org.springframework.restdocs:spring-restdocs-webtestclient'
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
// spring security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'
implementation 'com.github.SWM-KAWAI-MANS:jwt-manager:1.3.0'
// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
// mongodb
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'
testImplementation 'de.flapdoodle.embed:de.flapdoodle.embed.mongo.spring30x:4.7.0'
// for apple silicon
developmentOnly 'io.netty:netty-resolver-dns-native-macos:4.1.94.Final:osx-aarch_64'
//mapstruct
implementation 'org.mapstruct:mapstruct:1.5.1.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.1.Final'
annotationProcessor "org.projectlombok:lombok-mapstruct-binding:0.2.0"
// lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
jar {
enabled = false
}
jacoco {
toolVersion = '0.8.8'
}
test {
outputs.dir snippetsDir
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}
asciidoctor {
configurations "asciidoctorExtensions"
inputs.dir snippetsDir
dependsOn test
}
bootJar {
dependsOn asciidoctor
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}
jacocoTestReport {
dependsOn test
reports {
html.enabled true
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification {
violationRules {
rule {
// 각 클래스
element = 'CLASS'
// 분기문 커버리지
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.8
}
// 라인 커버리지
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.8
}
// 코드에서 사용하는 메소드 중, 테스트가 실행된 메소드의 비율
limit {
counter = 'METHOD'
value = 'COVEREDRATIO'
minimum = 0.8
}
excludes = [
'**.*Application*',
'**.*Request*',
'**.*Response*',
'**.*Config*',
'**.*Exception*',
'**.*Handler*',
'**.*Mapper*',
'**.*ControllerAdvice*',
'**.WebfluxAuthFilter*',
'**.*Event*',
'**.external.**',
'**.*Advisor*'
]
}
rule {
element = 'METHOD'
// 최대 method 라인 수
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 20
}
}
}
}