-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
121 lines (98 loc) · 3.35 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "3.2.4"
id("io.spring.dependency-management") version "1.1.4"
id("org.asciidoctor.jvm.convert") version "3.3.2"
id("org.jlleitschuh.gradle.ktlint") version "12.1.0"
id("com.google.cloud.tools.jib") version "3.4.0"
kotlin("jvm") version "1.9.23"
kotlin("plugin.spring") version "1.9.23"
kotlin("plugin.jpa") version "1.9.23"
}
group = "io.ticketaka"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_17
}
jib {
from {
image = "eclipse-temurin:17-jre-focal"
platforms {
platform {
architecture = "${findProperty("jibArchitecture") ?: "amd64"}"
os = "linux"
}
}
}
to {
image = "ticketaka-dev"
tags = setOf("latest", if (project.version.toString().endsWith("-SNAPSHOT")) "snapshot" else project.version.toString())
}
container {
entrypoint = listOf("bash", "-c", "/entrypoint.sh")
ports = listOf("8080")
}
extraDirectories {
setPaths("src/main/docker/jib")
permissions.set(mapOf("/entrypoint.sh" to "755"))
}
}
repositories {
mavenCentral()
}
extra["snippetsDir"] = file("build/generated-snippets")
dependencies {
// spring boot
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-aop")
// spring data jpa
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
// jackson
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
// jwt
implementation("io.jsonwebtoken:jjwt-api:0.12.5")
implementation("io.jsonwebtoken:jjwt-impl:0.12.5")
implementation("io.jsonwebtoken:jjwt-jackson:0.12.5")
// swagger
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2")
// testcontainers
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.testcontainers:mysql")
// h2
runtimeOnly("com.h2database:h2")
// mysql
runtimeOnly("com.mysql:mysql-connector-j")
// tsid
implementation("com.github.f4b6a3:tsid-creator:5.2.6")
// local cache
implementation("org.springframework.boot:spring-boot-starter-cache")
implementation("com.github.ben-manes.caffeine:caffeine")
// monitoring
implementation("org.springframework.boot:spring-boot-starter-actuator")
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
// retry
implementation("org.springframework.retry:spring-retry:2.0.5")
// test
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
testImplementation("org.mockito.kotlin:mockito-kotlin:5.2.1")
testImplementation(kotlin("test"))
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.test {
outputs.dir(project.extra["snippetsDir"]!!)
}
tasks.asciidoctor {
inputs.dir(project.extra["snippetsDir"]!!)
dependsOn(tasks.test)
}