mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-30 21:05:58 -05:00
Use a detached configuration to add jetbrains annotations to the source remapper classpath.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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<File> files = project.getConfigurations().getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME)
|
||||
.files(annotationDependency);
|
||||
Set<File> 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());
|
||||
|
||||
Reference in New Issue
Block a user