-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
221 lines (185 loc) · 6.32 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
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.12'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'jacoco'
// querydsl 플러그인 추가
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
}
group = 'com.ssafy'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
ext {
set('snippetsDir', file('build/generated-snippets'))
// QueryDsl Version
queryDslVersion = "5.0.0"
}
jacoco {
toolVersion = "0.8.8"
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
jacoco {
enabled = true
destinationFile = layout.buildDirectory.file("jacoco/${name}.exec").get().asFile
includes = []
excludes = []
excludeClassLoaders = []
includeNoLocationClasses = false
sessionId = "<auto-generated value>"
dumpOnExit = true
classDumpDir = null
output = JacocoTaskExtension.Output.FILE
address = "localhost"
port = 6300
jmx = false
}
outputs.dir snippetsDir
}
jacocoTestReport {
dependsOn test
reports {
xml.required = false
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
element = 'CLASS'
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.60
}
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.60
}
limit {
counter = 'METHOD'
value = 'COVEREDRATIO'
minimum = 0.60
}
excludes = ['com.ssafy.ssafsound.domain.BaseTimeEntity',
'com.ssafy.ssafsound.domain.*.domain.**',
'com.ssafy.ssafsound.global.**',
'*.*Controller',
'*.SsafsoundApplication',
'com.ssafy.ssafsound.domain.*.dto.**',
'com.ssafy.ssafsound.domain.*.validator.**',
'com.ssafy.ssafsound.domain.*.exception.**',
'com.ssafy.ssafsound.domain.meta.converter.**',
'com.ssafy.ssafsound.domain.*.repository.**',
'com.ssafy.ssafsound.infra.**',
'com.ssafy.ssafsound.domain.auth.service.oauth.**',
'com.ssafy.ssafsound.batch.**',
'com.ssafy.ssafsound.domain.lunch.task.**',
'com.ssafy.ssafsound.domain.recruit.task.**',
'com.ssafy.ssafsound.domain.auth.util.**',
'com.ssafy.ssafsound.domain.auth.service.token.**',
'com.ssafy.ssafsound.domain.QBaseTimeEntity',
'com.ssafy.ssafsound.domain.chat.service.*Service']
}
}
}
configurations {
asciidoctorExtensions
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
// Spring Cloud AWS
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
compileOnly 'org.projectlombok:lombok'
// runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
// Annotation Processor
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
// querydsl 의존성 추가
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}"
implementation "com.querydsl:querydsl-apt:${queryDslVersion}"
// Spring Rest docs
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
//restAssured
testImplementation 'io.rest-assured:rest-assured:4.4.0'
testImplementation 'io.rest-assured:spring-mock-mvc:4.4.0'
// Mongodb 의존성 추가
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
}
task prepareDirs {
mustRunAfter clean
doLast {
mkdir "$buildDir/generated-snippets"
}
}
asciidoctor {
dependsOn test
dependsOn prepareDirs
configurations 'asciidoctorExtensions'
inputs.dir snippetsDir
sources {
include("**/index.adoc")
}
baseDirFollowsSourceFile()
}
asciidoctor.doFirst {
delete file('src/main/resources/static/docs')
}
tasks.register('createDocument', Copy) {
dependsOn asciidoctor
from file("build/docs/asciidoc")
into file("src/main/resources/static/docs")
}
bootJar {
dependsOn createDocument
from("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
// querydsl 사용할 경로 지정
def querydslDir = "build/generated"
// JPA 사용여부 및 사용 경로 설정
querydsl {
jpa = true
querydslSourcesDir = querydslDir
springDataMongo = true
}
// build시 사용할 sourceSet 추가 설정
sourceSets {
main.java.srcDir querydslDir
}
// querydsl 컴파일 시 사용할 옵션 설정
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl
}
// querydsl이 compileClassPath를 상속하도록 설정
configurations {
compileOnly {
extendsFrom annotationProcessor
}
querydsl.extendsFrom compileClasspath
}
}