From 3bc7a8c2ba950b38e3e2e3519a22ac4014a1257a Mon Sep 17 00:00:00 2001 From: shartte Date: Tue, 24 Dec 2024 16:59:15 +0100 Subject: [PATCH] Fix use of logger in ZIP inject source (#256) --- .../gradle/neoform/runtime/tasks/AbstractInjectSource.java | 3 --- .../gradle/neoform/runtime/tasks/InjectFromZipSource.java | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/neoform/src/main/java/net/neoforged/gradle/neoform/runtime/tasks/AbstractInjectSource.java b/neoform/src/main/java/net/neoforged/gradle/neoform/runtime/tasks/AbstractInjectSource.java index 5b6648296..68193f238 100644 --- a/neoform/src/main/java/net/neoforged/gradle/neoform/runtime/tasks/AbstractInjectSource.java +++ b/neoform/src/main/java/net/neoforged/gradle/neoform/runtime/tasks/AbstractInjectSource.java @@ -49,9 +49,6 @@ public abstract class AbstractInjectSource { */ public abstract void copyTo(ZipOutputStream out) throws IOException; - @Inject - protected abstract Logger getLogger(); - protected final PatternSet createFilter() { PatternSet filter = new PatternSet(); filter.include(getInclusionFilter().get()); diff --git a/neoform/src/main/java/net/neoforged/gradle/neoform/runtime/tasks/InjectFromZipSource.java b/neoform/src/main/java/net/neoforged/gradle/neoform/runtime/tasks/InjectFromZipSource.java index e5409525e..e08db5b1e 100644 --- a/neoform/src/main/java/net/neoforged/gradle/neoform/runtime/tasks/InjectFromZipSource.java +++ b/neoform/src/main/java/net/neoforged/gradle/neoform/runtime/tasks/InjectFromZipSource.java @@ -8,6 +8,8 @@ import org.gradle.api.tasks.PathSensitive; import org.gradle.api.tasks.PathSensitivity; import org.jetbrains.annotations.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.FileInputStream; import java.io.IOException; @@ -23,6 +25,8 @@ * @see InjectZipContent */ public abstract class InjectFromZipSource extends AbstractInjectSource { + private static final Logger LOG = LoggerFactory.getLogger(InjectFromZipSource.class); + @InputFile @PathSensitive(PathSensitivity.NONE) public abstract RegularFileProperty getZipFile(); @@ -56,7 +60,7 @@ public void copyTo(ZipOutputStream out) throws IOException { throw e; } else if (!entry.isDirectory()) { // Warn on duplicate files, but ignore duplicate directories - getLogger().warn("Cannot inject duplicate file {}", entry.getName()); + LOG.warn("Cannot inject duplicate file {}", entry.getName()); } } }