From a712954be270934855982f71e9f9d194deb2fa63 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 23 Jan 2022 18:26:56 +0000 Subject: [PATCH] Depend on decompilerOptions.getClasspath() build tasks. This doesn't feel necessary but seems to solve it. --- .../java/net/fabricmc/loom/task/GenerateSourcesTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java b/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java index c76d41a..d29fe3b 100644 --- a/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java +++ b/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java @@ -100,6 +100,7 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask { getOutputs().upToDateWhen((o) -> false); getClasspath().from(decompilerOptions.getClasspath()).finalizeValueOnRead(); + dependsOn(decompilerOptions.getClasspath().getBuiltBy()); } @TaskAction @@ -328,8 +329,10 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask { try { //noinspection unchecked return (Constructor) Class.forName(clazz).getConstructor(); - } catch (NoSuchMethodException | ClassNotFoundException e) { + } catch (NoSuchMethodException e) { return null; + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); } } }