I have KMP library (Android and iOS) that I distribute on the iOS side as a binary Swift Package. I also publish the Android and the iOS Kotlin artifacts to Artifactory so that a team could build a KMP app instead of just iOS and Android.
The iOS builds cinterop with about 8 xcframeworks (some we build and some are third party). We upload these libraries as part of the Swift Package and teams just pull it them in.
Now I'm trying to help the first KMP team, and I was curious about how they should integrate the xcframeworks. Currently I publish a zip with the xcframeworks attached to the GitHub release. With the plan that they would download it when they upgrade my library and check it into their repo. But this feels a bit tedious. They have to upgrade the version in gradle and they have to manually download files. Also some of the third party frameworks are very large and things I would rather not check into Git and would require Git Large File System to be enabled.
Instead I was thinking about adding a new target to the Swift Package that would just have the external frameworks and not the library they would be replacing with their KMP shared library. That would make it easy for Xcode to get the dependency, for the app itself. But the shared library also needs it for linking the framework created by
embedAndSignAppleFrameworkForXcode
and the unit tests. The shared library doesn't need them to build an interop, the integration with them will happen directly in the KMP libraries being used.
I was wondering if others have faced similar problem and have a solution. My current thought is trying to find where Xcode resolved the dependencies and grab have gradle look there, but I don't know if how stable the paths are.