Skip to content

Commit e35f152

Browse files
committed
modifications to script to add debug symbols
1 parent ec8ff1b commit e35f152

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

scripts/create-xcframework-zips.sh

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,44 @@ then
77
fi
88

99
OUTPUT_FOLDER=build
10+
CURRENT_FOLDER=`pwd`
11+
FULL_OUTPUT_PATH=${CURRENT_FOLDER}/${OUTPUT_FOLDER}
1012

1113
rm -rf "${OUTPUT_FOLDER}"
1214

1315
# -destination="iOS" -- seems like "-sdk iphoneos" is needed and not this?
16+
# proper format might be -destination "generic/platform=iOS"
1417
xcodebuild archive -scheme "swift-sdk" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BITCODE_GENERATION_MODE=bitcode -archivePath "./${OUTPUT_FOLDER}/IterableSDK-iOS" -sdk iphoneos
1518

1619
# -destination="iOS Simulator" -- seems like "-sdk iphonesimulator" is needed and not this?
20+
# proper format might be -destination "generic/platform=iOS Simulator"
1721
xcodebuild archive -scheme "swift-sdk" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BITCODE_GENERATION_MODE=bitcode -archivePath "./${OUTPUT_FOLDER}/IterableSDK-Simulator" -sdk iphonesimulator
1822

1923
# create IterableSDK.xcframework
24+
# -debug-symbols requires a full path specified
25+
# TODO: add the contents of BCSymbolMaps as -debug-symbols parameters -- maybe like in https://developer.apple.com/forums/thread/655768?answerId=645657022#645657022
2026
xcodebuild -create-xcframework \
21-
-output "./${OUTPUT_FOLDER}/IterableSDK.xcframework" \
22-
-framework "./${OUTPUT_FOLDER}/IterableSDK-iOS.xcarchive/Products/Library/Frameworks/IterableSDK.framework" \
23-
-framework "./${OUTPUT_FOLDER}/IterableSDK-Simulator.xcarchive/Products/Library/Frameworks/IterableSDK.framework"
27+
-output "./${OUTPUT_FOLDER}/IterableSDK.xcframework" \
28+
-framework "./${OUTPUT_FOLDER}/IterableSDK-iOS.xcarchive/Products/Library/Frameworks/IterableSDK.framework" \
29+
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-iOS.xcarchive/dSYMs/IterableSDK.framework.dSYM" \
30+
-framework "./${OUTPUT_FOLDER}/IterableSDK-Simulator.xcarchive/Products/Library/Frameworks/IterableSDK.framework" \
31+
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-Simulator.xcarchive/dSYMs/IterableSDK.framework.dSYM" \
2432

2533
# create IterableAppExtensions.xcframework
34+
# -debug-symbols requires a full path specified
35+
# TODO: add the contents of BCSymbolMaps as -debug-symbols parameters -- maybe like in https://developer.apple.com/forums/thread/655768?answerId=645657022#645657022
2636
xcodebuild -create-xcframework \
27-
-output "./${OUTPUT_FOLDER}/IterableAppExtensions.xcframework" \
28-
-framework "./${OUTPUT_FOLDER}/IterableSDK-iOS.xcarchive/Products/Library/Frameworks/IterableAppExtensions.framework" \
29-
-framework "./${OUTPUT_FOLDER}/IterableSDK-Simulator.xcarchive/Products/Library/Frameworks/IterableAppExtensions.framework"
37+
-output "./${OUTPUT_FOLDER}/IterableAppExtensions.xcframework" \
38+
-framework "./${OUTPUT_FOLDER}/IterableSDK-iOS.xcarchive/Products/Library/Frameworks/IterableAppExtensions.framework" \
39+
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-Simulator.xcarchive/dSYMs/IterableAppExtensions.framework.dSYM" \
40+
-framework "./${OUTPUT_FOLDER}/IterableSDK-Simulator.xcarchive/Products/Library/Frameworks/IterableAppExtensions.framework" \
41+
-debug-symbols "${FULL_OUTPUT_PATH}/IterableSDK-Simulator.xcarchive/dSYMs/IterableAppExtensions.framework.dSYM" \
3042

43+
# create zips of both XCFrameworks
3144
cd "${OUTPUT_FOLDER}"
3245

33-
zip -r "IterableSDK.xcframework.zip" "IterableSDK.xcframework"
34-
zip -r "IterableAppExtensions.xcframework.zip" "IterableAppExtensions.xcframework"
46+
zip -r -q "IterableSDK.xcframework.zip" "IterableSDK.xcframework"
47+
zip -r -q "IterableAppExtensions.xcframework.zip" "IterableAppExtensions.xcframework"
3548

3649
echo "----------------------------------------------------------------"
3750

0 commit comments

Comments
 (0)