From a5986251461daa91a940a80a0a7fff0c0f0e703a Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 23 Jan 2022 14:53:07 +0000 Subject: [PATCH] Make DecompilerOptions.getClasspath() an input for GenerateSourcesTask --- .../java/net/fabricmc/loom/task/GenerateSourcesTask.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java b/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java index 9c93e89..c76d41a 100644 --- a/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java +++ b/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java @@ -45,6 +45,7 @@ import org.gradle.api.file.ConfigurableFileCollection; import org.gradle.api.file.RegularFileProperty; import org.gradle.api.provider.Property; 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; @@ -84,6 +85,9 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask { @InputFile public abstract RegularFileProperty getRuntimeJar(); + @InputFiles + public abstract ConfigurableFileCollection getClasspath(); + @Inject public abstract WorkerExecutor getWorkerExecutor(); @@ -95,6 +99,7 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask { this.decompilerOptions = decompilerOptions; getOutputs().upToDateWhen((o) -> false); + getClasspath().from(decompilerOptions.getClasspath()).finalizeValueOnRead(); } @TaskAction @@ -161,7 +166,7 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask { private WorkQueue createWorkQueue(String jvmMarkerValue) { if (!useProcessIsolation()) { return getWorkerExecutor().classLoaderIsolation(spec -> { - spec.getClasspath().from(decompilerOptions.getClasspath()); + spec.getClasspath().from(getClasspath()); }); } @@ -170,7 +175,7 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask { forkOptions.setMaxHeapSize("%dm".formatted(decompilerOptions.getMemory().get())); forkOptions.systemProperty(WorkerDaemonClientsManagerHelper.MARKER_PROP, jvmMarkerValue); }); - spec.getClasspath().from(decompilerOptions.getClasspath()); + spec.getClasspath().from(getClasspath()); }); }