So I’m looking at using KMM to initially share our...
# android
f
So I’m looking at using KMM to initially share our model classes between IOS and Android dev, what is the best way of doing this, should the KMM module be created in Intellij AppCode or Android Studio. My initial thinking is that I have a separate GitHub repo for KMM modules build in intellij then this gets imported via gradle into appCode (IOS) and Android Studio (Android). Is this the recommended approach
j
It all depends on the scale you are targeting. For small apps i'd stay in a single repo and just build the modules in intelliJ or Android Studio. But if you want to scale your project up it is better to build the artifacts of shared code (at least for iOS, as cocoapods or in Swift Package Manager. For android there is little to no gain on publishing artifacts imo). You can look at KMMBridge which is basically this flow: https://github.com/touchlab/KMMBridge
f
yeah basically I want IOS devs and Android devs to share the work on the model (KMM) it feels then that the KMM module should really live separately from the Android side and IOS side so basically a separate github module
I’ll have a look at KMMBridge this looks like the setup I want
j
i myself prefer to have single repo for android AND shared that exposes artifact to iOS
this way working on android you don't have to release artifact for every single change
you basically work on android like a single codebase
and then push shared to iOS when needed
you could add shared repo to android one via git submodule, but that's completely separate can of worms..
f
I think that will be the easiest approach, though it makes the IOS mobile dev a bit of a second class citizen
j
i think in KMM it will always be the case
i mean, you can have better flow on android without compromising iOS flow
so i take that route
f
yeah that makes sense, my reasoning for using KMM would be so that frontend devs share common language (Model)
so really I would want IOS devs to work on the KMM module also, hence reasoning around having it seperate
anyway thanks for your suggestions, I think the initial easiest approach will to do what you suggest have it as part of the android module
j
I'd recommend checking out this article: https://medium.com/360learning-engineering/key-takeaways-from-our-kotlin-multiplatform-journey-764415e3606f I have been in the process of converting our project to KMM and want to make the iOS dev experience as first class as possible so I'd vote for mono repo
f
ah thanks, that is exactly what I’m looking for
So it looks like going forward the plan for KMM would be to basically have Intellij with the appcode plugins and with android studio plugins then have one monorepo that would have IOS Android and KMM modules