Following some answers at Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6 I have a Kotlin Gradle DSL script containing
tasks.compileKotlin {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
kotlinOptions {
jvmTarget = "11"
}
}
but after upgrading to Kotlin 1.7.0 I get the exception
Unresolved reference: sourceCompatibility
Unresolved reference: targetCompatibility
It is clear to me they have apparently removed these, as I found it listed at https://kotlinlang.org/docs/whatsnew17.html#changes-in-compile-tasks
My question is, what do I replace it with? How should I ensure to keep compatibility?