plugins { id "com.github.johnrengelman.shadow" version "7.1.0" } version = rootProject.mod_version+"-"+rootProject.minecraft_version+"-"+new Date().format("yyyy_MM_dd_HH_mm") architectury { platformSetupLoomIde() fabric() } configurations { compileClasspath.extendsFrom common runtimeClasspath.extendsFrom common developmentFabric.extendsFrom common addModJar include.extendsFrom addModJar modImplementation.extendsFrom addModJar } repositories { // Required for ModMenu maven { url "https://maven.terraformersmc.com/" } } def addMod(path, enabled) { if (enabled == "2") dependencies { modImplementation(path) } else if (enabled == "1") dependencies { modCompileOnly(path) } } dependencies { // Fabric loader modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" // Fabric API addModJar(fabricApi.module("fabric-lifecycle-events-v1", rootProject.fabric_api_version)) addModJar(fabricApi.module("fabric-key-binding-api-v1", rootProject.fabric_api_version)) addModJar(fabricApi.module("fabric-networking-api-v1", rootProject.fabric_api_version)) // Mod Menu modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") // Starlight addMod("curse.maven:starlight-521783:${rootProject.starlight_version_fabric}", rootProject.enable_starlight) // Phosphor addMod("curse.maven:phosphor-372124:${rootProject.phosphor_version_fabric}", rootProject.enable_phosphor) // Sodium addMod("curse.maven:sodium-394468:${rootProject.sodium_version}", rootProject.enable_sodium) implementation "org.joml:joml:1.10.2" modImplementation(fabricApi.module("fabric-rendering-data-attachment-v1", rootProject.fabric_api_version)) modImplementation(fabricApi.module("fabric-rendering-fluids-v1", rootProject.fabric_api_version)) // Lithium addMod("maven.modrinth:lithium:${rootProject.lithium_version}", rootProject.enable_lithium) // Iris addMod("maven.modrinth:iris:${rootProject.iris_version}", rootProject.enable_iris) // BCLib addMod("com.github.paulevsGitch:BCLib:${rootProject.bclib_version}", rootProject.enable_bclib) // Immersive Portals /* modImplementation("com.github.qouteall.ImmersivePortalsMod:build:${rootProject.immersive_portals_version}") { exclude(group: "net.fabricmc.fabric-api") transitive(false) } modImplementation("com.github.qouteall.ImmersivePortalsMod:imm_ptl_core:${rootProject.immersive_portals_version}") { exclude(group: "net.fabricmc.fabric-api") transitive(false) } modImplementation("com.github.qouteall.ImmersivePortalsMod:q_misc_util:${rootProject.immersive_portals_version}") { exclude(group: "net.fabricmc.fabric-api") transitive(false) } */ // Toml shadowMe("com.electronwill.night-config:toml:${rootProject.toml_version}") {} common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowMe(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } // Compression common 'org.tukaani:xz:1.9' common 'org.apache.commons:commons-compress:1.21' shadowMe 'org.tukaani:xz:1.9' shadowMe 'org.apache.commons:commons-compress:1.21' } task deleteResources(type: Delete) { delete file("build/resources/main") } processResources { dependsOn(copyCoreResources) dependsOn(copyCommonResources) dependsOn(copyAccessWidener) } runClient { dependsOn(copyCoreResources) dependsOn(copyCommonResources) dependsOn(copyAccessWidener) jvmArgs "-XX:-OmitStackTraceInFastThrow" finalizedBy(deleteResources) } shadowJar { configurations = [project.configurations.shadowMe] relocate 'org.tukaani', 'shaded.tukaani' relocate 'org.apache.commons.compress', 'shaded.apache.commons.compress' relocate 'com.electronwill.nightconfig', 'shaded.electronwill.nightconfig' relocate 'com.seibel.lod.common', 'fabric.com.seibel.lod.common' classifier "dev-shadow" } remapJar { input.set shadowJar.archiveFile dependsOn shadowJar classifier null } jar { classifier "dev" } sourcesJar { def commonSources = project(":common").sourcesJar dependsOn commonSources from commonSources.archiveFile.map { zipTree(it) } } components.java { withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { skip() } } publishing { publications { mavenFabric(MavenPublication) { artifactId = rootProject.archives_base_name + "-" + project.name from components.java } } // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. repositories { // Add repositories to publish to here. } }