Make assemble depend on a task instead of adding it to the archives configuration

MSAL

Gradle 9.1 deprecates adding artifacts to the archives configuration, which will fail in Gradle 10. What the declaration does is have assemble build the artifact, so this recipe replaces artifacts { archives x } with tasks.named("assemble") { dependsOn(x) }, as the upgrade guide says. Only tasks and task providers declared in the script, and jar, are replaced. Files, maps and a declaration with a configuration closure are left alone, and so is every script that mentions uploadArchives or otherwise reads the archives configuration, such as sign configurations.archives, since those depend on its artifacts. See the Gradle upgrade guide for more information.

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

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