Kotlin Gradle plugin contains compileKotlin task which can be configured by apiVersion and languageVersion parameters (doc):
compileKotlin {
kotlinOptions {
freeCompilerArgs = ['-Xjsr305=strict']
jvmTarget = '1.8'
languageVersion = '1.1'
apiVersion = '1.1'
}
}
Both parameters are used for compatibility with older Kotlin versions. Could somebody explain what is the difference between them? And what are use cases using each of them?
apiVersion: Allow to use declarations only from the specified version of bundled libraries
languageVersion: Provide source compatibility with specified language version
You can see full documentation here: https://kotlinlang.org/docs/reference/using-gradle.html
and this reference: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With