-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
84 lines (71 loc) · 2.68 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
val ktor_version: String by project
val kotlin_version: String by project
val logback_version: String by project
plugins {
kotlin("jvm") version "2.0.20"
id("io.ktor.plugin") version "3.0.1"
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.20"
}
group = "org.golfcoder"
version = "0.0.1"
application {
mainClass.set("org.golfcoder.ServerKt")
val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}
repositories {
mavenCentral()
maven("https://jitpack.io") // Needed for katerbase
}
dependencies {
implementation("io.ktor:ktor-server-core-jvm")
implementation("io.ktor:ktor-server-auth-jvm")
implementation("io.ktor:ktor-client-core-jvm")
implementation("io.ktor:ktor-client-cio-jvm")
implementation("io.ktor:ktor-client-content-negotiation-jvm")
implementation("io.ktor:ktor-server-host-common-jvm")
implementation("io.ktor:ktor-server-sessions-jvm")
implementation("io.ktor:ktor-server-status-pages-jvm")
implementation("io.ktor:ktor-server-caching-headers-jvm")
implementation("io.ktor:ktor-server-compression-jvm")
implementation("io.ktor:ktor-server-cors-jvm")
implementation("io.ktor:ktor-server-default-headers-jvm")
implementation("io.ktor:ktor-server-forwarded-header-jvm")
implementation("io.ktor:ktor-server-content-negotiation-jvm")
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm")
implementation("io.ktor:ktor-server-html-builder-jvm")
implementation("io.ktor:ktor-server-netty-jvm")
implementation("ch.qos.logback:logback-classic:$logback_version")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
implementation("com.github.studoverse:katerbase:fa230a827a566b42450aa07ded2d5b2e22dcdf30")
implementation("org.mongodb:mongodb-driver-sync:4.9.0")
implementation("io.sentry:sentry:8.0.0-rc.1")
}
kotlin {
compilerOptions.jvmTarget = JvmTarget.JVM_21
jvmToolchain(21)
}
tasks {
getByName<JavaExec>("run") {
dependsOn(shadowJar)
classpath(shadowJar)
}
shadowJar {
setProperty("archiveFileName", "Server.jar")
isZip64 = true // Our jar files might have more than 65535 classes/files
}
// Copy Server.jar from build folder to root folder so we can delete all other folders
register<Copy>("copyServer") {
dependsOn(shadowJar)
from(file("build/libs/Server.jar"))
into(file("."))
}
register("stage") {
group = "distribution"
dependsOn(getByName("copyServer"))
}
build {
mustRunAfter(clean)
}
}