This template is prepared with thought of seamless integration of KMM library to existing, native codebases.
- Default KMM project created by Android Studio wizard
- CI workflows based on Github Actions. It builds and tests both Android and iOS variants parallelly
- Release configuration based on Cocoapods (iOS) and Jitpack (Android)
- Static code analysis based on Ktlint
- Automated dependency update via Dependabot and Mergify (optional, only if Mergify is enabled for a repository)
After creating repository based on this template, several steps are required in order to publish artifacts for further usage in native codebases:
- Use this template to create a new repository
- Create a second repository for hosting iOS artifact (Cocoapods)
- Clone repository created from template
- Go to
shared/build.gradle.kts
and update:
iosFrameworkName
- it's name of the artifact that will be hosted via CocoapodsfatFrameworkCocoaConfig
:gitUrl
to match Cocoapods repository created in point (2)- update other fields at your discretion
- Execute
./gradlew generateCocoaPodRepoForIosFatFramework
- this will create CocoaPod repository for hosting iOS framework.
Use Jitpack.io - it's that simple.
This template uses kmp-fatframework-cocoa
Gradle Plugin to publish and manage releases to git repository.
To read more about why is it needed and how it's done, please refer to great article of the same author - Marco Gomiero (@prof18)
- Run
./gradlew publishIosDebugFatFramework
to publish (build & push to repository) the debug version todevelop
branch (of the seperate, Cocoapods-only repository created in point 2 ofHow to use
section) - Run
./gradlew publishIosReleaseFatFramework
to do the same but formain/master
branch with tag on a commit based on what's infatFrameworkCocoaConfig
- Write a feature in
shared
module - Test on sample apps, which are part of this repository
- If everything's ok - merge to
develop
and release debug version of iOS framework. - Test it in existing Android and iOS projects
- Iterate or release to iOS framework to production/release channel