I totally agree with @mattie.
In my case I have to create and distribute a framework which has almost 10 third party dependencies mix of both dynamic frameworks and SPMs.
I can share the framework and its dependencies to a user separately, but that seems like an overhead to manage for both the distributor and the consumer.
I was thinking about exposing the framework and its dependencies through CocoaPods, however I thought that may be it can be easily managed through Distributing binary frameworks as Swift packages. Here are the steps which I followed:
- Created a project FrameworkWithThirdParties with framework target
- Added XCFrameworks and SPM dependencies to it under Target > General > Frameworks and Libraries (XCFrameworks as do not embed)
- Added XCFrameworks and SPM dependencies to it under Target > Build Phases > Link Binary With Libraries (XCFrameworks and SPMs as optional)
- Generated XCFramework for it
- Created a SPM for the framework named as BinaryFrameworkSPM
- Created a dummy target to it and linked all dependencies to it by following these steps
- Now when I am integrating BinaryFrameworkSPM to my app it is giving me warnings:
Class FIRDLRetrievalProcessResult is implemented in both FrameworkWithThirdParties and App
Please note that although there are reported warnings the project is working fine.