1
+ #! /bin/sh
2
+
3
+ if [ ! -d * " .xcodeproj" ]
4
+ then
5
+ echo " ERROR: no Xcode project file exists at this path to make builds from"
6
+ exit 1
7
+ fi
8
+
9
+ OUTPUT_FOLDER=build
10
+ CURRENT_FOLDER=` pwd`
11
+ FULL_OUTPUT_PATH=${CURRENT_FOLDER} /${OUTPUT_FOLDER}
12
+
13
+ rm -rf " ${OUTPUT_FOLDER} "
14
+
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
22
+
23
+ # 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
26
+ xcodebuild -create-xcframework \
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" \
32
+
33
+ # 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
36
+ xcodebuild -create-xcframework \
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" \
42
+
43
+ # create zips of both XCFrameworks
44
+ cd " ${OUTPUT_FOLDER} "
45
+
46
+ zip -r -q " IterableSDK.xcframework.zip" " IterableSDK.xcframework"
47
+ zip -r -q " IterableAppExtensions.xcframework.zip" " IterableAppExtensions.xcframework"
48
+
49
+ echo " ----------------------------------------------------------------"
50
+
51
+ swift package compute-checksum " IterableSDK.xcframework.zip"
52
+ swift package compute-checksum " IterableAppExtensions.xcframework.zip"
53
+
54
+ echo " ----------------------------------------------------------------"
0 commit comments