-
Notifications
You must be signed in to change notification settings - Fork 453
KMP Migration Guide
Sk Niyaj Ali edited this page Jan 7, 2025
·
1 revision
Before starting the migration process, please note:
- Module dependencies must be migrated in the correct order
- Feature modules should not depend on other feature modules
- Core module access rules:
- Data modules can only access database and network modules
- Network module can access datastore but not database
- Domain module can only access data, common, and model modules (no direct access to network or database)
-
Initial Setup
- Apply the plugin and sync the project
- Apply Platform or Common dependencies to the target module
- Create
commonMain
directory and add package structure - Move all files from
main
directory tocommonMain
-
Code Migration
- Refactor and fix imports in each file
- Migrate from Hilt DI to Koin DI Module
- Create actual/expect declarations for platform-specific implementations
-
Code Quality Checks
- Run Spotless (e.g.,
./gradlew :core:model:spotlessApply
) - Run Detekt (e.g.,
./gradlew :core:model:detekt
) - Review all changes thoroughly before committing
- Run Spotless (e.g.,
:core:model
:core:common
:core:datastore
:core:network
-
:core:designsystem
(with CMP) -
:core:ui
(with CMP)
-
Authentication & Security
-
Main Features
-
Financial Features
-
Transfer & Payment Features
-
Additional Features
Initial setup and key migrations:
- Initial KMP Setup
- Core Module Migrations: model to ui
- Feature Module Migrations: auth to upi-setup
- Final Cleanup
- iOS Setup
- Verify all modules have been migrated correctly
- Ensure all tests pass
- Check platform-specific implementations
- Review dependency graph
- Create pull request for review
Remember to consult the official architecture guide for additional information and best practices.
- Join Firebase Android App Testing - https://appdistribution.firebase.dev/i/87a469306176a52a
- Kotlin Multiplatform - https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html
- JetBrains Toolbox - https://www.jetbrains.com/toolbox-app/
- Compose Multiplatform - https://www.jetbrains.com/compose-multiplatform/
- Fastlane - https://docs.fastlane.tools/