-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbuild.gradle.kts
63 lines (54 loc) · 1.53 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
plugins {
id("org.jetbrains.kotlin.jvm") version "2.0.0"
application
id("com.github.johnrengelman.shadow") version "8.1.1"
}
group = "com.learnspigot"
version = "1.0.0"
repositories {
mavenCentral()
maven("https://repo.flyte.gg/releases")
}
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
implementation("com.google.code.gson:gson:2.8.9")
implementation("net.dv8tion:JDA:5.0.0-beta.12") {
exclude(module = "opus-java")
}
implementation("gg.flyte:neptune:2.4")
// implementation("org.mongodb:mongodb-driver-sync:4.9.0")
implementation("org.litote.kmongo:kmongo:5.1.0")
implementation("io.github.cdimascio:dotenv-kotlin:6.4.1")
implementation("com.github.mlgpenguin:MathEvaluator:2.1.1")
}
application {
mainClass.set("com.learnspigot.bot.MainKt")
}
kotlin {
compilerOptions {
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
}
}
tasks {
shadowJar {
archiveFileName.set("ls-discord-bot.jar")
}
jar {
enabled = false // Disable the standard JAR task
}
build {
dependsOn(shadowJar)
}
withType<JavaExec> {
doFirst {
val fileName = ".env"
if (!file(fileName).exists()) return@doFirst
file(fileName).forEachLine {
val variable = it.replace("\"", "").split("=", limit = 2)
if (variable.size > 1) {
environment(variable[0], variable[1])
}
}
}
}
}