// Builds one Minecraft version from the shared src/. Stonecutter runs this for each version in // stonecutterVersions (settings.gradle.kts), with that version's versions//gradle.properties. plugins { id("net.fabricmc.fabric-loom-remap") `maven-publish` } val minecraftVersion = property("minecraft_version") as String 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") mappings("net.fabricmc:yarn:${property("yarn_mappings")}:v2") 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 minecraftVersion, "loader_version" to loaderVersion, ) inputs.properties(values) filteringCharset = "UTF-8" filesMatching("fabric.mod.json") { expand(values) } } tasks.withType().configureEach { options.release = 21 } java { // Loom attaches the sources jar to remapSourcesJar and build. withSourcesJar() sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21 } tasks.jar { val archivesName = base.archivesName inputs.property("archivesName", archivesName) from("LICENSE") { rename { "${it}_${archivesName.get()}" } } from(project(":common").extensions.getByType()["main"].output) duplicatesStrategy = DuplicatesStrategy.EXCLUDE } publishing { publications { create("mavenJava") { artifactId = property("archives_base_name") as String from(components["java"]) } } }