-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
176 lines (137 loc) · 4.95 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
import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
java
id("org.springframework.boot")
id("io.spring.dependency-management")
id("org.asciidoctor.jvm.convert")
}
group = "${property("projectGroup")}"
version = "${property("applicationVersion")}"
java {
sourceCompatibility = JavaVersion.valueOf("VERSION_${property("javaVersion")}")
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
dependencies {
// Spring Web
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
// Data
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
runtimeOnly("com.mysql:mysql-connector-j")
implementation("org.flywaydb:flyway-core")
implementation("org.flywaydb:flyway-mysql")
// Query Builder
implementation("com.querydsl:querydsl-jpa:${property("queryDslVersion")}:jakarta")
annotationProcessor("com.querydsl:querydsl-apt:${property("queryDslVersion")}:jakarta")
annotationProcessor("jakarta.annotation:jakarta.annotation-api")
annotationProcessor("jakarta.persistence:jakarta.persistence-api")
// Redis
implementation("org.springframework.boot:spring-boot-starter-data-redis")
// Cloud Infra
implementation("io.awspring.cloud:spring-cloud-aws-starter:${property("awspringVersion")}")
implementation("io.awspring.cloud:spring-cloud-aws-starter-s3:${property("awspringVersion")}")
// JWT
implementation("io.jsonwebtoken:jjwt-api:${property("jwtTokenVersion")}")
runtimeOnly("io.jsonwebtoken:jjwt-impl:${property("jwtTokenVersion")}")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:${property("jwtTokenVersion")}")
// Swagger
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:${property("swaggerVersion")}")
// Lombok
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
// Guava
implementation("com.google.guava:guava:${property("guavaVersion")}-jre")
// Slack API
implementation("com.slack.api:slack-api-client:${property("slackApiVersion")}")
// p6spy
implementation("com.github.gavlyukovskiy:p6spy-spring-boot-starter:${property("p6spyVersion")}")
// Test
testImplementation("org.springframework.boot:spring-boot-starter-test")
// Spring REST Docs (With MockMvc)
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
// RestAssured (E2E Test)
testImplementation("io.rest-assured:rest-assured:${property("restAssuredVersion")}")
// TestContainers
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.testcontainers:junit-jupiter")
// TestContainers + Flyway(MySQL)
testImplementation("org.testcontainers:mysql")
testImplementation("org.flywaydb.flyway-test-extensions:flyway-spring-test:${property("flywayTestExtensionVersion")}")
// TestContainers + LocalStack
testImplementation("org.testcontainers:localstack:${property("localStackVersion")}")
}
tasks.withType<Test> {
useJUnitPlatform()
}
// QueryDsl QClass
val queryDslTypeDir: String = "src/main/generated"
tasks.withType<JavaCompile>().configureEach {
options.generatedSourceOutputDirectory = file(queryDslTypeDir)
}
sourceSets {
getByName("main").java.srcDirs(queryDslTypeDir)
}
tasks.named("clean") {
doLast {
file(queryDslTypeDir).deleteRecursively()
}
}
// build REST Docs
val asciidoctorExt: Configuration by configurations.creating
dependencies {
asciidoctorExt("org.springframework.restdocs:spring-restdocs-asciidoctor")
}
val snippetsDir: File by extra { file("build/generated-snippets") }
tasks {
test {
outputs.dir(snippetsDir)
}
asciidoctor {
configurations(asciidoctorExt.name)
dependsOn(test)
doFirst {
delete(file("src/main/resources/static/docs"))
}
inputs.dir(snippetsDir)
doLast {
copy {
from("build/docs/asciidoc")
into("src/main/resources/static/docs")
}
}
}
build {
dependsOn(asciidoctor)
}
}
// Copy Submodule
tasks.register<Copy>("copySecret") {
from("./mour-secret")
include("application*.yml")
into("./src/main/resources")
}
tasks.named("processResources") {
dependsOn("copySecret")
}
tasks.named<JavaCompile>("compileJava") {
inputs.files(tasks.named("processResources"))
}
// jar & bootJar
tasks.named<Jar>("jar") {
enabled = false
}
tasks.named<BootJar>("bootJar") {
archiveBaseName = "Mour"
archiveFileName = "Mour.jar"
}