-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
76 lines (65 loc) · 2.21 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
val baseVersion = findProperty("version.base") ?: ""
val jenkinsBuildNumber = System.getenv("BUILD_NUMBER") ?: "Unknown"
version = "$baseVersion-$jenkinsBuildNumber"
plugins {
id("java")
id("distribution")
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
repositories {
mavenCentral()
maven("https://m2.dv8tion.net/releases/")
maven("https://nexus.sirblobman.xyz/proxy-jitpack/")
}
dependencies {
// JDA (without Opus)
implementation("net.dv8tion:JDA:5.0.2") {
exclude(module = "opus-java")
}
// Other Dependencies
compileOnly("org.jetbrains:annotations:24.1.0") // JetBrains Annotations
implementation("com.github.minndevelopment:emoji-java:6.1.0") // Emoji Handler Fork
implementation("org.mariadb.jdbc:mariadb-java-client:3.4.1") // MariaDB Java Client
implementation("com.github.oshi:oshi-core:6.6.2") // Operating System Hardware Information Core
implementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.23.1") // Log4J SLF4J2 Implementation
implementation("org.yaml:snakeyaml:2.2") // SnakeYAML
}
distributions {
main {
contents {
into("/target") {
from(tasks.named("jar")) // Main Jar File
from(configurations["runtimeClasspath"]) // Dependency Jar Files
}
}
}
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-Xlint:deprecation")
options.compilerArgs.add("-Xlint:unchecked")
}
named<Jar>("jar") {
version = baseVersion
archiveBaseName.set("SlimyBot")
val mainClassName = findProperty("discord.bot.main") ?: "Main"
val manifestDependencies = configurations.runtimeClasspath.get().joinToString(" ") { it.name }
manifest {
attributes["Main-Class"] = mainClassName
attributes["Class-Path"] = manifestDependencies
}
}
named<Tar>("distTar") {
compression = Compression.GZIP
archiveExtension.set("tar.gz")
archiveBaseName.set("SlimyBot")
}
named<Zip>("distZip") {
enabled = false
}
}