Additionally, the provided ksp dependency will be added to all relevant targets.
Automatic Kotlin/Native bundling
Configure shared libraries built from your Kotlin/Native targets to be automatically bundled into the final JAR/AAR.
plugins {
alias(libs.plugins.kni)
}
kotlin {
val linux64 = linuxX64 {
binaries.sharedLib() // define what you need here, like cinterops
}
val androidNative = androidNativeArm64 {
binaries.sharedLib()
}
// linuxX64 .so artifact will
// be added to lib/ directory inside the JAR.
jvm() bundlesNatives listOf(linux64)
androidLibrary {
// androidNativeArm64 .so artifact will
// be added to jniLibs inside the AAR.
bundlesNatives(listOf(androidNative))
}
}
Define optional Kotlin targets
Controlling which Kotlin targets are enabled can be vital for faster development and CI jobs.