Thomas Richtsfeld
11/08/2023, 5:22 PMPackage.swift
file in a different repository other than where the Android code and the shared code lives? Something like:
kmmbridge {
spm(githubUrl = "<https://api.github.com/repos/company/company-ios-all-shared>")
}
I am asking cause I fear that if we use the Android repository for publishing iOS artefacts could lead to increased build time if the Android repo contains lots of files (e.g. images from snapshot tests,…)kpgalligan
11/08/2023, 5:37 PMStylianos Gakis
11/08/2023, 8:15 PMkpgalligan
11/08/2023, 8:27 PMThomas Richtsfeld
11/09/2023, 7:02 AMSo the suggestion for such teams is to extract shared code into a third repo or bring iOS into monorepo right?Yes, we want to extract the shared code into a third repo. By shared code in this context we mean the binaries that are created, but not the code itself
then again, that might not work. If Xcode tries to get sub modules, it’ll be the same problem.So you are saying this won’t work anyway? When you talk about sub modules, do you mean the functionality in Github? Just asking as I don’t have any experience with that. All in all, do you think it is a lot of overhead if we just publish the binaries in the repo where the Android code and the shared code lives (Normal KMMBrisgde approach)? One of our iOS devs just raised the concern that it could lead to increased build times when the whole repo needs to be loaded on iOS. Which I understand as this is unnecessary because as far as I know SPM just needs to know the location of
Package.swift
right?
We were already using KMP in a repo that was outside of the Android one. We did exactly that
• The Package.swift
file was published to it’s own repo while the binaryTarget
url was pointing to the released zip file that lived in the shared repokpgalligan
11/09/2023, 3:13 PM> So the suggestion for such teams is to extract shared code into a third repo or bring iOS into monorepo right?
Yes, we want to extract the shared code into a third repo. By shared code in this context we mean the binaries that are created, but not the code itselfTo clarify, you are talking about different things. Pulling shared code into a 3rd repo and using a 3rd repo only to manage SPM dependencies. As a general recommendation, it really depends. If Android is where the main dev really happens, and iOS generally follows after, I wouldn't pull the shared code into a 3rd repo. It will likely slow down dev. If the team is larger and you'd pull an SDK out anyway, then it makes more sense. Also, if you are just trying out KMP or for whatever reason start with a 3rd repo, that's OK too.
So you are saying this won’t work anyway?I don't know. I thought of it while walking somewhere and used speech recognition to send that from my phone. Just thinking out loud.
When you talk about sub modules, do you mean the functionality in Github?Well, git specifically. It's not special to GitHub. Essentially you can have one git repo inside another. That's beet possible for a long time. Sounds nice, but managing that sucks. However, if the only interaction with submodules was with CI, you wouldn't need to manage it. As for "would it work", I'm not sure how Xcode handles submodules when doing package resolution. When you clone a repo, you need to explicitly ask to clone submodules as well. If Xcode doesn't do that, then this should "work". Would need to try it.
Thomas Richtsfeld
11/10/2023, 3:18 PMStylianos Gakis
11/10/2023, 3:20 PMkpgalligan
11/10/2023, 3:20 PMThomas Richtsfeld
11/10/2023, 3:23 PMkpgalligan
11/10/2023, 3:38 PMStylianos Gakis
11/10/2023, 3:47 PMThomas Richtsfeld
11/13/2023, 7:51 AMkpgalligan
11/15/2023, 7:44 PMStylianos Gakis
11/15/2023, 8:38 PM