Getting Started
Requirement
- macOS With Xcode 16 and later
- Using an earlier version of Xcode is possible, but I don't recommend it.
- Kotlin : 2.1.21 and later
- It's always recommended to use the latest version of Kotlin.
- Gradle : 8.12 and later
Plugins
build.gradle.kts
plugins {
id("org.jetbrains.kotlin.multiplatform")
id("io.github.frankois944.spmForKmp") version "[version]"
}
Gradle Properties
Initial Configuration
build.gradle.kts
// List of targets
kotlin {
listOf(
iosArm64(),
iosSimulatorArm64()
// and more Apple targets...
).forEach { target ->
// `cinteropName` is recommended when using a list of native target
// Or when you want to keep the compatibility with the legacy way (cf: [cinteropName])
// If not set, It will take the name of the current Target
target.swiftPackageConfig(cinteropName = "[cinteropName]") {
// create a new directory at `src/swift/[cinteropName]`
}
}
}
// For a single target
kotlin {
iosArm64 {
swiftPackageConfig {
// create a new directory at `src/swift/iosArm64`
}
}
}