kmp-build-setup
Installation
SKILL.md
KMP Build Setup (Gradle)
Overview
The Kotlin Multiplatform Gradle plugin's kotlin {} block declares targets; from the declared targets it generates a source-set hierarchy (commonMain → intermediate iosMain → leaf iosArm64Main) via the default hierarchy template. Shared code lives in commonMain, platform code in the platform source sets. Requires Kotlin 1.9.20+ (hierarchy template); current line is Kotlin 2.1.x.
When to use
- New or broken
shared/build.gradle.kts - Adding a target (
iosArm64,jvm,js,wasmJs) or a source set - "source set not found" or dependency-wiring issues across commonMain/iosMain
- Configuring the
android {}block forandroidTarget