-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
220 lines (161 loc) · 5.68 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("java-library")
id("java-test-fixtures")
id("org.springframework.boot") version "3.1.5"
id("io.spring.dependency-management") version "1.0.15.RELEASE"
id("org.asciidoctor.jvm.convert") version "3.3.2"
kotlin("jvm") version "1.9.23"
kotlin("kapt") version "1.9.23"
kotlin("plugin.jpa") version "1.9.23"
kotlin("plugin.spring") version "1.9.23" apply false
kotlin("plugin.lombok") version "1.9.23"
id("io.freefair.lombok") version "8.1.0"
}
allprojects {
group = "com.pawith"
version = "0.0.1"
repositories {
mavenCentral()
}
apply {
plugin("kotlin")
plugin("kotlin-kapt")
plugin("kotlin-spring")
plugin("org.jetbrains.kotlin.plugin.spring")
plugin("org.jetbrains.kotlin.plugin.lombok")
plugin("org.jetbrains.kotlin.plugin.jpa")
plugin("org.springframework.boot")
plugin("io.spring.dependency-management")
plugin("org.asciidoctor.jvm.convert")
plugin("java-test-fixtures")
plugin("io.freefair.lombok")
from("$rootDir/gradle/customplugin/gradleutils.gradle.kts")
from("$rootDir/gradle/spring.gradle.kts")
from("$rootDir/gradle/test.gradle.kts")
}
springBoot {
mainClass = "com.pawith.ApiModuleApplication"
}
val asciidoctorExt = configurations.create("asciidoctorExt")
// Querydsl 설정부 추가 - start
val generated = file("${buildDir}src/main/generated")
tasks.withType<JavaCompile> {
sourceCompatibility = "17"
targetCompatibility = "17"
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}
kapt {
keepJavacAnnotationProcessors = true
}
dependencies {
// retryable
implementation("org.springframework.retry:spring-retry")
//AWS S3
implementation("org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE")
// kotlin json serial/deserial
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
// restdocs
asciidoctorExt("org.springframework.restdocs:spring-restdocs-asciidoctor")
implementation("org.springframework.restdocs:spring-restdocs-mockmvc")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
testFixturesImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
// lombok
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
// fcm
implementation("com.google.firebase:firebase-admin:9.2.0")
// expire map
implementation("net.jodah:expiringmap:0.5.11")
// Feign
implementation("io.github.openfeign:feign-httpclient:12.1")
implementation("org.springframework.cloud:spring-cloud-starter-openfeign:4.0.3")
// JWT
implementation("io.jsonwebtoken:jjwt-api:0.12.5")
implementation("io.jsonwebtoken:jjwt-impl:0.12.5")
implementation("io.jsonwebtoken:jjwt-jackson:0.12.5")
//OAuth
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
// webclinet
implementation("org.springframework.boot:spring-boot-starter-webflux")
// configuration properties
implementation("org.springframework.boot:spring-boot-configuration-processor")
// aop
implementation("org.springframework.boot:spring-boot-starter-aop")
// querydsl
implementation("com.querydsl:querydsl-jpa:5.1.0:jakarta")
kapt("com.querydsl:querydsl-apt:5.1.0:jakarta")
kapt("jakarta.annotation:jakarta.annotation-api")
kapt("jakarta.persistence:jakarta.persistence-api")
}
dependencyManagement {
imports {
mavenBom("org.springframework.modulith:spring-modulith-bom:1.0.2")
}
}
// RestDocs 설정
val snippetsDir = file("build/generated-snippets")
tasks {
test {
outputs.dir(snippetsDir)
useJUnitPlatform()
}
asciidoctor {
configurations("asciidoctorExt")
baseDirFollowsSourceFile()
inputs.dir(snippetsDir)
dependsOn(test)
}
}
// tasks.register("copySnippets", Copy) {
// if (project.name != 'Api-Module') {
// dependsOn(tasks.test)
// from(snippetsDir)
// into(rootProject.file("Api-Module/build/generated-snippets"))
// }
// }
//
// build {
// dependsOn(tasks.copySnippets)
// }
//
// if (project.name == 'Api-Module') {
// asciidoctor {
// configurations("asciidoctorExtensions")
// inputs.dir(snippetsDir)
// baseDirFollowsSourceFile()
// }
//
// tasks.register("generateRestDocs", Copy) {
// dependsOn(asciidoctor)
// from file("build/docs/asciidoc")
// into file("src/main/resources/static/docs")
// }
// }
// querydsl QClass 파일 생성 위치를 지정
tasks.withType<JavaCompile> {
options.generatedSourceOutputDirectory.set(generated)
}
// kotlin source set 에 querydsl QClass 위치 추가
sourceSets {
main {
kotlin.srcDirs += generated
}
}
// gradle clean 시에 QClass 디렉토리 삭제
tasks.named("clean") {
doLast {
generated.deleteRecursively()
}
}
kapt{
generateStubs = true
}
}