From 1abf584c1f91039cccce04f40605c393198e55c9 Mon Sep 17 00:00:00 2001 From: Su5eD Date: Thu, 8 Aug 2024 22:35:37 +0200 Subject: [PATCH] Use JiJ for deps --- build.gradle.kts | 52 ++++++++++-------------------------------------- 1 file changed, 11 insertions(+), 41 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c906887..97d3fd8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,6 @@ import net.fabricmc.loom.util.Constants import net.fabricmc.loom.util.download.Download import net.fabricmc.loom.util.download.DownloadBuilder import net.fabricmc.loom.util.srg.Tsrg2Writer -import net.fabricmc.lorenztiny.TinyMappingsWriter import net.fabricmc.mappingio.MappingReader import net.fabricmc.mappingio.MappingWriter import net.fabricmc.mappingio.adapter.* @@ -21,7 +20,6 @@ plugins { java `maven-publish` id("org.cadixdev.licenser") version "0.6.1" - id("com.github.johnrengelman.shadow") version "8.1.1" id("net.neoforged.gradleutils").version("3.0.0-alpha.10") // Used for mapping tools only, provides TSRG writer on top of mappings-io id("dev.architectury.loom") version "1.6-SNAPSHOT" @@ -52,7 +50,6 @@ license { } val yarnMappings: Configuration by configurations.creating -val shade: Configuration by configurations.creating java { toolchain.languageVersion.set(JavaLanguageVersion.of(21)) @@ -67,21 +64,6 @@ sourceSets { } } -configurations { - implementation { - extendsFrom(shade) - } - - runtimeElements { - setExtendsFrom(setOf()) - - outgoing { - artifacts.clear() - artifact(tasks.shadowJar) - } - } -} - repositories { mavenCentral() maven { @@ -104,9 +86,9 @@ dependencies { neoForge(group = "net.neoforged", name = "neoforge", version = versionForge) yarnMappings(group = "net.fabricmc", name = "yarn", version = versionYarn) - shade("net.minecraftforge:srgutils:0.5.4") - shade("org.ow2.sat4j:org.ow2.sat4j.core:2.3.6") - shade("org.ow2.sat4j:org.ow2.sat4j.pb:2.3.6") + api(include("net.minecraftforge:srgutils:0.5.4")!!) + implementation(include("org.ow2.sat4j:org.ow2.sat4j.core:2.3.6")!!) + implementation(include("org.ow2.sat4j:org.ow2.sat4j.pb:2.3.6")!!) testCompileOnly("org.jetbrains:annotations:23.0.0") // Unit testing for mod metadata @@ -185,26 +167,14 @@ val createTinyMappings by tasks.registering { } tasks { - setOf(jar, shadowJar).forEach { provider -> - provider.configure { - from(createMappings.flatMap { it.outputFile }) { rename { "mappings.tsrg" } } - from(createTinyMappings.map { it.outputs.files.singleFile }) { rename { "mappings/mappings.tiny" } } - manifest.attributes( - "FMLModType" to "LIBRARY", - "Automatic-Module-Name" to "net.fabricmc.loader", - "Implementation-Version" to archiveVersion.get() - ) - } - } - - shadowJar { - configurations = listOf(shade) - relocate("net.minecraftforge.srgutils", "reloc.net.minecraftforge.srgutils") - archiveClassifier.set("full") - } - - assemble { - dependsOn(shadowJar) + jar { + from(createMappings.flatMap { it.outputFile }) { rename { "mappings.tsrg" } } + from(createTinyMappings.map { it.outputs.files.singleFile }) { rename { "mappings/mappings.tiny" } } + manifest.attributes( + "FMLModType" to "LIBRARY", + "Automatic-Module-Name" to "net.fabricmc.loader", + "Implementation-Version" to archiveVersion.get() + ) } }