-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
118 lines (91 loc) · 3.87 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
118 lines (91 loc) · 3.87 KB
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
import io.swagger.v3.oas.annotations.servers.Server
import io.swagger.v3.oas.models.info.Contact
import org.gradle.internal.impldep.org.bouncycastle.asn1.x500.style.RFC4519Style.title
plugins {
id("org.asciidoctor.jvm.convert") version "3.3.2"
id("com.epages.restdocs-api-spec") version "0.18.2"
}
buildscript {
// 2. ext 블록 대신에 extra.properties를 사용합니다.
extra["restdocsApiSpecVersion"] = "0.18.2"
}
extra["snippetsDir"] = file("build/generated-snippets")
val asciidoctorExt: Configuration by configurations.creating
val snippetsDir by extra { file("build/generated-snippets") }
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
implementation("org.springframework.boot:spring-boot-starter-jooq")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation(kotlin("stdlib-jdk8"))
implementation("org.springframework.boot:spring-boot-starter-aop")
implementation("io.github.oshai:kotlin-logging-jvm:5.1.0")
runtimeOnly("org.postgresql:postgresql")
runtimeOnly("org.postgresql:r2dbc-postgresql")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(module = "spring-boot-starter-web")
exclude(module = "spring-webmvc")
}
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation("org.springframework.restdocs:spring-restdocs-webtestclient")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("io.mockk:mockk:1.13.2")
//
implementation("com.github.f4b6a3:tsid-creator:5.2.6")
asciidoctorExt("org.springframework.restdocs:spring-restdocs-asciidoctor")
// swagger
// testImplementation("com.epages:restdocs-api-spec-mockmvc:0.18.2") // 3
// https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-webflux-ui
implementation("org.springdoc:springdoc-openapi-starter-webflux-ui:2.5.0")
// https://mvnrepository.com/artifact/com.epages/restdocs-api-spec-webtestclient
// https://mvnrepository.com/artifact/com.epages/restdocs-api-spec
// 제외하지 않으면 mvc 관련 라이브러리가 같이 포함된다. 때문에 webhandler가 없다는 에러가 발생한다.
implementation("com.epages:restdocs-api-spec:0.19.2") {
exclude(module = "spring-boot-starter-web")
exclude(module = "spring-webmvc")
}
implementation("com.epages:restdocs-api-spec-webtestclient:0.19.2") {
exclude(module = "spring-boot-starter-web")
exclude(module = "spring-webmvc")
}
}
tasks.asciidoctor {
inputs.dir(snippetsDir)
sourceDir("src/test/resources/api")
configurations(asciidoctorExt.name)
dependsOn(tasks.test)
baseDirFollowsSourceFile()
doFirst {
delete {
file("src/main/resources/static/docs")
}
}
}
tasks.register("copyHtml", Copy::class) {
dependsOn(tasks.asciidoctor)
from(file("build/docs/asciidoc/"))
into(file("src/main/resources/static/docs"))
}
tasks.build {
dependsOn(tasks.getByName("copyHtml"))
}
tasks.bootJar {
dependsOn(tasks.asciidoctor)
dependsOn(tasks.getByName("copyHtml"))
}
// OpenAPI Generator 플러그인 확장을 가져와서 사용한다.
openapi3.apply {
// Server 설정
setServer("http://production-api-server-url.com")
// 기타 설정
// outputFileNamePrefix = "openapi"
title = "Post Service API"
description = "Post Service API description"
version = "1.0.0"
format = "yaml"
outputDirectory = "build/resources/main/static/docs"
}