I have some code that is currently built using Swift Package Manager. It does not have an Xcode project. I want to build an XCFramework from my package, but when I build the package it creates a .o, and xcodebuild -create-xcframework does not seem to support .o files.
Also, I have added resources, and now I see there is a .bundle, but I don’t see any way to add the .bundle to an XCFramework.
I have tried changing my Package.swift library product to be .dynamic (even though I prefer it to be .static), and that produces a .framework, which I can then convert to an XCFramework, but it does not appear to have my resources (they appear to still be in the .bundle file next to my .o).
I have also tried making an Xcode project to wrap my Swift package. It imports my package and links against it and produces a Framework that I can make an XCFramework from, but it also does not have my Resources.
All of this was done using Xcode 12 beta.
Also, I have added resources, and now I see there is a .bundle, but I don’t see any way to add the .bundle to an XCFramework.
I have tried changing my Package.swift library product to be .dynamic (even though I prefer it to be .static), and that produces a .framework, which I can then convert to an XCFramework, but it does not appear to have my resources (they appear to still be in the .bundle file next to my .o).
I have also tried making an Xcode project to wrap my Swift package. It imports my package and links against it and produces a Framework that I can make an XCFramework from, but it also does not have my Resources.
All of this was done using Xcode 12 beta.
While creating XCFrameworks from Swift packages may work in some limited cases, we don't support it today. Using an Xcode target to wrap a package also will not work, because an XCFramework bundles a single module, but in this case you would have two.
You will have to manually create a Xcode project for your library in order to create an XCFramework for it.
For context, what's your use case for doing this? Are you developing a closed source library as a package and now you want to distribute it as an XCFramework to clients?
You will have to manually create a Xcode project for your library in order to create an XCFramework for it.
For context, what's your use case for doing this? Are you developing a closed source library as a package and now you want to distribute it as an XCFramework to clients?