-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
113 lines (92 loc) · 3.2 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "2.7.0"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
id("org.asciidoctor.jvm.convert") version "3.3.2"
kotlin("jvm") version "1.6.10"
kotlin("plugin.spring") version "1.6.10"
kotlin("plugin.jpa") version "1.6.10"
}
fun String.toFile() = file(this)
val snippetsDir = "build/generated-snippets"
val docsResourcesDir = "src/main/resources/static/docs"
val asciidocDir = "build/docs/asciidoc"
val asciidoctorExtensions by configurations.creating
allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.Embeddable")
annotation("javax.persistence.MappedSuperclass")
}
group = "com.jw"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
maven(
url = "https://repo.e-iceblue.com/nexus/content/groups/public/"
)
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("mysql:mysql-connector-java")
implementation("org.springframework.boot:spring-boot-starter-mustache")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.junit.jupiter:junit-jupiter:5.8.2")
implementation("org.springframework.boot:spring-boot-starter-validation")
developmentOnly("org.springframework.boot:spring-boot-devtools")
runtimeOnly("com.h2database:h2")
testImplementation("org.springframework.boot:spring-boot-starter-test")
// jwt
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.11.5")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.5")
// excel
// implementation("e-iceblue:spire.xls.free:5.1.0")
implementation("org.apache.poi:poi:5.2.2")
implementation("org.apache.poi:poi-ooxml:5.2.2")
// test
testImplementation("io.kotest:kotest-runner-junit5:5.3.1")
testImplementation("io.kotest:kotest-assertions-core:5.3.1")
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.1.1")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc:2.0.6.RELEASE")
asciidoctorExtensions("org.springframework.restdocs:spring-restdocs-asciidoctor:2.0.6.RELEASE")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "1.8"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.test {
outputs.dir(snippetsDir.toFile())
}
tasks.clean {
delete(docsResourcesDir.toFile())
}
tasks.asciidoctor {
configurations(asciidoctorExtensions.name)
inputs.dir(snippetsDir.toFile())
dependsOn(tasks.test)
doFirst {
delete(docsResourcesDir.toFile())
}
}
tasks.register<Copy>("copyHTML") {
description = "Copy asciidoc html5 file to static resources"
dependsOn(tasks.asciidoctor)
from(asciidocDir.toFile())
into(docsResourcesDir.toFile())
}
tasks.build {
dependsOn(tasks.getByName("copyHTML"))
}
tasks.bootJar {
dependsOn(tasks.asciidoctor, tasks.getByName("copyHTML"))
}