-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
93 lines (67 loc) · 1.98 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
import dev.kordex.gradle.plugins.docker.file.*
import dev.kordex.gradle.plugins.kordex.DataCollection
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.shadow)
alias(libs.plugins.detekt)
alias(libs.plugins.kordex.docker)
alias(libs.plugins.kordex.plugin)
}
group = "template"
version = "1.0-SNAPSHOT"
dependencies {
detektPlugins(libs.detekt)
implementation(libs.kotlin.stdlib)
implementation(libs.kx.ser)
// Logging dependencies
implementation(libs.groovy)
implementation(libs.jansi)
implementation(libs.logback)
implementation(libs.logback.groovy)
implementation(libs.logging)
}
kordEx {
// https://github.com/gradle/gradle/issues/31383
kordExVersion = libs.versions.kordex.asProvider()
bot {
// See https://docs.kordex.dev/data-collection.html
dataCollection(DataCollection.Standard)
mainClass = "template.AppKt"
}
i18n {
classPackage = "template.i18n"
translationBundle = "template.strings"
}
}
detekt {
buildUponDefaultConfig = true
config.from(rootProject.files("detekt.yml"))
}
// Automatically generate a Dockerfile. Set `generateOnBuild` to `false` if you'd prefer to manually run the
// `createDockerfile` task instead of having it run whenever you build.
docker {
// Create the Dockerfile in the root folder.
file(rootProject.file("Dockerfile"))
commands {
// Each function (aside from comment/emptyLine) corresponds to a Dockerfile instruction.
// See: https://docs.docker.com/reference/dockerfile/
from("openjdk:21-jdk-slim")
emptyLine()
runShell("mkdir -p /bot/plugins")
runShell("mkdir -p /bot/data")
emptyLine()
copy("build/libs/$name-*-all.jar", "/bot/bot.jar")
emptyLine()
// Add volumes for locations that you need to persist. This is important!
volume("/bot/data") // Storage for data files
volume("/bot/plugins") // Plugin ZIP/JAR location
emptyLine()
workdir("/bot")
emptyLine()
entryPointExec(
"java", "-Xms2G", "-Xmx2G",
"-jar", "/bot/bot.jar"
)
}
}