Skip to content

Commit 33a2f48

Browse files
Merge pull request #547 from Iterable/tapash/mob-4280-script
[MOB-4280] - Fix script for generating XCFramework files.
2 parents 23deafd + dc95b52 commit 33a2f48

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

scripts/create-xcframework-zips.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
3+
set -eE
4+
trap 'printf "\e[31m%s: %s\e[m\n" "ERROR($?): $BASH_SOURCE:$LINENO $BASH_COMMAND"' ERR
25

36
if [ ! -d *".xcodeproj" ]
47
then
@@ -12,13 +15,9 @@ FULL_OUTPUT_PATH=${CURRENT_FOLDER}/${OUTPUT_FOLDER}
1215

1316
rm -rf "${OUTPUT_FOLDER}"
1417

15-
# -destination="iOS" -- seems like "-sdk iphoneos" is needed and not this?
16-
# proper format might be -destination "generic/platform=iOS"
17-
xcodebuild archive -scheme "swift-sdk" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BITCODE_GENERATION_MODE=bitcode -archivePath "./${OUTPUT_FOLDER}/IterableSDK-iOS" -sdk iphoneos
18-
19-
# -destination="iOS Simulator" -- seems like "-sdk iphonesimulator" is needed and not this?
20-
# proper format might be -destination "generic/platform=iOS Simulator"
21-
xcodebuild archive -scheme "swift-sdk" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BITCODE_GENERATION_MODE=bitcode -archivePath "./${OUTPUT_FOLDER}/IterableSDK-Simulator" -sdk iphonesimulator
18+
xcodebuild archive -scheme "swift-sdk" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BITCODE_GENERATION_MODE=bitcode SUPPORTS_MACCATALYST=NO -archivePath "./${OUTPUT_FOLDER}/IterableSDK-iOS" -sdk iphoneos -destination "generic/platform=iOS" -configuration Release
19+
xcodebuild archive -scheme "swift-sdk" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BITCODE_GENERATION_MODE=bitcode SUPPORTS_MACCATALYST=NO -archivePath "./${OUTPUT_FOLDER}/IterableSDK-Simulator" -sdk iphonesimulator -destination "generic/platform=iOS Simulator" -configuration Release
20+
xcodebuild archive -scheme "swift-sdk" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BITCODE_GENERATION_MODE=bitcode SUPPORTS_MACCATALYST=YES -archivePath "./${OUTPUT_FOLDER}/IterableSDK-MC" -sdk iphoneos -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Release
2221

2322
# create IterableSDK.xcframework
2423
# -debug-symbols requires a full path specified
@@ -29,6 +28,8 @@ xcodebuild -create-xcframework \
2928
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-iOS.xcarchive/dSYMs/IterableSDK.framework.dSYM" \
3029
-framework "./${OUTPUT_FOLDER}/IterableSDK-Simulator.xcarchive/Products/Library/Frameworks/IterableSDK.framework" \
3130
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-Simulator.xcarchive/dSYMs/IterableSDK.framework.dSYM" \
31+
-framework "./${OUTPUT_FOLDER}/IterableSDK-MC.xcarchive/Products/Library/Frameworks/IterableSDK.framework" \
32+
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-MC.xcarchive/dSYMs/IterableSDK.framework.dSYM"
3233

3334
# create IterableAppExtensions.xcframework
3435
# -debug-symbols requires a full path specified
@@ -39,6 +40,8 @@ xcodebuild -create-xcframework \
3940
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-Simulator.xcarchive/dSYMs/IterableAppExtensions.framework.dSYM" \
4041
-framework "./${OUTPUT_FOLDER}/IterableSDK-Simulator.xcarchive/Products/Library/Frameworks/IterableAppExtensions.framework" \
4142
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-Simulator.xcarchive/dSYMs/IterableAppExtensions.framework.dSYM" \
43+
-framework "./${OUTPUT_FOLDER}/IterableSDK-MC.xcarchive/Products/Library/Frameworks/IterableAppExtensions.framework" \
44+
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-MC.xcarchive/dSYMs/IterableAppExtensions.framework.dSYM"
4245

4346
# create zips of both XCFrameworks
4447
cd "${OUTPUT_FOLDER}"
@@ -51,4 +54,4 @@ echo "----------------------------------------------------------------"
5154
swift package compute-checksum "IterableSDK.xcframework.zip"
5255
swift package compute-checksum "IterableAppExtensions.xcframework.zip"
5356

54-
echo "----------------------------------------------------------------"
57+
echo "----------------------------------------------------------------"

0 commit comments

Comments
 (0)