forked from flytegg/ls-discord-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
55 lines (48 loc) · 1.29 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
plugins {
id("org.jetbrains.kotlin.jvm") version "1.7.21"
application
id("com.github.johnrengelman.shadow") version "7.0.0"
}
group = "com.learnspigot"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
implementation("net.dv8tion:JDA:5.0.0-beta.12") {
exclude(module = "opus-java")
}
implementation("com.github.flytegg:neptune:2.2")
implementation("org.mongodb:mongodb-driver-sync:4.9.0")
implementation("io.github.cdimascio:dotenv-kotlin:6.4.1")
}
application {
mainClass.set("com.learnspigot.bot.MainKt")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
build {
dependsOn(shadowJar)
}
jar {
manifest {
attributes["Main-Class"] = application.mainClass
}
}
withType(JavaExec::class) {
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])
}
}
}
}
}