mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
RemapJarTask: Delete output if it exists to prevent ghost files
Fixes FabricMC#1270. This changed isn't necessary for RemapSourcesJarTask as SourceRemapperService already deletes the output.
This commit is contained in:
@@ -318,6 +318,9 @@ public abstract class RemapJarTask extends AbstractRemapJarTask {
|
|||||||
Objects.requireNonNull(tinyRemapperService, "tinyRemapperService");
|
Objects.requireNonNull(tinyRemapperService, "tinyRemapperService");
|
||||||
Objects.requireNonNull(tinyRemapper, "tinyRemapper");
|
Objects.requireNonNull(tinyRemapper, "tinyRemapper");
|
||||||
|
|
||||||
|
// Delete the old file to prevent deleted contents from sticking around in the jar.
|
||||||
|
Files.deleteIfExists(outputFile);
|
||||||
|
|
||||||
try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(outputFile).build()) {
|
try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(outputFile).build()) {
|
||||||
outputConsumer.addNonClassFiles(inputFile);
|
outputConsumer.addNonClassFiles(inputFile);
|
||||||
tinyRemapper.apply(outputConsumer, tinyRemapperService.getOrCreateTag(inputFile));
|
tinyRemapper.apply(outputConsumer, tinyRemapperService.getOrCreateTag(inputFile));
|
||||||
|
|||||||
Reference in New Issue
Block a user