-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
179 lines (147 loc) · 5.14 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
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.4'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id "org.asciidoctor.jvm.convert" version "3.3.2"
id 'jacoco'
}
group = 'com.projectboated'
version = '0.0.1-SNAPSHOT'
ext {
// For Spring Rest Docs
snippetsDir = file('build/generated-snippets')
}
repositories {
mavenCentral()
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
asciidoctorExtensions
}
dependencies {
// Web
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// WebFlux
implementation 'org.springframework.boot:spring-boot-starter-webflux'
// WebSocket
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.springframework.security:spring-security-messaging'
// Cloud
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
// Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'
// Test
testImplementation 'org.mockito:mockito-inline'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
implementation 'com.fasterxml.jackson.core:jackson-databind'
// Database
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'mysql:mysql-connector-java'
testImplementation 'com.h2database:h2'
implementation 'org.flywaydb:flyway-core'
implementation "org.flywaydb:flyway-mysql"
// Thymeleaf
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
// Spring Rest Docs
testImplementation 'org.springframework.restdocs:spring-restdocs-restassured'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
// Utils
implementation 'com.google.guava:guava:31.1-jre'
// Querydsl
implementation 'com.querydsl:querydsl-core'
implementation 'com.querydsl:querydsl-jpa'
annotationProcessor("com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa")
annotationProcessor("jakarta.persistence:jakarta.persistence-api")
annotationProcessor("jakarta.annotation:jakarta.annotation-api")
}
test {
outputs.dir snippetsDir
useJUnitPlatform()
}
// Jacoco 시작
jacoco{
toolVersion = "0.8.8"
}
jacocoTestReport {
dependsOn test
reports {
html.enabled true
xml.enabled false
csv.enabled false
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
// QFile, 테스트 불필요.
"com/projectboated/backend/**/Q*.*",
// Spring MVC 예외관련 테스트, 자동화 테스트가 아닌, 직접 테스트
"com/projectboated/backend/web/exception/**",
// Infra, 자동화 테스트 불가
"com/projectboated/backend/infra/**/*",
// Spring Security : 테스트 작성해야함 (현재 단위 테스트를 어떻게 해야하나 고민중)
"com/projectboated/backend/security/**/*",
// Domain: Project Chatting, 기능을 완성하지 못함
"com/projectboated/backend/project/projectchatting/**"
])
}))
}
}
jacocoTestCoverageVerification {
dependsOn jacocoTestReport
violationRules {
rule {
element = 'CLASS'
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.0
}
}
}
}
// Jacoco 끝
// Spring Rest Docs 시작
asciidoctor {
dependsOn jacocoTestReport
baseDirFollowsSourceDir()
configurations 'asciidoctorExtensions'
inputs.dir snippetsDir
}
asciidoctor.doFirst {
delete file('src/main/resources/static/docs')
}
//task copyDocument(type: Copy) {
// dependsOn asciidoctor
// from file("${asciidoctor.outputDir}")
// into file("src/main/resources/static/docs")
//}
bootJar {
dependsOn asciidoctor
from ("${asciidoctor.outputDir}") {
into 'BOOT-INF/classes/static/docs'
}
}
// Spring Rest Docs 끝
// Compiler 추가 옵션 시작
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
// Graal Compiler setting
//<< "-XX:+UnlockExperimentalVMOptions" << "-XX:+EnableJVMCI" << "-XX:+EnableJVMCI"
}
}
}
// Compiler 추가 옵션 끝