Matthew Pope
11/17/2021, 1:00 AMapiVersion = "1.3"
and force my tests to use a 1.3.n
version of kotlin-stdlib-jdk
, that should both set and validate that my library will work for consumers using Kotlin 1.3, right? (The relevant excerpts from my build.gradle
file are in the thread so I don’t spam the channel with a wall of build script.)Matthew Pope
11/17/2021, 1:00 AMbuild.gradle
file:
plugins {
id "org.jetbrains.kotlin.jvm" version "1.6.0"
}
ext.kotlin_version = "[1.3,)"
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72"
}
compileKotlin{
kotlinOptions.apiVersion = "1.3"
}
compileTestKotlin {
kotlinOptions.apiVersion = "1.3"
}
Ben Woodworth
11/17/2021, 2:41 AMkotlinOptions.languageVersion = "1.3"
Matthew Pope
11/17/2021, 2:44 AMBen Woodworth
11/17/2021, 3:16 AMBen Woodworth
11/17/2021, 3:20 AMPreferably (but we can't guarantee it), the binary format is mostly forwards compatible with the next feature release, but not later ones (in the cases when new features are not used, e.g. 1.3 can understand most binaries from 1.4, but not 1.5).Writing your library in 1.3 would mean 1.6 projects could use it though:
All binaries are backwards compatible, i.e. a newer compiler can read older binaries (e.g. 1.3 understands 1.0 through 1.2),
mbonnin
11/17/2021, 7:32 AMmbonnin
11/17/2021, 7:32 AMmbonnin
11/17/2021, 7:33 AMJurriaan Mous
11/17/2021, 8:11 AMSupporting previous API versions for a longer period Starting with Kotlin 1.6.0, you can now develop using three previous API versions instead of two (along with the current stable one). Currently, this includes API versions 1.3, 1.4, 1.5, and 1.6.https://blog.jetbrains.com/kotlin/2021/11/kotlin-1-6-0-is-released/
mbonnin
11/17/2021, 8:12 AMmbonnin
11/17/2021, 8:13 AMmbonnin
11/17/2021, 8:14 AMmbonnin
11/17/2021, 3:23 PMmbonnin
11/17/2021, 3:24 PMapiVersion
doesn't look like it sets the metadata to a compatible format. languageVersion
looks like it does thoughMatthew Pope
11/17/2021, 6:31 PMJurriaan Mous
11/18/2021, 9:19 AMBen Woodworth
12/14/2021, 9:18 AM