Ensure compatibility with older Kotlin consumers#1770
Conversation
We set the minimum Kotlin version to Kotlin 2.1 as the library uses APIs from this version that do not exist in 2.0. We also: - Configuring JVM target 1.8, Java compatibility, and compiler arguments. - Force JS and Wasm stdlib dependencies to match the toolchain version as work-around for KT-71032 - Reset `coreLibrariesVersion` in `okio-assetfilesystem` for AGP 9+ compatibility. - Apply `build-support` plugin to `okio-nodefilesystem`. TESTED: ./gradlew clean check . I also published to local repository and checked the .module files for the artifacts and the kotlin-stdlib was correctly set to 2.1.21
swankjesse
left a comment
There was a problem hiding this comment.
I like the effect but wow, this requires so much work.
|
Need to use Tapmoc plugin. Much easier. |
Kotlin 2.1.20 does not support 25 JDK target - Update CI java version from 25 to 24. - Set `jvmToolchain(24)` in `BuildSupport.kt` and `samples/build.gradle.kts`. - Refactor `BuildSupport.kt` to configure `KotlinProjectExtension` directly instead of using `afterEvaluate`.
I did not configure for rest of project as the plugin does not add depedencies to kotlin-stdlib correctly for KMP
|
the tapmoc plugin does not work with KMP. I tried it locally, and it adds both the the KGP For now, Ill add the plugin to the samples project (which isn't published), but keep the current behaviour I have |
|
@JakeWharton @swankjesse tests now pass. Jake - if you think tapmoc can still work, I can open it as a feature request issue against the repo. For now, Im hoping itd be fine to merge as is |
|
@JakeWharton Actually, ignore my previous comment. I migrated to Tapmoc, and wow, the code is so much simpler! One caveat: |
f672bbf to
a4a3a0b
Compare
We delegate the build configuration to Tapmoc and set the Kotlin version to 2.1 as the library uses APIs from this version that do not exist in 2.0.
One caveat:
project.configureJavaCompatibility(8)is not used as the code would compile with JDK 8. This will fail asRealBufferedSource.ktuses a Java API not available in Java 8:InputStream.transferTo. To useproject.configureJavaCompatibility, the min supported Java version would need to be bumped to 11TESTED: ./gradlew clean check . I also published to local repository and checked the .module files for the JVM and Android artifacts and the kotlin-stdlib was correctly set to 2.1.21