Version bump
build / build (push) Successful in 5m37s

This commit is contained in:
ciomek committed 2026-07-25 10:32:35 +02:00
1 parent 5350242f97
commit 2e47df4375
2 files changed
+91 -64

No files matched your search

+72 -40
View File
@@ -1,10 +1,11 @@
import com.smushytaco.lwjgl_gradle.Preset
plugins {
alias(libs.plugins.loom)
alias(libs.plugins.lwjgl)
java
}
val modVersion: Provider<String> = providers.gradleProperty("mod_version")
val lwjglNatives = resolveLwjglNatives()
val modVersion = "${providers.gradleProperty("mod_version").get()}+${libs.versions.bta.get()}"
val modGroup: Provider<String> = providers.gradleProperty("mod_group")
val modName: Provider<String> = providers.gradleProperty("mod_name")
@@ -12,56 +13,48 @@ val javaVersion: Provider<Int> = libs.versions.java.map { it.toInt() }
base.archivesName = modName
group = modGroup.get()
version = modVersion.get()
version = modVersion
loom {
customMinecraftMetadata.set("https://downloads.betterthanadventure.net/bta-client/${libs.versions.btaChannel.get()}/v${libs.versions.bta.get()}/manifest.json")
val btaChannel = libs.versions.btaChannel.get()
val btaVersion = (if (btaChannel == "nightly") "" else "v") + libs.versions.bta.get()
customMinecraftMetadata.set("https://downloads.betterthanadventure.net/bta-client/${btaChannel}/$btaVersion/manifest.json")
}
repositories {
mavenCentral()
maven("https://maven.fabricmc.net/") { name = "Fabric" }
maven("https://maven.thesignalumproject.net/infrastructure") { name = "SignalumMavenInfrastructure" }
maven("https://maven.thesignalumproject.net/releases") { name = "SignalumMavenReleases" }
ivy("https://github.com/Better-than-Adventure") {
patternLayout { artifact("[organisation]/releases/download/[revision]/[module]-bta-[revision].jar") }
metadataSources { artifact() }
}
ivy("https://downloads.betterthanadventure.net/bta-client/${libs.versions.btaChannel.get()}/") {
patternLayout { artifact("/v[revision]/client.jar") }
metadataSources { artifact() }
}
ivy("https://downloads.betterthanadventure.net/bta-server/${libs.versions.btaChannel.get()}/") {
patternLayout { artifact("/v[revision]/server.jar") }
metadataSources { artifact() }
}
maven("https://maven.thesignalumproject.net/nightly") { name = "SignalumMavenNightly" }
ivy("https://piston-data.mojang.com") {
patternLayout { artifact("v1/[organisation]/[revision]/[module].jar") }
metadataSources { artifact() }
}
}
lwjgl {
version = libs.versions.lwjgl
implementation(Preset.MINIMAL_OPENGL)
}
dependencies {
minecraft("::${libs.versions.bta.get()}")
runtimeOnly(libs.clientJar)
// Required at compilation & runtime
// included in builds as a runtime dependency
implementation(libs.loader)
// If you do not need Halplibe you can comment out or delete this line.
implementation(libs.halplibe)
implementation(libs.modMenu)
implementation(libs.legacyLwjgl)
implementation(libs.halplibe) // If you do not need halplibe you can delete this line
implementation(libs.slf4jApi)
implementation(libs.guava)
implementation(libs.log4j.slf4j2.impl)
implementation(libs.log4j.core)
implementation(libs.log4j.api)
implementation(libs.log4j.api12)
implementation(libs.gson)
// Only required at compilation
// provides documentation, can be removed if that isn't needed
compileOnly(libs.bundles.btaLwjgl)
compileOnly(libs.joml)
compileOnly(libs.joml.primitives)
compileOnly(libs.slf4jApi)
implementation(libs.commonsLang3)
include(libs.commonsLang3)
// Only required for development/launch at runtime, won't be part of any builds
localRuntime(libs.modMenu) // Optional, can be removed
runtimeClasspath(libs.clientJar)
val lwjglVer = libs.versions.lwjgl.get()
localRuntime(platform("org.lwjgl:lwjgl-bom:${lwjglVer}"))
localRuntime("org.lwjgl:lwjgl::$lwjglNatives")
localRuntime("org.lwjgl:lwjgl-glfw::$lwjglNatives")
localRuntime("org.lwjgl:lwjgl-openal::$lwjglNatives")
localRuntime("org.lwjgl:lwjgl-opengl::$lwjglNatives")
localRuntime("org.lwjgl:lwjgl-stb::$lwjglNatives")
}
java {
toolchain {
@@ -113,16 +106,55 @@ tasks {
}
processResources {
val resourceMap = mapOf(
"version" to modVersion.get(),
"version" to modVersion,
"fabricloader" to libs.versions.loader.get(),
"halplibe" to libs.versions.halplibe.get(),
"java" to libs.versions.java.get(),
"modmenu" to libs.versions.modMenu.get()
)
// This is needed for gradle to recognize changes
// made to expanded files
inputs.properties(resourceMap)
filesMatching("fabric.mod.json") { expand(resourceMap) }
filesMatching("**/*.mixins.json") { expand(resourceMap.filterKeys { it == "java" }) }
duplicatesStrategy = DuplicatesStrategy.INCLUDE
with(copySpec {
from("src/main/resources/") {
include("fabric.mod.json")
include("*.mixins.json")
expand(resourceMap)
}
})
}
}
// Removes all outdated manifest.json dependencies
configurations.configureEach {
exclude(group = "org.lwjgl.lwjgl")
exclude(group = "net.java.jutils")
exclude(group = "net.java.jinput")
exclude(group = "net.sf.jopt-simple")
exclude(group = "net.minecraft", module = "launchwrapper")
}
fun resolveLwjglNatives(): String { // Sourced from https://www.lwjgl.org/
return Pair(
System.getProperty("os.name")!!,
System.getProperty("os.arch")!!
).let { (name, arch) ->
when {
arrayOf("Linux", "SunOS", "Unit").any { name.startsWith(it) } ->
if (arrayOf("arm", "aarch64").any { arch.startsWith(it) })
"natives-linux${if (arch.contains("64") || arch.startsWith("armv8")) "-arm64" else "-arm32"}"
else
"natives-linux"
arrayOf("Mac OS X", "Darwin").any { name.startsWith(it) } ->
"natives-macos${if (arch.startsWith("aarch64")) "-arm64" else ""}"
arrayOf("Windows").any { name.startsWith(it) } ->
if (arch.contains("64"))
"natives-windows${if (arch.startsWith("aarch64")) "-arm64" else ""}"
else
"natives-windows-x86"
else ->
throw Error("Unrecognized or unsupported platform. Please set \"lwjglNatives\" manually")
}
}
}
// Removes LWJGL2 dependencies
configurations.configureEach { exclude(group = "org.lwjgl.lwjgl") }
+19 -24
View File
@@ -3,60 +3,55 @@
# Plugins
# Check this on https://github.com/FabricMC/fabric-loom/releases/latest/
loom = "1.15-SNAPSHOT"
# Check this on https://plugins.gradle.org/plugin/com.smushytaco.lwjgl3/
lwjglPlugin = "1.0.2"
##########################################################################
# Java Configuration
# The Java version the JDK will be for compiling and running code.
java = "8"
java = "17"
# The Java version the JDK will be for running Gradle.
gradleJava = "21"
##########################################################################
# Mod Dependencies
# Check this on https://downloads.betterthanadventure.net/bta-client/
bta = "7.3_04"
bta = "8.0"
# Options are release, prerelease, nightly, and misc.
btaChannel = "release"
# Check this on https://maven.thesignalumproject.net/#/infrastructure/net/fabricmc/fabric-loader/
loader = "0.18.4-bta.10"
loader = "0.18.4-bta.11"
# Check this on https://github.com/Turnip-Labs/ModMenu/releases/latest/
modMenu = "4.0.0"
modMenu = "5.0.2"
# Check this on https://github.com/Turnip-Labs/bta-halplibe/releases/latest/
halplibe = "5.4.0"
halplibe = "6.1.3+8.0"
# Check this on https://github.com/Better-than-Adventure/legacy-lwjgl3/releases/latest/
legacyLwjgl = "1.0.6"
##########################################################################
# Dependencies
# Check this on https://central.sonatype.com/artifact/org.slf4j/slf4j-api/
slf4jApi = "2.0.17"
# Check this on https://central.sonatype.com/artifact/com.google.guava/guava/
guava = "33.5.0-jre"
# Check this on https://central.sonatype.com/artifact/org.apache.logging.log4j/log4j-api/
log4j = "2.20.0"
# Check this on https://central.sonatype.com/artifact/com.google.code.gson/gson/
gson = "2.13.2"
# Check this on https://central.sonatype.com/artifact/org.apache.commons/commons-lang3/
commonsLang3 = "3.20.0"
# This should match the version used by the current BTA release.
lwjgl = "3.3.3"
joml = "1.10.8" # Note: BTA uses 1.10.7, patch 8 removes the kotlin stdlib dependency
jomlPrimitivess = "1.10.0"
##########################################################################
[libraries]
loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "loader" }
halplibe = { group = "turniplabs", name = "halplibe", version.ref = "halplibe" }
modMenu = { group = "turniplabs", name = "modmenu-bta", version.ref = "modMenu" }
legacyLwjgl = { group = "legacy-lwjgl3", name = "legacy-lwjgl3", version.ref = "legacyLwjgl" }
legacyLwjgl = { group = "com.github.Better-than-Adventure", name = "legacy-lwjgl3", version.ref = "legacyLwjgl" }
slf4jApi = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4jApi" }
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
log4j-slf4j2-impl = { group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version.ref = "log4j" }
log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
log4j-api12 = { group = "org.apache.logging.log4j", name = "log4j-1.2-api", version.ref = "log4j" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
commonsLang3 = { group = "org.apache.commons", name = "commons-lang3", version.ref = "commonsLang3" }
# https://piston-data.mojang.com/v1/objects/43db9b498cb67058d2e12d394e6507722e71bb45/client.jar
clientJar = { group = "objects", name = "client", version = "43db9b498cb67058d2e12d394e6507722e71bb45" }
joml = { group = "org.joml", name = "joml", version.ref = "joml" }
joml-primitives = { group = "org.joml", name = "joml-primitives", version.ref = "jomlPrimitivess" }
lwjgl = { group = "org.lwjgl", name = "lwjgl", version.ref = "lwjgl"}
lwjgl-glfw = { group = "org.lwjgl", name = "lwjgl-glfw", version.ref = "lwjgl"}
lwjgl-openal = { group = "org.lwjgl", name = "lwjgl-openal", version.ref = "lwjgl"}
lwjgl-opengl = { group = "org.lwjgl", name = "lwjgl-opengl", version.ref = "lwjgl"}
lwjgl-stb = { group = "org.lwjgl", name = "lwjgl-stb", version.ref = "lwjgl"}
[bundles]
btaLwjgl = [ "lwjgl", "lwjgl-glfw", "lwjgl-openal", "lwjgl-opengl", "lwjgl-stb", "legacyLwjgl" ]
[plugins]
loom = { id = "net.fabricmc.fabric-loom", version.ref = "loom" }
lwjgl = { id = "com.smushytaco.lwjgl3", version.ref = "lwjglPlugin" }