mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-30 05:05:20 -05:00
Decompiler API improvements:
* Fix decompiler tasks getting registered in afterEvaluate * Allow decompilers to add file collections to the forked JVM classpath. * General code cleanup.
This commit is contained in:
@@ -42,11 +42,13 @@ import java.util.stream.Collectors;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.gradle.api.file.ConfigurableFileCollection;
|
||||
import org.gradle.api.file.FileCollection;
|
||||
import org.gradle.api.file.RegularFileProperty;
|
||||
import org.gradle.api.provider.MapProperty;
|
||||
import org.gradle.api.provider.Property;
|
||||
import org.gradle.api.tasks.Input;
|
||||
import org.gradle.api.tasks.InputFile;
|
||||
import org.gradle.api.tasks.InputFiles;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
import org.gradle.workers.WorkAction;
|
||||
import org.gradle.workers.WorkParameters;
|
||||
@@ -87,6 +89,9 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask {
|
||||
@Input
|
||||
public abstract MapProperty<String, String> getOptions();
|
||||
|
||||
@InputFiles
|
||||
public abstract ConfigurableFileCollection getClasspath();
|
||||
|
||||
@Inject
|
||||
public abstract WorkerExecutor getWorkerExecutor();
|
||||
|
||||
@@ -100,6 +105,12 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask {
|
||||
Objects.requireNonNull(getDecompilerConstructor(this.decompiler.getClass().getCanonicalName()),
|
||||
"%s must have a no args constructor".formatted(this.decompiler.getClass().getCanonicalName()));
|
||||
|
||||
FileCollection decompilerClasspath = decompiler.getBootstrapClasspath(getProject());
|
||||
|
||||
if (decompilerClasspath != null) {
|
||||
getClasspath().from(decompilerClasspath);
|
||||
}
|
||||
|
||||
getOutputs().upToDateWhen((o) -> false);
|
||||
getMaxMemory().convention(4096L).finalizeValueOnRead();
|
||||
getOptions().finalizeValueOnRead();
|
||||
@@ -177,6 +188,7 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask {
|
||||
spec.forkOptions(forkOptions -> {
|
||||
forkOptions.setMaxHeapSize("%dm".formatted(getMaxMemory().get()));
|
||||
forkOptions.systemProperty(WorkerDaemonClientsManagerHelper.MARKER_PROP, jvmMarkerValue);
|
||||
forkOptions.bootstrapClasspath(getClasspath());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user