From 659f87a0a131f080acc94a106b8f7d81a056982b Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sat, 26 Oct 2024 17:02:24 +0800 Subject: [PATCH] Fix #1740 --- fabric/build.gradle | 7 ++++--- forge/build.gradle | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fabric/build.gradle b/fabric/build.gradle index 1c6ddb6f9..efba53113 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -100,16 +100,17 @@ publishing { publication.artifactId = rootProject.name + "-" + projectName + "-fabric" project.afterEvaluate { def project = project(":" + projectName) - publication.artifact(project.fakeJar) { classifier null } + def normalArtifact, sourceArtifact + publication.artifact(project.fakeJar) { classifier null; normalArtifact = it } def remapSourcesJarTask = project.remapSourcesJar publication.artifact(remapSourcesJarTask) { builtBy remapSourcesJarTask classifier "sources" + sourceArtifact = it } - // Hack to inherit the dependencies without inheriting the artifacts - publication.setArtifacts(publication.artifacts) from components.java + publication.setArtifacts([normalArtifact, sourceArtifact]) } } } diff --git a/forge/build.gradle b/forge/build.gradle index 63a0728be..8f91f7d3f 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -210,15 +210,16 @@ publishing { project.afterEvaluate { def project = project(":" + projectName) remapSrg.inputFile = project.fakeForgeJar.archiveFile - publication.artifact(remapSrg) { classifier null } + def normalArtifact, sourceArtifact + publication.artifact(remapSrg) { classifier null; normalArtifact = it } publication.artifact(remapSrgSourcesJar) { builtBy remapSrgSourcesJar classifier "sources" + sourceArtifact = it } - // Hack to inherit the dependencies without inheriting the artifacts - publication.setArtifacts(publication.artifacts) from components.java + publication.setArtifacts([normalArtifact, sourceArtifact]) } } }