Skip to content

Commit 3262761

Browse files
Use variables instead of hardcoding version numbers
1 parent a7432dc commit 3262761

File tree

1 file changed

+48
-37
lines changed

1 file changed

+48
-37
lines changed

build.gradle.kts

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ val vaultVersion = "1.7.1"
9393
val levelVersion = "2.21.3"
9494
val placeholderapiVersion = "2.11.7"
9595
val myworldsVersion = "1.19.3-v1"
96+
val awaitilityVersion = "4.2.2"
97+
val mythicDistVersion = "5.9.5"
98+
val multiverseCore5Version = "5.0.0-SNAPSHOT"
99+
val multiverseCore4Version = "4.3.16"
100+
val langUtilsVersion = "3.2.2"
101+
val slimefun4Version = "RC-37"
102+
val itemsAdderVersion = "4.0.2-beta-release-11"
103+
val fancyNpcsVersion = "2.4.4"
104+
val znpcsplusApiVersion = "2.0.0-SNAPSHOT"
105+
val fancyHologramsVersion = "2.4.1"
106+
val commonsLangVersion = "2.6"
107+
val jaxbApiVersion = "2.3.0"
108+
val gsonRecordTypeAdapterFactoryVersion = "0.3.0"
109+
val jdtAnnotationVersion = "2.2.600"
110+
val multilibVersion = "1.1.13"
111+
val oraxenVersion = "1.193.1"
96112

97113
// Store versions in extra properties for resource filtering (used in plugin.yml, config.yml)
98114
extra["java.version"] = javaVersion
@@ -176,59 +192,54 @@ dependencies {
176192
testImplementation("org.junit.jupiter:junit-jupiter-api")
177193
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
178194
testRuntimeOnly("org.junit.platform:junit-platform-launcher:$junitVersion")
179-
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion") // Mocking framework
195+
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion")
180196
testImplementation("org.mockito:mockito-core:$mockitoVersion")
181-
testImplementation("com.github.MockBukkit:MockBukkit:$mockBukkitVersion") // Bukkit mock server
182-
testImplementation("org.awaitility:awaitility:4.2.2") // Async testing helper
183-
testImplementation("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT") // Paper API for tests
197+
testImplementation("com.github.MockBukkit:MockBukkit:$mockBukkitVersion")
198+
testImplementation("org.awaitility:awaitility:$awaitilityVersion")
199+
testImplementation("io.papermc.paper:paper-api:$paperVersion")
184200
testImplementation("com.github.MilkBowl:VaultAPI:$vaultVersion")
185201
testImplementation("me.clip:placeholderapi:$placeholderapiVersion")
186202

187203
// --- Provided/Compile-Only Dependencies: Available at compile time but provided by server ---
188204
// These are NOT shaded into the final JAR (the server provides them at runtime)
189-
//compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT") // Bukkit/Spigot/Paper API
190-
paperweight.paperDevBundle("1.21.10-R0.1-SNAPSHOT")
191-
192-
// Spigot NMS - Used for internal Minecraft code (chunk deletion and pasting)
205+
//compileOnly("io.papermc.paper:paper-api:$paperVersion") // Bukkit/Spigot/Paper API
206+
paperweight.paperDevBundle(paperVersion)
207+
193208
compileOnly("org.spigotmc:spigot:$spigotVersion") {
194-
exclude(group = "org.spigotmc", module = "spigot-api") // Already provided by Paper
209+
exclude(group = "org.spigotmc", module = "spigot-api")
195210
}
196211

197-
// Optional plugins that may be installed on the server
198212
compileOnly("org.mongodb:mongodb-driver:$mongodbVersion")
199-
compileOnly("com.zaxxer:HikariCP:$hikaricpVersion") // Database connection pooling
200-
compileOnly("com.github.MilkBowl:VaultAPI:$vaultVersion") // Economy/permission API
201-
compileOnly("me.clip:placeholderapi:$placeholderapiVersion") // Placeholder API
213+
compileOnly("com.zaxxer:HikariCP:$hikaricpVersion")
214+
compileOnly("com.github.MilkBowl:VaultAPI:$vaultVersion")
215+
compileOnly("me.clip:placeholderapi:$placeholderapiVersion")
202216
compileOnly("com.bergerkiller.bukkit:MyWorlds:$myworldsVersion") {
203217
exclude(group = "org.spigotmc", module = "spigot-api")
204218
}
205-
compileOnly("io.lumine:Mythic-Dist:5.9.5") // Mythic Mobs
206-
compileOnly("org.mvplugins.multiverse.core:multiverse-core:5.0.0-SNAPSHOT")
207-
compileOnly("com.onarandombox.multiversecore:multiverse-core:4.3.16") {
219+
compileOnly("io.lumine:Mythic-Dist:$mythicDistVersion")
220+
compileOnly("org.mvplugins.multiverse.core:multiverse-core:$multiverseCore5Version")
221+
compileOnly("com.onarandombox.multiversecore:multiverse-core:$multiverseCore4Version") {
208222
exclude(group = "org.spigotmc", module = "spigot-api")
209223
}
210-
compileOnly("com.github.apachezy:LangUtils:3.2.2")
211-
compileOnly("com.github.Slimefun:Slimefun4:RC-37") // Slimefun custom items
212-
compileOnly("dev.lone:api-itemsadder:4.0.2-beta-release-11") // ItemsAdder custom items
213-
compileOnly("de.oliver:FancyNpcs:2.4.4") // NPC plugin
214-
compileOnly("lol.pyr:znpcsplus-api:2.0.0-SNAPSHOT") // Alternative NPC plugin
215-
compileOnly("de.oliver:FancyHolograms:2.4.1") // Hologram plugin
216-
compileOnly("world.bentobox:level:2.21.3-SNAPSHOT") // BentoBox Level addon
217-
218-
// Apache Commons Lang - utility library
219-
compileOnly("commons-lang:commons-lang:2.6")
220-
testImplementation("commons-lang:commons-lang:2.6")
224+
compileOnly("com.github.apachezy:LangUtils:$langUtilsVersion")
225+
compileOnly("com.github.Slimefun:Slimefun4:$slimefun4Version")
226+
compileOnly("dev.lone:api-itemsadder:$itemsAdderVersion")
227+
compileOnly("de.oliver:FancyNpcs:$fancyNpcsVersion")
228+
compileOnly("lol.pyr:znpcsplus-api:$znpcsplusApiVersion")
229+
compileOnly("de.oliver:FancyHolograms:$fancyHologramsVersion")
230+
compileOnly("world.bentobox:level:$levelVersion-SNAPSHOT")
231+
232+
compileOnly("commons-lang:commons-lang:$commonsLangVersion")
233+
testImplementation("commons-lang:commons-lang:$commonsLangVersion")
221234

222235
// --- Implementation Dependencies: Shaded into final JAR ---
223-
// These are embedded in the final JAR since they're not commonly available
224-
implementation("org.bstats:bstats-bukkit:$bstatsVersion") // Plugin metrics
225-
implementation("javax.xml.bind:jaxb-api:2.3.0") // XML serialization
226-
implementation("com.github.Marcono1234:gson-record-type-adapter-factory:0.3.0") // JSON serialization
227-
implementation("org.eclipse.jdt:org.eclipse.jdt.annotation:2.2.600") // Nullability annotations
228-
implementation("com.github.puregero:multilib:1.1.13") // Multi-library support
229-
230-
// Oraxen with custom exclusions (embed only what we need)
231-
compileOnly("io.th0rgal:oraxen:1.193.1") {
236+
implementation("org.bstats:bstats-bukkit:$bstatsVersion")
237+
implementation("javax.xml.bind:jaxb-api:$jaxbApiVersion")
238+
implementation("com.github.Marcono1234:gson-record-type-adapter-factory:$gsonRecordTypeAdapterFactoryVersion")
239+
implementation("org.eclipse.jdt:org.eclipse.jdt.annotation:$jdtAnnotationVersion")
240+
implementation("com.github.puregero:multilib:$multilibVersion")
241+
242+
compileOnly("io.th0rgal:oraxen:$oraxenVersion") {
232243
exclude(group = "me.gabytm.util", module = "actions-spigot")
233244
exclude(group = "org.jetbrains", module = "annotations")
234245
exclude(group = "com.ticxo", module = "PlayerAnimator")
@@ -238,7 +249,7 @@ dependencies {
238249
exclude(group = "org.bstats", module = "bstats-bukkit")
239250
exclude(group = "com.jeff-media", module = "custom-block-data")
240251
exclude(group = "com.jeff-media", module = "persistent-data-serializer")
241-
exclude(group = "com.jeff_media", module = "MorePersistentDataTypes")
252+
exclude(group = "com.jeff-media", module = "MorePersistentDataTypes")
242253
exclude(group = "gs.mclo", module = "java")
243254
}
244255
}

0 commit comments

Comments
 (0)