Plugins
The kotlinx.rpc
library offers plugins that simplify project configuration by automating repetitive tasks. Specifically, kotlinx.rpc
provides two Gradle plugins:
org.jetbrains.kotlinx.rpc.platform
The org.jetbrains.kotlinx.rpc.platform
plugin is particularly useful for versioning project dependencies. It adds BOM dependency to your project, that specifies proper versions for kotlinx.rpc
dependencies. With this, you can skip specifying versions for each runtime dependency:
Using this plugin with version catalogs, your code can be rewritten like this:
org.jetbrains.kotlinx.rpc.plugin
The org.jetbrains.kotlinx.rpc.plugin
plugin has the same BOM functionality as org.jetbrains.kotlinx.rpc.platform
and it also sets up code generation configurations.
It is useful for multi-project setups where you define your RPC services in one set of subprojects and use in the other. In such a setup, you can add the plugin only to modules with service definitions to save time on building your project.
Kotlin versions earlier than 2.0
If you are using a version of Kotlin prior to 2.0, you must also add the KSP (Kotlin Symbol Processing) Gradle plugin: