Skip to content

Commit

Permalink
Fix RemapJar producing broken jars if any copy spec is provided to th…
Browse files Browse the repository at this point in the history
…e underlying Jar task (#219)
  • Loading branch information
shartte authored Jan 4, 2025
1 parent 1a81e72 commit 4f88afa
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package net.neoforged.moddevgradle.legacyforge.tasks;

import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import javax.inject.Inject;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.RegularFileProperty;
Expand Down Expand Up @@ -33,10 +35,17 @@ public abstract class RemapJar extends Jar {
protected abstract ExecOperations getExecOperations();

@Inject
public RemapJar() {}
public RemapJar() {
getRemapOperation().getLogFile().set(new File(getTemporaryDir(), "console.log"));
}

@TaskAction
public void remap() throws IOException {
getRemapOperation().execute(getExecOperations(), getInput().getAsFile().get(), getArchiveFile().get().getAsFile(), getLibraries());
@Override
public void copy() {
try {
getRemapOperation().execute(getExecOperations(), getInput().getAsFile().get(), getArchiveFile().get().getAsFile(), getLibraries());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
}

0 comments on commit 4f88afa

Please sign in to comment.