Inline applied Gradle scripts

MSAL

Replaces apply from: 'dependencies.gradle' (or apply(from = "dependencies.gradle.kts")) in a build file with the statements of the applied script, moving the script's imports to the top of the build file, and deletes the script once every place applying it was inlined. This leaves dependency declarations in the build file, where the other Gradle recipes can edit them. A script is left alone when inlining could change behavior: when its path cannot be resolved statically, it is applied inside a closure or with to:, it has a top-level return or its own buildscript or plugins block, it declares names that collide with the build file's, it is applied from more than one place, or it is written in a different DSL than the build file.

org.openrewrite.gradle.migrate.scripts.InlineAppliedScript

Optional

The ID of a plugin that applies the other .gradle or .gradle.kts scripts in a project's directory itself, so that no apply from appears in the build file. When a project applies this plugin, those scripts are appended to the end of its build file and deleted.

mod run . --recipe=org.openrewrite.gradle.migrate.scripts.InlineAppliedScript

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