From 3a51777b4bbb9b27bcb5cfd8fc7b0f66660e6f62 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 4 Jul 2021 00:58:09 +0100 Subject: Use a detached configuration to add jetbrains annotations to the source remapper classpath. --- .../net/fabricmc/loom/configuration/providers/LaunchProvider.java | 3 +-- src/main/java/net/fabricmc/loom/util/SourceRemapper.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/main/java/net/fabricmc') diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/LaunchProvider.java b/src/main/java/net/fabricmc/loom/configuration/providers/LaunchProvider.java index 980cecf0..ce5320c1 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/LaunchProvider.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/LaunchProvider.java @@ -48,7 +48,6 @@ import net.fabricmc.loom.configuration.RemappedConfigurationEntry; import net.fabricmc.loom.util.Constants; public class LaunchProvider extends DependencyProvider { - public Dependency annotationDependency; public LaunchProvider(Project project) { super(project); @@ -81,7 +80,7 @@ public class LaunchProvider extends DependencyProvider { addDependency(Constants.Dependencies.DEV_LAUNCH_INJECTOR + Constants.Dependencies.Versions.DEV_LAUNCH_INJECTOR, Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES); addDependency(Constants.Dependencies.TERMINAL_CONSOLE_APPENDER + Constants.Dependencies.Versions.TERMINAL_CONSOLE_APPENDER, Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES); - annotationDependency = addDependency(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS, JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME); + addDependency(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS, JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME); postPopulationScheduler.accept(this::writeRemapClassPath); } diff --git a/src/main/java/net/fabricmc/loom/util/SourceRemapper.java b/src/main/java/net/fabricmc/loom/util/SourceRemapper.java index 1e3eb801..ae750c7f 100644 --- a/src/main/java/net/fabricmc/loom/util/SourceRemapper.java +++ b/src/main/java/net/fabricmc/loom/util/SourceRemapper.java @@ -189,9 +189,9 @@ public class SourceRemapper { m.getClassPath().add(extension.getMinecraftMappedProvider().getMappedJar().toPath()); m.getClassPath().add(extension.getMinecraftMappedProvider().getIntermediaryJar().toPath()); - Dependency annotationDependency = extension.getDependencyManager().getProvider(LaunchProvider.class).annotationDependency; - Set files = project.getConfigurations().getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME) - .files(annotationDependency); + Set files = project.getConfigurations() + .detachedConfiguration(project.getDependencies().create(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS)) + .resolve(); for (File file : files) { m.getClassPath().add(file.toPath()); -- cgit