Catan clone using Kotlin Multiplatform Mobile (KMM) + macOS.
shared
: KMM module with shared KotlincommonMain
: on all targetsandroidMain
: on all Android targetsdarwinMain
: on all iOS and macOS targetsiosMain
: on all iOS targetsmacosMain
: on all macOS targets- lots of target-specific source sets
android
: the android app- depends on
shared
- depends on
darwin
: the XCode project for the macOS and iOS apps, Swiftshared
: shared Swift code for both appsios
: the iOS appmacos
: the macOS app
The KMM plugin generates an Obj-C header with a bunch of Swift attributes that the Swift compiler (and XCode) understand how to read, so you can use Kotlin in your Swift.
I'm not sure how to package this yet.
# build framework for macOS target
./gradlew linkDebugFrameworkMacosArm64
# same for iOS
./gradlew linkDebugFrameworkIosArm64