Replace kotlinOptions with compilerOptions in Gradle build files

Proprietary

Migrate the deprecated kotlinOptions DSL block to compilerOptions in Gradle build files (Groovy and Kotlin DSL). Renames the block and, in the Kotlin DSL, modernizes the assignments inside it to the Provider-style setters (jvmTarget.set(JvmTarget.JVM_X), freeCompilerArgs.addAll(...)) so the result compiles against the compilerOptions DSL. The kotlinOptions DSL was deprecated in Kotlin 2.0 and removed in Kotlin 2.2.

org.openrewrite.kotlin.migrate.ReplaceKotlinOptionsWithCompilerOptions
mod run . --recipe=org.openrewrite.kotlin.migrate.ReplaceKotlinOptionsWithCompilerOptions

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

Recipe list

It runs these recipes, in this order.

  1. Rename the kotlinOptions block to compilerOptions
  2. Use the jvmTarget provider syntax in Kotlin compilerOptions
  3. Use freeCompilerArgs.addAll(...) in Kotlin compilerOptions