From 6c5adf63ba83886bd928462656e4939ffa34c18d Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:53:37 +0100 Subject: [PATCH] Don't write empty jarjar metadata --- .../main/java/net/neoforged/gradle/common/tasks/JarJar.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/net/neoforged/gradle/common/tasks/JarJar.java b/common/src/main/java/net/neoforged/gradle/common/tasks/JarJar.java index 15ca2fe82..0c0eb3924 100644 --- a/common/src/main/java/net/neoforged/gradle/common/tasks/JarJar.java +++ b/common/src/main/java/net/neoforged/gradle/common/tasks/JarJar.java @@ -82,7 +82,10 @@ public InheritManifest getManifest() { @TaskAction protected void copy() { this.jarJarCopySpec.from(getIncludedDependencies()); - this.jarJarCopySpec.from(getMetadata()); + if (!createMetadata().jars().isEmpty()) { + // Only copy metadata if not empty. + this.jarJarCopySpec.from(getJarJarMetadataPath().toFile()); + } super.copy(); }