diff --git a/src/main/java/net/fabricmc/loom/providers/LaunchProvider.java b/src/main/java/net/fabricmc/loom/providers/LaunchProvider.java index 3697874..8c001d6 100644 --- a/src/main/java/net/fabricmc/loom/providers/LaunchProvider.java +++ b/src/main/java/net/fabricmc/loom/providers/LaunchProvider.java @@ -40,15 +40,12 @@ import java.util.stream.Collectors; import org.apache.commons.io.FileUtils; import org.gradle.api.Project; -import org.gradle.api.artifacts.Dependency; import net.fabricmc.loom.util.Constants; import net.fabricmc.loom.util.DependencyProvider; import net.fabricmc.loom.util.RemappedConfigurationEntry; public class LaunchProvider extends DependencyProvider { - public Dependency annotationDependency; - public LaunchProvider(Project project) { super(project); } @@ -80,7 +77,7 @@ public class LaunchProvider extends DependencyProvider { addDependency(Constants.Dependencies.DEV_LAUNCH_INJECTOR + Constants.Dependencies.Versions.DEV_LAUNCH_INJECTOR, "runtimeOnly"); addDependency(Constants.Dependencies.TERMINAL_CONSOLE_APPENDER + Constants.Dependencies.Versions.TERMINAL_CONSOLE_APPENDER, "runtimeOnly"); - annotationDependency = addDependency(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS, "compileOnly"); + addDependency(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS, "compileOnly"); postPopulationScheduler.accept(this::writeRemapClassPath); } diff --git a/src/main/java/net/fabricmc/loom/util/DependencyProvider.java b/src/main/java/net/fabricmc/loom/util/DependencyProvider.java index 10da342..d1b19e7 100644 --- a/src/main/java/net/fabricmc/loom/util/DependencyProvider.java +++ b/src/main/java/net/fabricmc/loom/util/DependencyProvider.java @@ -67,12 +67,12 @@ public abstract class DependencyProvider { addDependency(object, "compile"); } - public Dependency addDependency(Object object, String target) { + public void addDependency(Object object, String target) { if (object instanceof File) { object = project.files(object); } - return project.getDependencies().add(target, object); + project.getDependencies().add(target, object); } public void register(LoomDependencyManager dependencyManager) { diff --git a/src/main/java/net/fabricmc/loom/util/SourceRemapper.java b/src/main/java/net/fabricmc/loom/util/SourceRemapper.java index c0750b0..d058675 100644 --- a/src/main/java/net/fabricmc/loom/util/SourceRemapper.java +++ b/src/main/java/net/fabricmc/loom/util/SourceRemapper.java @@ -30,19 +30,16 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.function.Consumer; import org.cadixdev.lorenz.MappingSet; import org.cadixdev.mercury.Mercury; import org.cadixdev.mercury.remapper.MercuryRemapper; import org.gradle.api.Project; -import org.gradle.api.artifacts.Dependency; import org.zeroturnaround.zip.ZipUtil; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.providers.MappingsProvider; -import net.fabricmc.loom.providers.LaunchProvider; import net.fabricmc.loom.util.progress.ProgressLogger; import net.fabricmc.lorenztiny.TinyMappingsReader; import net.fabricmc.mapping.tree.TinyTree; @@ -179,18 +176,6 @@ 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("compileOnly") - .files(annotationDependency); - - if (files.size() != 1) { - throw new RuntimeException(String.format("Found %d files for the annotations, expected 1", files.size())); - } - - for (File file : files) { - m.getClassPath().add(file.toPath()); - } - m.getProcessors().add(MercuryRemapper.create(mappings)); return m;