-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
238 lines (197 loc) · 6.57 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
230
231
232
233
234
235
236
237
238
buildscript {
ext {
queryDslVersion = "5.0.0"
}
}
plugins {
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'java'
id 'jacoco'
id "org.sonarqube" version "3.4.0.2513"
}
group = 'com.soolsul'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
configurations {
asciidoctorExtensions
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
// Web
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.7'
// Healt Check
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: '2.7.0'
// DB
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}"
implementation 'org.projectlombok:lombok:1.18.20'
annotationProcessor "com.querydsl:querydsl-apt:${queryDslVersion}"
runtimeOnly 'com.mysql:mysql-connector-j'
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.1'
// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// DevTool
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// Client
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.3'
// WireMock
testImplementation 'org.springframework.cloud:spring-cloud-starter-contract-stub-runner:3.1.5'
// JWT
compile 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5',
// Uncomment the next line if you want to use RSASSA-PSS (PS256, PS384, PS512) algorithms:
//'org.bouncycastle:bcprov-jdk15on:1.70',
'io.jsonwebtoken:jjwt-jackson:0.11.5' // or 'io.jsonwebtoken:jjwt-gson:0.11.5' for gson
// API Docs
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
// Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'io.rest-assured:rest-assured:4.2.0'
// Test Container
testImplementation "org.junit.jupiter:junit-jupiter:5.8.1"
testImplementation "org.testcontainers:testcontainers:1.17.6"
testImplementation "org.testcontainers:junit-jupiter:1.17.6"
testImplementation "org.testcontainers:mysql:1.17.6"
//aws sdk
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.332'
testImplementation 'org.testcontainers:localstack:1.17.4'
}
// -- API 문서화 설정 -------------------------------------------------------
ext {
snippetsDir = file("${project.buildDir}/generated-snippets")
}
asciidoctor {
dependsOn test
configurations 'asciidoctorExtensions'
inputs.dir snippetsDir
sources {
include '**/index.adoc'
}
baseDirFollowsSourceFile()
}
asciidoctor.doFirst {
delete file("${project.rootDir}/src/main/resources/static/docs")
}
task copyDocument(type: Copy) {
dependsOn asciidoctor
from "${project.buildDir}/docs/asciidoc"
into "${project.rootDir}/src/main/resources/static/docs"
}
bootJar {
dependsOn copyDocument
copy {
from "${project.buildDir}/docs/asciidoc"
into "${project.buildDir}/resources/main/static/docs"
}
}
// -- QueryDsl 설정 -------------------------------------------------------
def querydslDir = "$buildDir/generated/querydsl"
querydsl {
jpa = true
querydslSourcesDir = querydslDir
}
sourceSets {
main.java.srcDir querydslDir
}
configurations {
querydsl.extendsFrom compileClasspath
}
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl
}
// -- Jacoco 설정 -------------------------------------------------------
test {
jacoco {
destinationFile = file("$buildDir/jacoco/jacoco.exec")
}
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}
jacoco {
// jacoco version
toolVersion = '0.8.8'
}
jacocoTestReport {
dependsOn test
reports {
html.enabled true // 개발자용 html
xml.enabled true // 소나큐브용
csv.enabled true
html.destination file("src/jacoco/jacoco.html")
}
// QueryDSL은 분석에서 제외시켜야 함
def Qdomains = []
for (qPattern in '**/QA'..'**/QZ') {
Qdomains.add(qPattern + '*')
}
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, excludes: [
'**/*Request.*',
'**/*Response.*',
'**/dto/**',
'**/*Interceptor.*',
'**/*Exception.*',
'**/*Storage.*',
'**/SoolsulServerApplication.*',
'**/*Token.*'
] + Qdomains)
})
)
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification {
def Qdomains = []
for (qPattern in '*.QA'..'*.QZ') {
Qdomains.add(qPattern + '*')
}
violationRules {
rule {
limit {
element = 'CLASS'
minimum = 0.0
}
excludes = [
'**.*Request.*',
'**.*Response.*',
'**/dto/**',
'**.*Interceptor.*',
'**.*Exception.*',
'**.*Storage.*',
'**.SoolsulServerApplication.*',
'**.*Token.*'
] + Qdomains
}
}
}
task testCoverage(type: Test) {
group 'verification'
description 'Runs the unit tests with coverage'
dependsOn(':test',
':jacocoTestReport',
':jacocoTestCoverageVerification')
tasks['jacocoTestReport'].mustRunAfter(tasks['test'])
tasks['jacocoTestCoverageVerification'].mustRunAfter(tasks['jacocoTestReport'])
}
// -- SonarQube 설정 -------------------------------------------------------
sonarqube {
properties {
property "sonar.projectKey", "project key"
}
}