Files
saturnclient/build.gradle.kts
T
selimaj-devandclaude 9ff12d0fd4 Clean up third-party material and add attributions
Remove the third-party cape tool, add the Mojang disclaimer, credits and
NOTICES entries (Apache-2.0 GifDecoder, Inter OFL), and bundle license
texts into the jar.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-09 11:58:08 +02:00

83 lines
2.7 KiB
Kotlin

// Builds one Minecraft version from the shared src/. Stonecutter runs this for each version in
// stonecutterVersions (settings.gradle.kts), with that version's versions/<v>/gradle.properties.
plugins {
id("dev.kikugie.loom-back-compat")
`maven-publish`
}
val minecraftVersion = property("minecraft_version") as String
// The Minecraft versions the jar loads on (fabric.mod.json); a range where hotfixes share a jar.
val minecraftCompat = findProperty("minecraft_compat") as String? ?: minecraftVersion
val javaVersion = if (sc.current.parsed >= "26.1") 25 else 21
val loaderVersion = property("loader_version") as String
version = "${property("mod_version")}+$minecraftVersion"
group = property("maven_group") as String
base {
archivesName = property("archives_base_name") as String
}
dependencies {
minecraft("com.mojang:minecraft:$minecraftVersion")
loomx.applyMojangMappings()
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_api_version")}")
// Saturn's emote library (limb bending, Emotecraft emotes)
include(modImplementation("org.saturnclient:emotes-fabric:${property("emotes_version")}+$minecraftVersion")!!)
implementation(project(":common"))
for (library in listOf(
"dev.selimaj:session-java:0.2.0",
"de.javagl:obj:0.4.0",
"com.formdev:svgSalamander:1.1.4",
"com.fasterxml.jackson.core:jackson-databind:2.17.0",
"com.fasterxml.jackson.core:jackson-annotations:2.17.0",
"com.fasterxml.jackson.core:jackson-core:2.17.0",
)) {
include(implementation(library)!!)
}
}
// Injects the version values into fabric.mod.json.
tasks.processResources {
val values = mapOf(
"version" to project.version.toString(),
"minecraft_version" to minecraftCompat,
"loader_version" to loaderVersion,
"java" to "JAVA_$javaVersion",
)
inputs.properties(values)
filteringCharset = "UTF-8"
filesMatching(listOf("fabric.mod.json", "*.mixins.json")) { expand(values) }
}
tasks.withType<JavaCompile>().configureEach {
options.release = javaVersion
}
java {
// Loom attaches the sources jar to remapSourcesJar and build.
withSourcesJar()
toolchain.languageVersion = JavaLanguageVersion.of(javaVersion)
}
tasks.jar {
from(rootProject.file("licenses")) {
into("licenses")
}
from(project(":common").extensions.getByType<SourceSetContainer>()["main"].output)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = property("archives_base_name") as String
from(components["java"])
}
}
}