-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
118 lines (94 loc) · 3.69 KB
/
build.gradle.kts
File metadata and controls
118 lines (94 loc) · 3.69 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
plugins {
id("java-library")
id("com.gradleup.shadow") version "9.3.1"
id("run-hytale")
}
group = findProperty("pluginGroup") as String? ?: "com.eliteessentials"
version = findProperty("pluginVersion") as String? ?: "2.0.5"
description = findProperty("pluginDescription") as String? ?: "Essential commands for Hytale servers"
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.helpch.at/releases")
// Official Hytale Maven repository
maven( "https://maven.hytale.com/release")
maven( "https://maven.hytale.com/pre-release")
// CodeMC Hytale repository (mirrors server JARs)
maven("https://repo.codemc.io/repository/hytale/")
// VaultUnlocked API repository
maven("https://repo.codemc.io/repository/creatorfromhell/") {
name = "VaultUnlocked"
}
}
dependencies {
// Hytale Server API (provided by server at runtime)
val serverVersion = findProperty("serverVersion") as String? ?: "2026.03.26-89796e57b"
compileOnly("com.hypixel.hytale:Server:$serverVersion")
compileOnly("at.helpch:placeholderapi-hytale:1.0.4")
// Luckperms Support
compileOnly("net.luckperms:api:5.4")
// VaultUnlocked - compileOnly since it's provided by server at runtime
compileOnly("net.cfh.vault:VaultUnlocked:2.18.3")
// JSON handling
implementation("com.google.code.gson:gson:2.10.1")
implementation("org.jetbrains:annotations:24.1.0")
// SQL storage support
implementation("com.zaxxer:HikariCP:6.2.1")
implementation("com.h2database:h2:2.3.232")
implementation("com.mysql:mysql-connector-j:9.1.0")
// Test dependencies
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
// Configure server testing
runHytale {
// TODO: Update this URL when Hytale server is available
jarUrl = "https://fill-data.papermc.io/v1/objects/d5f47f6393aa647759f101f02231fa8200e5bccd36081a3ee8b6a5fd96739057/paper-1.21.10-115.jar"
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release = 25
}
processResources {
filteringCharset = Charsets.UTF_8.name()
val props = mapOf(
"group" to project.group,
"version" to project.version,
"description" to project.description,
"serverVersion" to (findProperty("serverVersion") as String? ?: "2026.03.26-89796e57b")
)
inputs.properties(props)
filesMatching("manifest.json") {
expand(props)
}
}
shadowJar {
archiveBaseName.set(rootProject.name)
archiveClassifier.set("")
relocate("com.google.gson", "com.eliteessentials.libs.gson")
relocate("com.zaxxer.hikari", "com.eliteessentials.libs.hikari")
relocate("org.slf4j", "com.eliteessentials.libs.slf4j")
// Note: H2 is NOT relocated because its internal engine uses class name lookups
// and service loaders that break when packages are renamed
relocate("com.mysql", "com.eliteessentials.libs.mysql")
minimize {
// JDBC drivers are loaded via reflection (Class.forName), so the shadow
// plugin can't detect usage. Exclude them from minimization.
exclude(dependency("com.h2database:h2:.*"))
exclude(dependency("com.mysql:mysql-connector-j:.*"))
}
}
test {
useJUnitPlatform()
}
build {
dependsOn(shadowJar)
}
}
java {
toolchain {
val javaVersion = findProperty("java_version")?.toString()?.toInt() ?: 25
languageVersion.set(JavaLanguageVersion.of(javaVersion))
}
}