Migrate to Kotlin 2
ProprietaryMigrate deprecated Kotlin 1.x APIs to their Kotlin 2.x replacements and update Gradle build files for Kotlin 2.x compatibility. Deprecated APIs were deprecated in Kotlin 1.4-1.5 and become errors in Kotlin 2.1.
org. openrewrite. kotlin. migrate. UpgradeToKotlin2mod run . --recipe= org. openrewrite. kotlin. migrate. UpgradeToKotlin2Install 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.
- Replace deprecated String case conversions
- Replace deprecated Char case conversions
- Replace deprecated
appendlnwithappendLine - Replace deprecated
capitalizeanddecapitalize - Replace
Enum.values()withEnum.entries - Replace
enumValues<T>()withenumEntries<T>() - Upgrade Kotlin Gradle plugins to 2.x
- Remove redundant kotlin-stdlib dependencies
- Remove deprecated Kotlin Gradle properties
- Replace
kotlinOptionswithcompilerOptionsin Gradle build files