Congratulations on creating your new Kotlin Multiplatform library! Follow these steps to customize it.
- Go to Actions tab in your new repository
- Select "Template Customization" workflow
- Click "Run workflow"
- Fill in:
- Package name: e.g.,
com.example.mylibrary - Library name: e.g.,
MyAwesomeLib - Organization: (optional - defaults to your GitHub username/org)
- Package name: e.g.,
- Click "Run workflow"
The workflow will automatically customize all files and commit the changes.
# Clone your new repository
git clone https://github.com/YOUR_ORG/YOUR_REPO.git
cd YOUR_REPO
# Run the customizer script
bash customizer.sh com.example.mylibrary MyAwesomeLib your-org
# Set up git hooks for code quality
bash scripts/setup-hooks.sh
# Commit the changes
git add -A
git commit -m "chore: Initialize library from template"
git push- Update README.md - Replace template descriptions with your library's purpose
- Configure Publishing - Set up GitHub secrets for Maven Central:
MAVEN_CENTRAL_USERNAMEMAVEN_CENTRAL_PASSWORDSIGNING_KEY_IDSIGNING_PASSWORDGPG_KEY_CONTENTS
- Start Coding - Your library code goes in
cmp-library/src/
Your library supports all Kotlin Multiplatform targets:
| Platform | Targets |
|---|---|
| Android | android |
| iOS | iosX64, iosArm64, iosSimulatorArm64 |
| macOS | macosX64, macosArm64 |
| tvOS | tvosX64, tvosArm64, tvosSimulatorArm64 |
| watchOS | watchosX64, watchosArm32, watchosArm64, watchosSimulatorArm64, watchosDeviceArm64 |
| JVM | jvm |
| Linux | linuxX64, linuxArm64 |
| Windows | mingwX64 |
| JavaScript | js (Browser, Node.js) |
| WebAssembly | wasmJs (Browser, Node.js), wasmWasi (Node.js) |
# Run all checks before pushing
./ci-prepush.sh
# Format code
./gradlew spotlessApply
# Run static analysis
./gradlew detekt
# Run tests
./gradlew jvmTest
./gradlew iosSimulatorArm64Test # macOS only
# Build all targets
./gradlew assembleTo sync framework updates from the template repository:
./sync-dirs.shThis will sync CI/CD configs, scripts, and tooling while preserving your library code.
Delete this file after you've completed the setup!