-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
229 lines (189 loc) · 7.48 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
plugins {
id 'org.springframework.boot' version '2.7.1'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
id 'java'
id 'jacoco'
}
apply plugin: 'io.spring.dependency-management'
apply plugin: "com.ewerk.gradle.plugins.querydsl"
group = 'com.sloth'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
jacoco {
// JaCoCo 버전
toolVersion = "0.8.7"
}
bootJar{
archivesBaseName = 'sloth'
archiveFileName = 'sloth.jar'
archiveVersion = "0.0.1"
}
ext{
springCloudVersion = '2021.0.3'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
repositories {
mavenCentral()
}
dependencies {
// implementation 'org.springframework.boot:spring-boot-starter-actuator' swagger랑 충돌 문제(?)로 임시 주석 처리
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.data:spring-data-envers'
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'
implementation 'org.springframework.session:spring-session-jdbc'
implementation group: 'com.github.ulisesbocchio', name: 'jasypt-spring-boot-starter', version: '3.0.4'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-sleuth', version: '3.1.3'
implementation 'com.querydsl:querydsl-jpa'
implementation 'com.querydsl:querydsl-apt'
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.68'
implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.2'
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation 'net.logstash.logback:logstash-logback-encoder:6.6'
implementation group: 'mysql', name: 'mysql-connector-java', version: '8.0.27'
implementation group: 'org.thymeleaf.extras', name: 'thymeleaf-extras-java8time', version: '2.1.0.RELEASE'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
implementation group: 'nz.net.ultraq.thymeleaf', name: 'thymeleaf-layout-dialect', version: '3.1.0'
compile("org.springframework.boot:spring-boot-starter-mail")
compile('org.springframework.cloud:spring-cloud-starter-openfeign')
compile('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.4')
compile group: 'org.modelmapper', name: 'modelmapper', version: '2.3.9'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
compile group: 'com.navercorp.lucy', name: 'lucy-xss-servlet', version: '2.0.0'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
testImplementation group: 'com.h2database', name: 'h2', version: '1.3.176'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
implementation 'com.google.firebase:firebase-admin:8.1.0'
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.2.2'
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
}
test {
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}
def querydslDir = "$buildDir/generated/querydsl"
querydsl {
library = "com.querydsl:querydsl-apt"
jpa = true
querydslSourcesDir = querydslDir
}
sourceSets {
main {
java {
srcDirs = ['src/main/java', querydslDir]
}
}
}
compileQuerydsl{
options.annotationProcessorPath = configurations.querydsl
}
configurations {
querydsl.extendsFrom compileClasspath
}
jacocoTestReport {
reports {
// 원하는 리포트를 켜고 끌 수 있다.
html.enabled true
xml.enabled false
csv.enabled false
// QDomain 테스트 결과 레포트 제외 처리
def Qdomains = []
for(qPattern in "**/QA" .. "**/QZ"){
Qdomains.add(qPattern+"*")
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"**/*Application*",
"**/config/**",
"**/*Dto*",
"**/interceptor/**",
"**/exception/**",
"**/handler/**",
"**/EntityParams*",
"**/BaseTimeEntity*",
"**/BaseEntity*",
"**/domain/common/**",
"**/app/**",
"**/resolver/**",
"**/login/apple/**",
"**/login/google/**",
"**/login/kakao/**"
] + Qdomains)
}))
}
}
finalizedBy 'jacocoTestCoverageVerification'
}
tasks.jacocoTestCoverageVerification {
def Qdomains = []
for (qPattern in "*.QA".."*.QZ") { // qPattern = "*.QA","*.QB","*.QC", ... "*.QZ"
Qdomains.add(qPattern + "*")
}
violationRules {
rule {
element = "CLASS" // 커버리지 체크 기준
// 브랜치 커버리지를 최소한 80% 만족시켜야 한다.
limit {
counter = 'BRANCH' // 커버리지 측정의 최소 단위
value = 'COVEREDRATIO' // 측정한 커버리지를 커버된 비율, 0부터1사이의 숫자로 보여줌. 1이 100%이다.
minimum = 0.0 //테스트 커버리지 성공 결정
}
// 라인 커버리지를 최소한 80% 만족시켜야 한다.
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.0
}
// 빈 줄을 제외한 코드의 라인수 최대 500라인
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 500
}
// 제외할 클래스 지정
excludes = [
"**.*Application*",
"**.config.**",
"**.*Dto*",
"**.interceptor.**",
"**.exception.**",
"**.handler.**",
"**.EntityParams*",
"**.BaseTimeEntity*",
"**.BaseEntity*",
"**.domain.common.**",
"**.app.**",
"**.resolver.**",
"**.login.apple.**",
"**.login.google.**",
"**.login.kakao.**"
] + Qdomains
}
}
}
jar {
enabled = false
}