Skip to content

Commit

Permalink
Fix use of logger in ZIP inject source (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte authored Dec 24, 2024
1 parent 3a8ca28 commit 3bc7a8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -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());
}
}
}
Expand Down

0 comments on commit 3bc7a8c

Please sign in to comment.