-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
137 lines (115 loc) · 4.12 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
import org.asciidoctor.gradle.jvm.AsciidoctorTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
val kotlinVersion = "1.7.22"
id("org.springframework.boot") version "3.0.2"
id("io.spring.dependency-management") version "1.1.0"
id("org.asciidoctor.jvm.convert") version "3.3.2"
kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
kotlin("plugin.jpa") version kotlinVersion
kotlin("kapt") version kotlinVersion
idea
}
val snippetsDir by extra { file("build/generated-snippets") }
group = "com.example"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
val testContainerVersion = "1.17.6"
dependencyManagement {
imports {
mavenBom("org.testcontainers:testcontainers-bom:$testContainerVersion")
}
}
val asciidoctorExt by configurations.creating
dependencies {
implementation("com.github.f4b6a3:ulid-creator:5.1.0")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation ("org.jetbrains.kotlin:kotlin-reflect:1.7.22")
//database
implementation("org.mariadb.jdbc:mariadb-java-client")
//querydsl
implementation("com.querydsl:querydsl-jpa:5.0.0:jakarta")
kapt("com.querydsl:querydsl-apt:5.0.0:jakarta")
kapt("org.springframework.boot:spring-boot-configuration-processor")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
implementation("io.jsonwebtoken:jjwt-impl:0.11.5")
implementation("io.jsonwebtoken:jjwt-gson:0.11.5")
//test
testImplementation("com.h2database:h2")
testImplementation ("io.mockk:mockk-jvm:1.13.3")
testImplementation("com.ninja-squad:springmockk:4.0.0")
testImplementation("org.springframework.boot:spring-boot-starter-test"){exclude(module="mockito-core")}
testImplementation("org.springframework.security:spring-security-test")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc:3.0.0")
// testImplementation("org.springframework.restdocs:spring-restdocs-core")
asciidoctorExt("org.springframework.restdocs:spring-restdocs-asciidoctor:3.0.0")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
allOpen {
annotation("jakarta.persistence.Entity")
annotation("jakarta.persistence.MappedSuperclass")
annotation("jakarta.persistence.Embeddable")
annotation("org.springframework.stereotype.Component")
}
noArg {
annotation("jakarta.persistence.Entity")
annotation("jakarta.persistence.MappedSuperclass")
annotation("jakarta.persistence.Embeddable")
annotation("org.springframework.stereotype.Component")
}
idea{
module {
val kaptMain = file("build/generated/source/kapt/main")
sourceDirs.add(kaptMain)
generatedSourceDirs.add(kaptMain)
}
}
tasks.test{
useJUnitPlatform()
testLogging {
setExceptionFormat("full")
setEvents(listOf("started", "skipped", "passed", "failed"))
showStandardStreams=true
}
outputs.dir(snippetsDir)
}
tasks.asciidoctor{
inputs.dir(snippetsDir)
dependsOn(tasks.test)
configurations(asciidoctorExt.name)
sources{include("**/index.adoc") }
baseDirFollowsSourceFile()
}
tasks.register<Copy>("copyDocument"){
doFirst{
delete(file("src/main/resources/static/docs"))
}
from("build/docs/asciidoc")
into("src/main/resources/static/docs")
dependsOn(tasks.asciidoctor)
}
tasks.build{
dependsOn("copyDocument")
}
tasks.bootJar{
dependsOn("copyDocument")
from("${tasks.asciidoctor.get().outputDir}") {
into("BOOT-INF/classes/static/docs")
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
repositories {
mavenCentral()
}