plugins { id "com.github.johnrengelman.shadow" version "7.1.0" } loom { accessWidenerPath.set(project(":common").file("src/main/resources/lod.accesswidener")) } architectury { platformSetupLoomIde() fabric() } configurations { compileClasspath.extendsFrom common runtimeClasspath.extendsFrom common developmentFabric.extendsFrom common } repositories { // Required for ModMenu maven { url "https://maven.terraformersmc.com/" } } dependencies { modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" // TODO: This is only for LodMain, try to find a way to remove it // Fabric API modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" // Mod Menu modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") { exclude(group: "net.fabricmc.fabric-api") } implementation("com.moandjiezana.toml:toml4j:${rootProject.toml_version}") shadowMe("com.moandjiezana.toml:toml4j:${rootProject.toml_version}") { exclude(module: "gson") } common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowMe(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } 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' } // This method copies the access wideners from the common project to the fabric project. And it was generated by Github Copilot task copyAccessWidener(type: Copy) { from project(":common").file("src/main/resources/lod.accesswidener") into file("src/generated/resources") } task copyCoreResources(type: Copy) { from fileTree(project(":core").file("src/main/resources")) into file("build/resources/main") } task deleteResources(type: Delete) { delete file("build/resources/main") } task copyCommonResources(type: Copy) { from fileTree(project(":common").file("src/main/resources")) into file("build/resources/main") } runClient { dependsOn(copyCoreResources) dependsOn(copyCommonResources) finalizedBy(deleteResources) } processResources { dependsOn(copyAccessWidener) inputs.property "version", project.version filesMatching("fabric.mod.json") { expand "version": project.version } } shadowJar { configurations = [project.configurations.shadowMe] relocate 'org.tukaani', 'shaded.tukaani' relocate 'org.apache.commons.compress', 'shaded.apache.commons.compress' relocate 'com.moandjiezana.toml', 'shaded.moandjiezana.toml' 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. } }