Wormholy
Wormholy copied to clipboard
Swift Package Manager SPM support?
When trying to use SPM I end up with this:
xcodebuild: error: Could not resolve package dependencies:
Source files for target Wormholy should be located under 'Sources/Wormholy', or a custom sources path can be set with the 'path' property in Package.swift
Do you by any chance plan to support SPM?
Tried specifying the master
branch - but still no luck.
You can find the reason here https://github.com/pmusolino/Wormholy/pull/82#issuecomment-614583033
@pmusolino I think maybe you can make a pre-built XCFramework, then we can have a SPM source
@pmusolino I think the concerns you have in #82 (comment) might not be valid now. I think SPM has been enhanced to support all that.
Here is the script to build an xcFramework file from the source. Just put it in the root and run zsh buildXCFramework.sh
. The built xcFramework could be added to the project manually or placed in a repo with the SPM support.
buildXCFramework.sh
# buildXCFramework.sh
FW=Wormholy.framework
XFW=Wormholy.xcframework
# builds iOS slice
xcodebuild archive -scheme Wormholy-iOS -configuration Release -destination 'generic/platform=iOS' -archivePath "./archives/$FW-iphoneos.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO
# builds iOS simulator slice
xcodebuild archive -scheme Wormholy-iOS -configuration Release -destination 'generic/platform=iOS Simulator' -archivePath "./archives/$FW-iphonesimulator.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO
# merges both into .xcframework
rm -rf "$XFW"
xcodebuild -create-xcframework -framework "./archives/$FW-iphonesimulator.xcarchive/Products/Library/Frameworks/$FW" \
-framework "./archives/$FW-iphoneos.xcarchive/Products/Library/Frameworks/$FW" \
-output "$XFW"