Hello everyone.
All examples that i saw with shared module with KMM were as a single project for both platforms.
We have two different repositories on github for iOS and for Android. Is it possible to move shared module to the separate github repository and configure it with KMM plugin somehow to start using it with existing repositories without merging theme to one?
I did not find it in the documentation.
Thanks.
👌 2
s
Scott Kruse
01/30/2022, 2:09 PM
Yep, you'll just need to host the platform specific build artifact that gets generated
g
georgi
01/30/2022, 7:02 PM
You also have the option to use submodules where the two platform repos (iOS and Android) have the shared KMM repo as a submodule.
It largely depends on your development cycle and how you're planning to use the shared code.
☝️ 1
y
Yevhen Railian
01/31/2022, 7:03 AM
Thank you guys.
@Scott Kruse do you mean to prebuild shared module and upload artifact to Maven Central for example and then add it to our iOS and Android projects as generic gradle dependency?
@georgi i thought to move busyness logic to shared module. I will try to find information about sub-modules.
l
Lukasz Kalnik
01/31/2022, 11:21 PM
The jar created from shared module for Android you can host e.g. in GitHub Packages, no need for Maven Central.
For iOS you need to generate an iOS framework/cocoapod and integrate it how iOS requires it.
However from my experience it is best to integrate all three parts (Android, iOS and shared module) into one project. This way making any changes is much faster, as you can just build your Android/iOS app instantly from Android Studio and don't need to publish the shared module every time you change something.