From d91b722c355495ec5d29883e6764fa4ede264cc3 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 21 Jan 2021 20:09:48 +0000 Subject: [PATCH] Another attempt at fixing issues with fernflower's classpath --- .../fernflower/AbstractFernFlowerDecompiler.java | 2 +- .../decompilers/fernflower/ForkingJavaExec.java | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/fabricmc/loom/decompilers/fernflower/AbstractFernFlowerDecompiler.java b/src/main/java/net/fabricmc/loom/decompilers/fernflower/AbstractFernFlowerDecompiler.java index 61dbaf0..ecc1386 100644 --- a/src/main/java/net/fabricmc/loom/decompilers/fernflower/AbstractFernFlowerDecompiler.java +++ b/src/main/java/net/fabricmc/loom/decompilers/fernflower/AbstractFernFlowerDecompiler.java @@ -100,7 +100,7 @@ public abstract class AbstractFernFlowerDecompiler implements LoomDecompiler { progressGroup.started(); ExecResult result = ForkingJavaExec.javaexec( - project.getRootProject().getPlugins().hasPlugin("fabric-loom") ? project.getRootProject() : project, + project, spec -> { spec.setMain(fernFlowerExecutor().getName()); spec.jvmArgs("-Xms200m", "-Xmx3G"); diff --git a/src/main/java/net/fabricmc/loom/decompilers/fernflower/ForkingJavaExec.java b/src/main/java/net/fabricmc/loom/decompilers/fernflower/ForkingJavaExec.java index 4c0e21a..f7e771d 100644 --- a/src/main/java/net/fabricmc/loom/decompilers/fernflower/ForkingJavaExec.java +++ b/src/main/java/net/fabricmc/loom/decompilers/fernflower/ForkingJavaExec.java @@ -47,15 +47,14 @@ public class ForkingJavaExec { }); } - private static Set getForkedFernflowerClasspath(Project project) { + private static Configuration[] getForkedFernflowerClasspath(Project project) { Set allConfigurations = new HashSet<>(); - Project p = project; + allConfigurations.addAll(project.getBuildscript().getConfigurations()); - do { - allConfigurations.addAll(p.getBuildscript().getConfigurations()); - p = p.getRootProject(); - } while (p != p.getRootProject()); + if (project.getRootProject() != project) { + allConfigurations.addAll(project.getRootProject().getBuildscript().getConfigurations()); + } - return allConfigurations; + return allConfigurations.toArray(new Configuration[0]); } }