Hello everyone. All examples that i saw with sha...
# multiplatform
y
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
Yep, you'll just need to host the platform specific build artifact that gets generated
g
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
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
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.
A submodule is a Git way to integrate other projects into your project: https://git-scm.com/book/en/v2/Git-Tools-Submodules
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.