-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
110 lines (90 loc) · 3.27 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
group = "io.github.MikAoJk"
version = "1.0.0"
val ktorVersion = "3.0.1"
val junitJupiterVersion = "5.11.1"
val logbackVersion = "1.5.8"
val logstashEncoderVersion = "8.0"
val kotlinVersion = "2.0.21"
val jacksonVersion = "2.18.0"
val hikariCPVersion = "6.0.0"
val flywayVersion = "10.18.2"
val otjPgEmbeddedVersion = "1.1.0"
val postgresVersion = "42.7.4"
val ktfmtVersion = "0.44"
val javaVersion = JvmTarget.JVM_21
// transient deps
val commonsCompressVersion = "1.27.1"
plugins {
id("application")
kotlin("jvm") version "2.0.21"
id("com.diffplug.spotless") version "6.25.0"
id("com.gradleup.shadow") version "8.3.3"
}
application {
mainClass.set("io.github.mikaojk.ApplicationKt")
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("io.ktor:ktor-server-cio:$ktorVersion")
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
implementation("io.ktor:ktor-server-swagger:$ktorVersion")
implementation("io.ktor:ktor-server-cors:$ktorVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("com.zaxxer:HikariCP:$hikariCPVersion")
compileOnly("org.flywaydb:flyway-core:$flywayVersion")
implementation("org.flywaydb:flyway-database-postgresql:$flywayVersion")
implementation("org.postgresql:postgresql:$postgresVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoderVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
testImplementation("com.opentable.components:otj-pg-embedded:$otjPgEmbeddedVersion")
constraints {
testImplementation("org.apache.commons:commons-compress:$commonsCompressVersion") {
because("override transient from com.opentable.components:otj-pg-embedded")
}
}
testImplementation("io.ktor:ktor-client-content-negotiation-jvm:$ktorVersion")
}
kotlin {
compilerOptions {
jvmTarget.set(javaVersion)
}
}
tasks {
shadowJar {
archiveBaseName.set("app")
archiveClassifier.set("")
isZip64 = true
manifest {
attributes(
mapOf(
"Main-Class" to "io.github.mikaojk.ApplicationKt",
),
)
}
}
test {
useJUnitPlatform {}
testLogging {
showStandardStreams = true
showStackTraces = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
spotless {
kotlin { ktfmt(ktfmtVersion).kotlinlangStyle() }
check {
dependsOn("spotlessApply")
}
}
}