mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Remove Minecraft libraries from the remap classpath. (#987)
This commit is contained in:
@@ -42,7 +42,6 @@ public final class ContextImplHelper {
|
||||
return new LazyCloseable<>(() -> {
|
||||
try {
|
||||
TinyRemapper tinyRemapper = TinyRemapperHelper.getTinyRemapper(configContext.project(), configContext.serviceManager(), from.toString(), to.toString());
|
||||
tinyRemapper.readClassPath(TinyRemapperHelper.getMinecraftCompileLibraries(configContext.project()));
|
||||
|
||||
for (Path minecraftJar : configContext.extension().getMinecraftJars(MappingsNamespace.INTERMEDIARY)) {
|
||||
tinyRemapper.readClassPath(minecraftJar);
|
||||
|
||||
@@ -196,7 +196,6 @@ public abstract class AbstractMappedMinecraftProvider<M extends MinecraftProvide
|
||||
|
||||
try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(remappedJars.outputJarPath()).build()) {
|
||||
outputConsumer.addNonClassFiles(remappedJars.inputJar());
|
||||
remapper.readClassPath(TinyRemapperHelper.getMinecraftCompileLibraries(getProject()));
|
||||
|
||||
for (Path path : remappedJars.remapClasspath()) {
|
||||
remapper.readClassPath(path);
|
||||
|
||||
@@ -97,7 +97,12 @@ public abstract class RemapJarTask extends AbstractRemapJarTask {
|
||||
super();
|
||||
serviceManagerProvider = BuildSharedServiceManager.createForTask(this, getBuildEventsListenerRegistry());
|
||||
|
||||
getClasspath().from(getProject().getConfigurations().getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME));
|
||||
final Configuration compileClasspath = getProject().getConfigurations().getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME);
|
||||
final Configuration minecraftCompileLibraries = getProject().getConfigurations().getByName(Constants.Configurations.MINECRAFT_COMPILE_LIBRARIES);
|
||||
// Filter out minecraft libraries from the classpath as we are 100% sure they don't play a part in the obfuscation
|
||||
final FileCollection remapClasspath = compileClasspath.filter(file -> !minecraftCompileLibraries.getFiles().contains(file));
|
||||
|
||||
getClasspath().from(remapClasspath);
|
||||
getAddNestedDependencies().convention(true).finalizeValueOnRead();
|
||||
|
||||
Configuration includeConfiguration = getProject().getConfigurations().getByName(Constants.Configurations.INCLUDE);
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
package net.fabricmc.loom.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
@@ -95,11 +94,6 @@ public final class TinyRemapperHelper {
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static Path[] getMinecraftCompileLibraries(Project project) {
|
||||
return project.getConfigurations().getByName(Constants.Configurations.MINECRAFT_COMPILE_LIBRARIES).getFiles()
|
||||
.stream().map(File::toPath).toArray(Path[]::new);
|
||||
}
|
||||
|
||||
private static IMappingProvider.Member memberOf(String className, String memberName, String descriptor) {
|
||||
return new IMappingProvider.Member(className, memberName, descriptor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user