I'm trying to create a binary xcframework and I wanted it to have some SPM dependencies. Is it possible?
So far I'm facing the issue where I can't export my framework with a dependency because the BUILD_LIBRARY_FOR_DISTRIBUTION flag must be FALSE for the dependency to work. But in this case, I won't be able to generate the binary.
This is what I'm trying to do:
Add a SPM as a dependency:
Archive using xcodebuild:
xcodebuild archive -project frameworkPOC.xcodeproj -scheme frameworkPOC -destination "generic/platform=iOS" -archivePath "archives/frameworkPOC"
Generate binaries through:
xcodebuild -create-xcframework -archive archives/frameworkPOC.xcarchive -framework frameworkPOC.framework -output xcframeworks/frameworkPOC.xcframework
So far so good... The exported framework works fine. But if I add a SPM such as Alamofire I get this warning:
And when I export with BUILD_LIBRARY_FOR_DISTRIBUTION set to YES, the framework is broken as it seems Alamofire was not found.
So returning to my question: Is it possible to generate a binary framework that contains SPM dependencies?