As kotlinx.rpc uses Kotlin compiler plugin, we rely on internal functionality that may change over time with any new Kotlin version. To prevent the library from breaking with an incompatible Kotlin version, we use version prefix for artifacts with code generating functionality.
We provide core version updates for all stable versions of the last three major Kotlin releases. So if the last stable Kotlin version is 2.1.10, as at the time of writing this guide, the following versions of Kotlin are supported:
The kotlinx-rpc library is currently not stable. As a result, we cannot guarantee compatibility with all Kotlin versions for our runtime dependencies at this time. However, we are committed to maintaining compatibility as much as possible. It is in our plans to ensure that all runtime dependencies are compatible with all supported Kotlin versions by the time of the stable release.
Project configuration
To simplify project configuration, both our Gradle plugins are able to set proper runtime dependencies versions automatically based on the project's Kotlin version and the Gradle plugin version which is used as a core library version.
plugins {// project's Kotlin pluginkotlin("jvm") version "2.1.10"// kotlinx.rpc pluginid("org.jetbrains.kotlinx.rpc.plugin") version "0.5.1"}
dependencies {// for kotlinx.rpc runtime dependencies,// Gradle plugin sets version 0.5.1implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client")implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server")}
Code generation artifacts
To ensure everything works as intended for all supported Kotlin versions, we provide a separate code-generation artifact for each Kotlin version. For example, if a project has this setup:
plugins {kotlin("jvm") version "2.1.10"id("org.jetbrains.kotlinx.rpc.plugin") version "0.5.1"}
Our Gradle plugin will add these dependencies to all applicable configurations: