Hello everybody, we are quite interested in how co...
# multiplatform
m
Hello everybody, we are quite interested in how companies are managing building, distributing and consuming the KMM libraries in the android and ios projects. The case is the following: - android, ios and kmm in different repositories - work on kmm and android/ios at the same time, i.e. we want to check how kmm changes are working in android/ios before merging the kmm changes - be able to assess point above both in ci and locally Our current situation is the following: - kmm is a submodule in android and we are using composite builds. Problem: imports are shown in red but compilation is working ok (composite builds are not supported in kmm yet). This is a really good solution, submodule handling need learning but the gain is high, btw red imports are a blocker - kmm is a submodule in ios and it is built when building the ios app as standalone project (kmm is built first and xcframework is copied in the ios project). Problems: long build times, random compilation problem in xcode (due to xcode caching issue) We are thinking about: - android: prebuild and distribute kmm. This is ok when not working on kmm changes but what's the best way to work locally? Should we use a gradle flag for switching between the two modes (prebuild or build locally)? We'll anyway the composite build red import problem when working locally so we'll need to remove composite build, but it will remove the possibility to seamless navigate between android and kmm code in the ide. Also, in CI Android PRs will depend on prebuild KMM PR binary, how to deal with this dependency? - ios: prebuild and distribute xcframework. Here we have similar issues of the point above related to android
l
To me, one of the best way is to use maven (mavenLocal for local work and mavenCentral with a private repo for release) By doing so, your KMM repo will have a release version that both Android and iOS can use