Background
Gradle 9.x has introduced a number of new deprecations across minor releases (9.1–9.6), documented in the Gradle 9.6 upgrade guide. Several of these are mechanical DSL/API rewrites that are good candidates for OpenRewrite recipes and could be added to org.openrewrite.gradle.MigrateToGradle9.
This issue tracks candidate recipes for the new 9.2–9.6 deprecations.
Already covered in MigrateToGradle9
New recipe candidates (mechanical, good fit)
High value:
Simple removals / renames:
Likely not worth a recipe (semantic / config-order / no clean target)
Background
Gradle 9.x has introduced a number of new deprecations across minor releases (9.1–9.6), documented in the Gradle 9.6 upgrade guide. Several of these are mechanical DSL/API rewrites that are good candidates for OpenRewrite recipes and could be added to
org.openrewrite.gradle.MigrateToGradle9.This issue tracks candidate recipes for the new 9.2–9.6 deprecations.
Already covered in
MigrateToGradle9DependencyUseStringNotationgradle9.OneDependencyDeclarationPerStatementJavaPluginConventionremoval (top-levelsourceCompatibility/targetCompatibility) →gradle9.UseJavaExtensionBlockmainClassName→mainClass→gradle9.UseMainClassProperty(ForApplication)version = { }→ closure form →gradle9.UseVersionClosure*configurations.all→gradle9.RewriteSpreadAllInConfigurationsBlockNew recipe candidates (mechanical, good fit)
High value:
project(":x")(9.3) — replacegroup:name:versionreferring to the current project withproject()notation —gradle9.UseProjectDependencyInsteadOfModuleCoordinates(Gradle 9: recipes for findAll→matching (9.4) and current-project project() notation (9.3) #7989)Projectobject as dependency notation →project(":x")(9.6)DomainObjectCollection.findAll(Closure)→matching(Spec)(9.4) —gradle9.UseMatchingInsteadOfFindAll(Gradle 9: recipes for findAll→matching (9.4) and current-project project() notation (9.3) #7989)RepositoryHandler.flatDir(Map)/mavenCentral(Map)→ action form (9.6)Simple removals / renames:
Dependencies.getProject()→project()(no-arg) (9.4)apply falsein precompiled script plugins → remove (9.4).version(...)in precompiled settings script plugins → remove (9.4)targetJdkproperty → remove (9.6)JavaForkOptions.setAllJvmArgs()→setJvmArgs()/jvmArgs()(9.1)Wrapper.getAvailableDistributionTypes()→Wrapper.DistributionType.values()(9.3)ReportingExtension.file(String)→getBaseDirectory().file(...)(9.1)CreateStartScripts.exitEnvironmentVar→ remove (9.5)Configuration.getTaskDependencyFromProjectDependency()→ remove (9.6)by registering/by extra→ explicitregister(...)(9.6, needs Kotlin DSL support)Likely not worth a recipe (semantic / config-order / no clean target)
Project.getProperties()→providers.gradleProperty(...)(9.6) — needs data-flow analysis; changes laziness semanticsregisterFeaturebefore Java plugin applied / publishing unpublished projects (9.2/9.3)buildNeeded/buildDependents/ IDE file-generation tasks removal (9.6)