From aae5b284f3d1624b002bef09b8737bf5961a5901 Mon Sep 17 00:00:00 2001 From: 2008Choco Date: Sat, 17 Feb 2024 09:45:07 -0500 Subject: [PATCH] After much pain, switch to shadow for the fabric module --- build.gradle.kts | 1 + veinminer-fabric/build.gradle.kts | 27 +++++++++++++++++++++------ veinminer-fabric/gradle.properties | 5 ----- 3 files changed, 22 insertions(+), 11 deletions(-) delete mode 100644 veinminer-fabric/gradle.properties diff --git a/build.gradle.kts b/build.gradle.kts index cc72606..ced1cdf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,6 +26,7 @@ subprojects { repositories { mavenCentral() maven { url = uri("http://repo.choco.wtf/releases"); isAllowInsecureProtocol = true } + maven { url = uri("http://repo.choco.wtf/snapshots"); isAllowInsecureProtocol = true } } dependencies { diff --git a/veinminer-fabric/build.gradle.kts b/veinminer-fabric/build.gradle.kts index d8096c2..f0f5f2d 100644 --- a/veinminer-fabric/build.gradle.kts +++ b/veinminer-fabric/build.gradle.kts @@ -1,20 +1,18 @@ plugins { alias(libs.plugins.fabric.loom) + alias(libs.plugins.shadow) } dependencies { - implementation(project(":veinminer-common")) + api(project(":veinminer-common")) + shadow(project(":veinminer-common")) + modApi(libs.choco.networking.fabric) minecraft(libs.minecraft.get()) mappings(loom.officialMojangMappings()) modImplementation(libs.fabric.loader) modImplementation(libs.fabric.api) - modImplementation(libs.choco.networking.fabric) - - include(project(":veinminer-common")) - include(libs.choco.networking.common) - include(libs.choco.networking.fabric) } loom { @@ -34,4 +32,21 @@ tasks { rename { "${it}_${project.name}" } } } + + shadowJar { + configurations = listOf(project.configurations["shadow"], project.configurations["modApi"]) + exclude("META-INF") + + dependencies { + include(project(":veinminer-common")) + include(dependency(libs.choco.networking.common.get())) + include(dependency(libs.choco.networking.fabric.get())) + } + } + + remapJar { + dependsOn("shadowJar") + mustRunAfter("shadowJar") + inputFile.set(shadowJar.get().archiveFile) + } } diff --git a/veinminer-fabric/gradle.properties b/veinminer-fabric/gradle.properties deleted file mode 100644 index 7369d16..0000000 --- a/veinminer-fabric/gradle.properties +++ /dev/null @@ -1,5 +0,0 @@ -minecraft_version=1.20.1 -loader_version=0.14.21 - -#Fabric api -fabric_version=0.84.0+1.20.1