Does anyone here have experience migrating existin...
# multiplatform
a
Does anyone here have experience migrating existing Android and iOS apps to use KMP? We are exploring the possibility of using KMP so that business logic code can be shared between our existing iOS and Android apps. Can we migrate step-by-step or by feature or do we have to do a full rewrite?
e
You can adopt KMP as gradually as you like, your KMP module can be exposed to iOS as a pods dependency (or you can compile it directly in a build phase) which you can call from your existing iOS app, as for android, you can include the shared module in your app just as you would any other module. If you do choose to adopt kmp, I'd recommend using SKIE, it's a gradle plugin that helps bridge the kotlin-swift gap, as kmp by default generates to obj-c code, so some of the niceties you've come to expect such as default parameters in function calls would otherwise be missing https://skie.touchlab.co/
a
I see, thanks! Our Android app is in the midst of moving from XML/RxJava to Compose/Coroutines, and our iOS app is undergoing refactoring as well, so to reduce reduplication of effort (both by devs and QA), the idea of adopting KMP was floated. How did you organize Github repos at the start though? Did you create a separate repository for the shared module or did you merge both iOS and Android repos as a single mega repo right at the start?
e
I originally had multiple repositories, but found over time just making one repo was simpler for me to maintain going forward. Entirely depends on your situation though, if you are able to stick to strict version numbers in the shared module, that should work fine. As I'm in a much smaller team, I opted to just merge the repos eventually
gratitude thank you 1
j
a
This is great @Jeff Tycz, thanks!