Michal Klimczak
10/19/2024, 6:06 PMkpgalligan
10/20/2024, 8:48 PMMichal Klimczak
10/21/2024, 6:13 AMMichal Klimczak
10/21/2024, 11:39 AMMichal Klimczak
10/21/2024, 11:40 AMkpgalligan
10/21/2024, 3:29 PMBut from the previous articles I assume the recommendation is to go with multirepo but including GitPortal to stay in control between the teamsI think the general approach of not forcing the teams to step on each other in the same repo is the overall recommendation. GitPortal has limited features right now. The purpose was to cut down on dev time and edge case issues, then get feedback and add features as they make sense for real teams. Right now, you can have one cross-repo tracking branch, generally main. Each commit to an app repo's main that changes KMP code pushes a change to the shared repo. It'll certainly work, but there may be alternative ways to accomplish the same thing. Summary, GitPortal is new, but that is the general model that I think would work well for teams. Feedback appreciated.
kpgalligan
10/21/2024, 3:30 PMkpgalligan
10/21/2024, 3:31 PMMichal Klimczak
10/21/2024, 4:03 PMkpgalligan
10/21/2024, 4:41 PMWhere I see the main advantage of the "submodule" over pure monorepo is mostly around possible different pace of ios and android teams, but that still means that we need to work out a system for moving forward with the shared module without breaking it for either of the native teams and I'm not yet sure about this part tbh. Without it, stepping on each other's toes seems to be inevitable regardless of whether the shared module lies within the monorepo or a separate one 🤔.This is essentially the problem I'm focused on. Each team should be able to edit their app and KMP code without being immediately locked into the other team's changes and workflow.
that still means that we need to work out a system for moving forward with the shared module without breaking it for either of the native teams and I'm not yet sure about this part tbh.That is what GP bidirectional intends to do. The "system" is that if, for example, the Android team made some changes that impacted KMP, an iOS dev would use GP to pull those changes into a local dev branch. they'd implement and test/fix anything for iOS. When merged, there will be changes that an Android dev will then need to review later, but presumably they wouldn't impact Android, so that should wrap up the bouncing back and forth.
kpgalligan
10/21/2024, 5:37 PMgit submodule
but I don't know many devs who enjoy submodule. You'll also need to figure out a branching strategy across repos that manages changes between apps. That is effectively what GitPortal does. If you make KMP changes in the Android app, those get pushed to the KMP repo, but not directly to main
. There's a tracking branch for Android and one for iOS. Eventually, as changes from each app get pulled into the other app, the KMP repo's main
advances. You could use submodule to do something similar, but submodule forces it's complexity directly on the dev, and you can get into trouble with it.
There's a version of GitPortal that I wrote as a POC which uses git subtree. If you're going to write your own solution, that's another option, but subtree has it's own issues.Michal Klimczak
10/21/2024, 5:41 PMMichal Klimczak
10/25/2024, 1:05 PMshared
module contains all domain classes so it should be included in all the feature packages. But a quick research says, that spm is not really compatible with fat frameworks which are built with embedAndSignAppleFrameworkForXcode
. So instead we should be using xcframework
. Which is not a big deal from the perspective that we talked about before, however it does make the building process a bit longer.kpgalligan
10/25/2024, 2:34 PMBut a quick research says, that spm is not really compatible with fat frameworks which are built withLocal dev vs wider packaging does tend to require different build configs. Hard to avoid. I'm not sure exactly how you're building the feature packages (in general, not just KMP), but if they get deployed as versioned builds, I think you'd need a rebuild anyway.. So instead we should be usingembedAndSignAppleFrameworkForXcode
. Which is not a big deal from the perspective that we talked about before, however it does make the building process a bit longer.xcframework
embedAndSignAppleFrameworkForXcode
will only build the arch you need at that moment. Assuming everybody has a mac and none are Intel, you need to build at least two "flavors" of KMP: arm simulator and arm device. Also, you'll probably want to have those published builds as release builds. In that case, whatever was being built locally with embedAndSignAppleFrameworkForXcode
would be useless anyway, as it's almost certainly a debug build.kpgalligan
10/25/2024, 2:37 PMMichal Klimczak
10/25/2024, 2:50 PM