From 4be5fe010f118b9b59774fcdee4b57616f507a99 Mon Sep 17 00:00:00 2001 From: asie Date: Sat, 18 May 2019 11:51:34 +0200 Subject: [PATCH] use compileClasspath to remap JARs --- .../java/net/fabricmc/loom/task/RemapJarTask.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java index 7a6c203..e401881 100644 --- a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java +++ b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java @@ -44,8 +44,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; +import java.util.*; public class RemapJarTask extends AbstractLoomTask { private Object input; @@ -68,9 +67,9 @@ public class RemapJarTask extends AbstractLoomTask { String fromM = "named"; String toM = "intermediary"; - List classpathFiles = new ArrayList<>(); - classpathFiles.addAll(project.getConfigurations().getByName(Constants.COMPILE_MODS_MAPPED).getFiles()); - classpathFiles.addAll(project.getConfigurations().getByName(Constants.MINECRAFT_NAMED).getFiles()); + Set classpathFiles = new LinkedHashSet<>(); + //noinspection CollectionAddAllCanBeReplacedWithConstructor + classpathFiles.addAll(project.getConfigurations().getByName("compileClasspath").getFiles()); Path[] classpath = classpathFiles.stream().map(File::toPath).filter((p) -> !input.equals(p)).toArray(Path[]::new); File mixinMapFile = mappingsProvider.MAPPINGS_MIXIN_EXPORT; @@ -85,6 +84,12 @@ public class RemapJarTask extends AbstractLoomTask { project.getLogger().lifecycle(":remapping " + input.getFileName()); + StringBuilder rc = new StringBuilder("Remap classpath: "); + for (Path p : classpath) { + rc.append("\n - ").append(p.toString()); + } + project.getLogger().debug(rc.toString()); + TinyRemapper remapper = remapperBuilder.build(); try (OutputConsumerPath outputConsumer = new OutputConsumerPath(output)) {