Avoid using Project objects as dependency notation

Gradle 9.6 deprecates passing a Project instance as dependency notation,
which currently causes the build to emit deprecation warnings and will
become an error in Gradle 10.

This commit updates AggregatorPlugin to use
DependencyFactory#createProjectDependency instead.

Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>

See gh-51598
This commit is contained in:
Hyunwoo Jung
2026-09-07 12:37:25 +01:00
committed by Andy Wilkinson
parent 03cf0c49ce
commit ceefb553c4
@@ -47,7 +47,8 @@ public class AggregatorPlugin implements Plugin<Project> {
configureAttributes(configuration, aggregate, target.getObjects());
});
target.getRootProject()
.allprojects((project) -> target.getDependencies().add(dependencies.getName(), project));
.allprojects((project) -> target.getDependencies()
.add(dependencies.getName(), project.getDependencyFactory().createProjectDependency()));
aggregate.getFiles()
.convention(aggregated.map((configuration) -> configuration.getIncoming()
.artifactView((view) -> view.setLenient(true))