From 1af203b1748681b349bb7f11dbcddc9fdc7a70ee Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Tue, 19 Dec 2023 21:15:11 +0100 Subject: [PATCH] Customize publishing a bit --- build.gradle | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 04fb243..87e8c12 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'net.neoforged.gradleutils' } -group = 'net.neoforged' +group = "net.neoforged" project.version = gradleutils.version jar { @@ -44,3 +44,25 @@ test { assemble.configure { dependsOn shadowJar } + +// This skips the shadowjar from being published as part of the normal publication +components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { + skip() +} + +publishing { + publications { + // This publication only contains the unshaded jar with dependencies in the pom.xml + plain(MavenPublication) { + artifactId = 'apply-parchment' + + from components.java + } + // This publication only contains the shaded standalone jar + bundle(MavenPublication) { + artifactId = 'apply-parchment-bundle' + + project.shadow.component(bundle) + } + } +} \ No newline at end of file