Use compilerOptions instead of kotlinOptions with the kotlin-dsl plugin

MSAL

With the kotlin-dsl plugin 6.7.6 that Gradle 9.8 applies, kotlinOptions { } does not compile. kotlinOptions { freeCompilerArgs = listOf("x") } becomes compilerOptions { freeCompilerArgs.addAll("x") }, which appends to the arguments the plugin needs, as the upgrade guide says. Only a block holding just that assignment, with literal arguments, in a script whose own plugins { } block applies kotlin-dsl, changes. Other options in the block have different types under compilerOptions, so they are left alone. See the Gradle upgrade guide for more information.

org.openrewrite.gradle.migrate.kotlin.UseCompilerOptionsWithKotlinDsl
mod run . --recipe=org.openrewrite.gradle.migrate.kotlin.UseCompilerOptionsWithKotlinDsl

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