In my Gradle plugin, running on Gradle 8.10.2, I use the following code in order to get the list of first-level dependencies, filtered for ExternalDependency
s.
ResolvedConfiguration resolvedCfg = cfg.getResolvedConfiguration();
Set<ResolvedDependency> deps = resolvedCfg.getFirstLevelModuleDependencies(ExternalDependency.class::isInstance);
This works great! But it gives the following deprecation notice:
warning: [deprecation] getFirstLevelModuleDependencies(Spec<? super Dependency>) in ResolvedConfiguration has been deprecated
In the upgrading notices, it is mentioned that one should use the “ArtifactView API” instead. But this will only get me the files associated with the dependency, not the ResolvedDependency
object with their metadata.
Please advise! How can I make my code Gradle-9-compatible?