-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
151 lines (121 loc) · 4.26 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "3.2.0"
id("io.spring.dependency-management") version "1.1.4"
id("org.asciidoctor.jvm.convert") version "3.3.2"
kotlin("jvm") version "1.9.20"
kotlin("plugin.spring") version "1.9.20"
kotlin("plugin.jpa") version "1.9.20"
}
group = "kr.galaxyhub"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_17
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
val asciidoctorExt = "asciidoctorExt"
configurations.create(asciidoctorExt) {
extendsFrom(configurations.testImplementation.get())
}
val snippetsDir = file("build/generated-snippets")
val ulidCreatorVersion = "5.2.2"
val kotlinLoggingVersion = "5.1.1"
val jsoupVersion = "1.17.1"
val jjwtVersion = "0.12.3"
val mockkVersion = "1.13.4"
val springMockkVersion = "4.0.2"
val testcontainersVersion = "1.19.3"
val kotestVersion = "5.7.2"
val kotestExtensionSpringVersion = "1.1.3"
dependencies {
// Spring
implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.flywaydb:flyway-core")
implementation("org.flywaydb:flyway-mysql")
implementation("org.jetbrains.kotlin:kotlin-reflect")
// https://mvnrepository.com/artifact/com.github.f4b6a3/ulid-creator
// ULID Creator
implementation("com.github.f4b6a3:ulid-creator:$ulidCreatorVersion")
// Kotlin logging
implementation("io.github.oshai:kotlin-logging-jvm:$kotlinLoggingVersion")
// Jsoup
implementation("org.jsoup:jsoup:$jsoupVersion")
// JWT
implementation("io.jsonwebtoken:jjwt-api:$jjwtVersion")
// DB Connectors
runtimeOnly("com.h2database:h2")
runtimeOnly("com.mysql:mysql-connector-j")
// JWT
runtimeOnly("io.jsonwebtoken:jjwt-impl:$jjwtVersion")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:$jjwtVersion")
// Spring
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
// Mockk
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("io.mockk:mockk-jvm:$mockkVersion")
// Spring Mockk
testImplementation("com.ninja-squad:springmockk:$springMockkVersion")
// Testcontainers
testImplementation("org.testcontainers:testcontainers")
// Kotest
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest.extensions:kotest-extensions-spring:$kotestExtensionSpringVersion")
// Mock Web Server
testImplementation("com.squareup.okhttp3:mockwebserver")
asciidoctorExt("org.springframework.restdocs:spring-restdocs-asciidoctor")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}
tasks.test {
outputs.dir(snippetsDir)
useJUnitPlatform()
}
tasks.asciidoctor {
inputs.dir(snippetsDir)
dependsOn(tasks.test)
configurations(asciidoctorExt)
baseDirFollowsSourceFile()
}
val copyDocument = tasks.register<Copy>("copyDocument") {
description = "생성된 Asciidoc 문서를 resource/static 폴더로 이동"
group = JavaBasePlugin.DOCUMENTATION_GROUP
dependsOn(tasks.asciidoctor)
doFirst {
delete(file("src/main/resources/static/docs"))
}
from(file("build/docs/asciidoc"))
into(file("src/main/resources/static/docs"))
}
tasks.build {
dependsOn(copyDocument)
}
tasks.bootJar {
dependsOn(copyDocument)
}
allOpen {
annotation("jakarta.persistence.Entity")
annotation("jakarta.persistence.Embeddable")
annotation("jakarta.persistence.MappedSuperclass")
}
tasks.jar {
enabled = false
}