Wormholy icon indicating copy to clipboard operation
Wormholy copied to clipboard

Swift Package Manager SPM support?

Open mburda-bc opened this issue 3 years ago • 5 comments

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?

mburda-bc avatar Dec 02 '21 12:12 mburda-bc

Tried specifying the master branch - but still no luck.

EvgenyKarkan avatar Feb 22 '22 00:02 EvgenyKarkan

You can find the reason here https://github.com/pmusolino/Wormholy/pull/82#issuecomment-614583033

pmusolino avatar Feb 22 '22 12:02 pmusolino

@pmusolino I think maybe you can make a pre-built XCFramework, then we can have a SPM source

dingtianran avatar Apr 17 '22 00:04 dingtianran

@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.

murraysagal avatar Nov 16 '22 01:11 murraysagal

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"

akovalov avatar May 03 '23 07:05 akovalov