From 43e9af3b7206898d9444c19e36f8b896c54a84fd Mon Sep 17 00:00:00 2001 From: Tisawesomeness Date: Wed, 27 Jul 2022 02:11:40 -0400 Subject: [PATCH] Fix fabric build --- bp-fabric/build.gradle | 24 ++++++++++++++++++++++++ bp-spigot/build.gradle | 2 +- gradle.properties | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/bp-fabric/build.gradle b/bp-fabric/build.gradle index 089f672..eb0b29a 100644 --- a/bp-fabric/build.gradle +++ b/bp-fabric/build.gradle @@ -1,7 +1,10 @@ +import net.fabricmc.loom.task.RemapJarTask + plugins { id 'bp-conventions' id 'fabric-loom' version '0.12-SNAPSHOT' id 'maven-publish' + id "com.github.johnrengelman.shadow" version "${shadow_version}" } repositories { @@ -70,3 +73,24 @@ publishing { // retrieving dependencies. } } + +shadowJar { + dependencies { + exclude('net.fabricmc:.*') + include(project(':bp-core')) + exclude '/mappings/*' + } +} + +task remappedShadowJar(type: RemapJarTask) { + dependsOn tasks.shadowJar + input.set(tasks.shadowJar.archiveFile) + addNestedDependencies.set(true) +} + +tasks.assemble.dependsOn tasks.remappedShadowJar + +artifacts { + archives remappedShadowJar + shadow shadowJar +} diff --git a/bp-spigot/build.gradle b/bp-spigot/build.gradle index cbf7860..dda6260 100644 --- a/bp-spigot/build.gradle +++ b/bp-spigot/build.gradle @@ -1,6 +1,6 @@ plugins { id 'bp-conventions' - id 'com.github.johnrengelman.shadow' version '7.1.2' + id "com.github.johnrengelman.shadow" version "${shadow_version}" } repositories { diff --git a/gradle.properties b/gradle.properties index db823b6..0132b4b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,3 +12,5 @@ archives_base_name=betterpreview # Dependencies # check this on https://modmuss50.me/fabric.html fabric_version=0.57.0+1.19 +# Plugin versions +shadow_version=7.1.2 \ No newline at end of file