When using Gradle Kotlin DSL we can specify `JavaV...
# gradle
i
When using Gradle Kotlin DSL we can specify
JavaVersion
in
kotlinOptions
and
compileOptions
. I wonder what is the difference between
compileOptions
and
kotlinOptions
? When we would use one over another?
Copy code
android {
    //...

    kotlinOptions {
        // "this" is currently lacking a proper type
        // See: <https://youtrack.jetbrains.com/issue/KT-31077>
        val options = this as? KotlinJvmOptions
        options?.jvmTarget = JavaVersion.VERSION_1_8.toString()
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}