Fix deprecation warning in Gradle 8.7 (#1056)

This commit is contained in:
modmuss
2024-02-25 13:31:58 +00:00
committed by GitHub
parent 297b7f90e9
commit 3085bcfb56
2 changed files with 3 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ public interface ArtifactRef {
public void applyToConfiguration(Project project, Configuration configuration) {
final DependencyHandler dependencies = project.getDependencies();
Dependency dep = dependencies.module(artifact.getModuleVersion() + (artifact.getClassifier() == null ? "" : ':' + artifact.getClassifier())); // the owning module of the artifact
Dependency dep = dependencies.create(artifact.getModuleVersion() + (artifact.getClassifier() == null ? "" : ':' + artifact.getClassifier())); // the owning module of the artifact
if (dep instanceof ModuleDependency moduleDependency) {
moduleDependency.setTransitive(false);

View File

@@ -143,10 +143,10 @@ public abstract class MigrateMappingsTask extends AbstractLoomTask {
project.getLogger().info("Could not locate mappings, presuming V2 Yarn");
try {
files = project.getConfigurations().detachedConfiguration(project.getDependencies().module(ImmutableMap.of("group", "net.fabricmc", "name", "yarn", "version", mappings, "classifier", "v2"))).resolve();
files = project.getConfigurations().detachedConfiguration(project.getDependencies().create(ImmutableMap.of("group", "net.fabricmc", "name", "yarn", "version", mappings, "classifier", "v2"))).resolve();
} catch (GradleException ignored2) {
project.getLogger().info("Could not locate mappings, presuming V1 Yarn");
files = project.getConfigurations().detachedConfiguration(project.getDependencies().module(ImmutableMap.of("group", "net.fabricmc", "name", "yarn", "version", mappings))).resolve();
files = project.getConfigurations().detachedConfiguration(project.getDependencies().create(ImmutableMap.of("group", "net.fabricmc", "name", "yarn", "version", mappings))).resolve();
}
}