Use project(":path") instead of a Project as dependency notation

MSAL

Gradle 9.6 deprecates passing a Project object as a dependency notation, and it will fail in Gradle 10. This recipe replaces a local variable used as a dependency with the project(":path") call that initialized it, which is what the upgrade guide recommends. Only a variable whose initializer is project(":literal") is replaced, so subprojects.each, rootProject and project.parent are left alone, since the path of those isn't known. The variable itself stays, as it may have other uses. See the Gradle upgrade guide for more information.

org.openrewrite.gradle.migrate.artifacts.UseProjectPathForDependencyNotation
mod run . --recipe=org.openrewrite.gradle.migrate.artifacts.UseProjectPathForDependencyNotation

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.