-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
226 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
222
223
224
225
226
plugins {
id 'java'
id "org.sonarqube" version "4.2.1.3168"
id 'jacoco'
id 'org.springframework.boot' version '3.1.5'
id 'io.spring.dependency-management' version '1.1.3'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'com.epages.restdocs-api-spec' version "0.18.2"
id 'org.hidetake.swagger.generator' version '2.18.2'
}
group = 'kr.pickple'
version = '0.0.1'
java {
sourceCompatibility = '17'
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
asciidoctorExt
}
repositories {
mavenCentral()
}
dependencies {
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.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation "com.github.ben-manes.caffeine:caffeine:3.1.8"
implementation 'org.hibernate:hibernate-spatial:6.3.1.Final'
implementation 'org.redisson:redisson-spring-boot-starter:3.23.4'
implementation group: 'org.flywaydb', name: 'flyway-mysql', version: '9.10.2'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
implementation 'io.jsonwebtoken:jjwt-api:0.12.1'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.1'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.1'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.webjars:stomp-websocket:2.3.4'
implementation 'org.webjars:sockjs-client:1.5.1'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'com.epages:restdocs-api-spec-mockmvc:0.18.2'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
ext {
set('snippetsDir', file('build/generated-snippets'))
}
tasks.named('test') {
outputs.dir snippetsDir
useJUnitPlatform()
}
tasks.named('compileJava') {
inputs.files(tasks.named('processResources'))
}
task copySubmodule(type: Copy) {
copy {
from './secret'
include "application.yml"
into 'src/main/resources'
}
copy {
from './secret/local'
include "application-local.yml"
into 'src/main/resources'
}
copy {
from './secret/dev'
include "application-dev.yml"
into 'src/main/resources'
}
copy {
from './secret/prod'
include "application-prod.yml"
into 'src/main/resources'
}
copy {
from './secret/test'
include "application-test.yml"
into 'src/test/resources'
rename("application-test.yml", "application.yml")
}
copy {
from './secret/dev'
include "docker-compose.yml"
into 'deploy/dev'
}
}
jar {
enabled = false
}
asciidoctor {
dependsOn test
inputs.dir snippetsDir
configurations 'asciidoctorExt'
baseDirFollowsSourceFile()
}
openapi3 {
server = "https://dev.pickple.kr"
title = "PICKPLE API 문서"
description = "PICKPLE 서비스의 API 문서입니다."
version = "0.0.1"
outputFileNamePrefix = 'pickple'
outputDirectory = 'build/resources/main/static/docs/'
}
tasks.register('copyDocs') {
dependsOn(':openapi3')
doFirst {
def swaggerUIFile = file("${openapi3.outputDirectory}/openapi3.json")
def securitySchemesContent = " securitySchemes:\n" + \
" APIKey:\n" + \
" type: apiKey\n" + \
" name: Authorization\n" + \
" in: header\n" + \
"security:\n" +
" - APIKey: [] # Apply the security scheme here"
swaggerUIFile.append securitySchemesContent
}
doLast {
delete 'src/main/resources/static/docs/pickple.json'
copy {
from 'build/resources/main/static/docs/pickple.json'
into 'src/main/resources/static/docs/'
}
}
}
bootJar {
dependsOn asciidoctor
dependsOn(':copyDocs')
from("${asciidoctor.outputDir}") {
into 'static/docs'
}
}
jar {
enabled = false
}
jacoco {
toolVersion = '0.8.10'
}
jacocoTestReport {
reports {
xml.required = true
html.required = true
csv.required = false
}
finalizedBy jacocoTestCoverageVerification
}
jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
element = 'BUNDLE'
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.00 //fixme: 테스트 코드 진행 후, 테스트 커버리지 상향 조정
}
}
}
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
sonarqube {
properties {
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', 'programmerstylerteam'
property 'sonar.projectKey', 'Java-and-Script_pickple-back'
property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}
}