forked from prgrms-be-devcourse/BE-03-BlackDogBucks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
180 lines (141 loc) · 4.8 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
buildscript {
ext {
queryDslVersion = "5.0.0"
}
}
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.7'
id 'io.spring.dependency-management' version '1.1.0'
id "org.asciidoctor.jvm.convert" version "3.3.2" // restdocs
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10" // querydsl
}
group = 'com.prgrms'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
asciidoctorExt
}
repositories {
mavenCentral()
}
ext {
set('snippetsDir', file("build/generated-snippets"))
// set('snippetsDir', file("src/docs/snipets"))
queryDslVersion = "5.0.0"
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
// Apache Commons Lang
implementation 'org.apache.commons:commons-lang3:3.0'
// jdbc
implementation 'org.springframework.data:spring-data-jdbc'
implementation("com.google.guava:guava:31.1-jre")
implementation 'commons-validator:commons-validator:1.7'
// p6spy
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.1'
// querydsl
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}"
implementation "com.querydsl:querydsl-apt:${queryDslVersion}"
// lombok
testCompileOnly 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
// mapstruct
implementation 'org.mapstruct:mapstruct:1.5.3.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final'
// lombok 에서 mapstruct binding 해주는 기능
annotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
// mysql
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'org.springframework.security:spring-security-test'
// https://mvnrepository.com/artifact/org.hibernate/hibernate-spatial
implementation 'org.hibernate:hibernate-spatial'
//https://mvnrepository.com/artifact/org.locationtech.jts/jts-core
implementation 'org.locationtech.jts:jts-core:1.19.0'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '4.9.0'
runtimeOnly 'com.h2database:h2'
// jwt
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
//faker data
implementation 'net.datafaker:datafaker:1.7.0'
}
// ---- querydsl 설정
// querydsl 사용할 경로 지정. 현재 지정한 부분은 .gitignore 에 포함되므로 git 에 올라가지 않는다.
def querydslDir = "$buildDir/generated/'querydsl'"
querydsl { // JPA 사용여부 및 사용 경로 설정
jpa = true
querydslSourcesDir = querydslDir
}
sourceSets { // build시 사용할 sourceSet 추가 설정
main.java.srcDir querydslDir
}
compileQuerydsl { // querydsl 컴파일 시 사용할 옵션 설정
options.annotationProcessorPath = configurations.querydsl
}
// querydsl이 compileClassPath를 상속하도록 설정
configurations {
compileOnly {
extendsFrom annotationProcessor
}
querydsl.extendsFrom compileClasspath
}
compileQuerydsl.doFirst {
if (file(querydslDir).exists()) delete(file(querydslDir))
}
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl
}
// gradle clean 시에 QClass 디렉토리 삭제
clean {
delete file(querydslDir)
}
// ---- querydsl 설정 끝
test {
useJUnitPlatform()
outputs.dir snippetsDir
}
tasks.named('test') {
outputs.dir snippetsDir
useJUnitPlatform()
}
tasks.named('asciidoctor') {
inputs.dir snippetsDir
dependsOn test
}
asciidoctor {
dependsOn test
inputs.dir snippetsDir
configurations 'asciidoctorExt'
}
asciidoctor.doFirst {
delete file('src/main/resources/static/docs')
}
task copyDocument(type: Copy) {
dependsOn asciidoctor
from file("build/docs/asciidoc")
into file("src/main/resources/static/docs")
}
build {
dependsOn copyDocument
}
bootJar {
dependsOn asciidoctor
copy {
from "${asciidoctor.outputDir}"
into 'BOOT-INF/classes/static/docs'
}
}