Skip to content

Commit

Permalink
Add script for generating the SPM binaries analogous to the other bui…
Browse files Browse the repository at this point in the history
…ld script
  • Loading branch information
asshoffm authored and andresilveirah committed Oct 20, 2023
1 parent 7c5363e commit c0b7b1f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions ConsentViewController.xcodeproj
36 changes: 36 additions & 0 deletions buildSPMFramework.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Creates the binaries which are distributed via SPM.

xcodebuild archive \
-project ConsentViewController.xcodeproj \
-scheme SPMConsentViewController-iOS \
-destination 'generic/platform=iOS' \
-archivePath './build/SPM/ConsentViewController-iOS' &&
xcodebuild archive \
-project ConsentViewController.xcodeproj \
-scheme SPMConsentViewController-iOS \
-destination 'generic/platform=iOS Simulator' \
-archivePath './build/SPM/ConsentViewController-iOS-simulator' &&
xcodebuild archive \
-project ConsentViewController.xcodeproj \
-scheme SPMConsentViewController-tvOS \
-destination 'generic/platform=tvOS' \
-archivePath './build/SPM/ConsentViewController-tvOS' &&
xcodebuild archive \
-project ConsentViewController.xcodeproj \
-scheme SPMConsentViewController-tvOS \
-destination 'generic/platform=tvOS Simulator' \
-archivePath './build/SPM/ConsentViewController-tvOS-simulator'

rm -r ./XCFramework/SPM/ConsentViewController.xcframework
rm -r ./XCFramework/SPM/ConsentViewController.xcframework.zip

xcodebuild -create-xcframework \
-framework './build/SPM/ConsentViewController-iOS.xcarchive/Products/Library/Frameworks/ConsentViewController.framework' \
-framework './build/SPM/ConsentViewController-iOS-simulator.xcarchive/Products/Library/Frameworks/ConsentViewController.framework' \
-framework './build/SPM/ConsentViewController-tvOS.xcarchive/Products/Library/Frameworks/ConsentViewController.framework' \
-framework './build/SPM/ConsentViewController-tvOS-simulator.xcarchive/Products/Library/Frameworks/ConsentViewController.framework' \
-output './XCFramework/SPM/ConsentViewController.xcframework'

zip -r ./XCFramework/SPM/ConsentViewController.xcframework.zip ./XCFramework/SPM/ConsentViewController.xcframework
4 changes: 4 additions & 0 deletions buildXCFramework.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
#!/bin/bash

xcodebuild archive \
-project _Pods.xcodeproj \
-scheme ConsentViewController-iOS \
-destination 'generic/platform=iOS' \
-archivePath './build/ConsentViewController-iOS.framework-iOS.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive \
-project _Pods.xcodeproj \
-scheme ConsentViewController-iOS \
-destination 'generic/platform=iOS Simulator' \
-archivePath './build/ConsentViewController-iOS.framework-iphonesimulator.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES &&
xcodebuild archive \
-project _Pods.xcodeproj \
-scheme ConsentViewController-tvOS \
-destination 'generic/platform=tvOS Simulator' \
-archivePath './build/ConsentViewController-tvOS.framework-tvossimulator.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES &&
xcodebuild archive \
-project _Pods.xcodeproj \
-scheme ConsentViewController-tvOS \
-destination 'generic/platform=tvOS' \
-archivePath './build/ConsentViewController-tvOS.framework-tvOS.xcarchive' \
Expand Down

0 comments on commit c0b7b1f

Please sign in to comment.