Skip to content

Commit dd27e72

Browse files
authored
Merge pull request #422 from Iterable/MOB-2308-xcframework
[MOB-2308] xcframework generator scripts
2 parents d36fcce + e35f152 commit dd27e72

File tree

5 files changed

+62
-10
lines changed

5 files changed

+62
-10
lines changed

.swift-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

Iterable-iOS-AppExtensions.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ Pod::Spec.new do |s|
55
s.summary = "App Extensions for Iterable SDK"
66

77
s.description = <<-DESC
8-
App Extensions for Rich Push notifications with Iterable SDK
8+
App extensions for rich push notifications with Iterable's iOS SDK
99
DESC
1010

1111
s.homepage = "https://github.com/Iterable/swift-sdk.git"
1212
s.license = "MIT"
13-
s.author = { "Tapash Majumder" => "[email protected]",
14-
"Jay Kim" => "[email protected]" }
13+
s.author = { "Tapash Majumder" => "[email protected]",
14+
"Jay Kim" => "[email protected]" }
1515

1616
s.platform = :ios, "10.0"
1717
s.source = { :git => "https://github.com/Iterable/swift-sdk.git", :tag => s.version }
18-
s.source_files = "notification-extension/*.{h,m,swift}"
18+
s.source_files = "notification-extension/*.{h,m,swift}"
1919

2020
s.pod_target_xcconfig = {
2121
'SWIFT_VERSION' => '5.2'

Iterable-iOS-SDK.podspec

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Pod::Spec.new do |s|
55
s.summary = "Iterable's official SDK for iOS"
66

77
s.description = <<-DESC
8-
iOS SDK containing a wrapper around Iterable's API, in addition
9-
to some utility functions
8+
Iterable's iOS SDK integrating utility and the Iterable API
109
DESC
1110

1211
s.homepage = "https://github.com/Iterable/swift-sdk.git"
@@ -18,11 +17,11 @@ Pod::Spec.new do |s|
1817
s.source = { :git => "https://github.com/Iterable/swift-sdk.git", :tag => s.version }
1918
s.source_files = "swift-sdk/**/*.{h,m,swift}"
2019

21-
s.resource_bundles = {'Resources' => 'swift-sdk/Resources/**/*.{storyboard,xib,xcassets,xcdatamodeld}' }
22-
2320
s.pod_target_xcconfig = {
2421
'SWIFT_VERSION' => '5.2'
2522
}
2623

2724
s.swift_version = '5.2'
25+
26+
s.resource_bundles = {'Resources' => 'swift-sdk/Resources/**/*.{storyboard,xib,xcassets,xcdatamodeld}' }
2827
end

scripts/build-target-module-framework.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
2020

2121
# Step 1. Build Device and Simulator versions
2222
xcodebuild -target "${TARGET}" -configuration ${CONFIGURATION} ONLY_ACTIVE_ARCH=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_DIR}" BITCODE_GENERATION_MODE=bitcode clean build -sdk iphoneos
23-
xcodebuild -target "${TARGET}" -configuration ${CONFIGURATION} ONLY_ACTIVE_ARCH=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_DIR}" BITCODE_GENERATION_MODE=bitcode clean build -sdk iphonesimulator
23+
xcodebuild -target "${TARGET}" -configuration ${CONFIGURATION} ONLY_ACTIVE_ARCH=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_DIR}" BITCODE_GENERATION_MODE=bitcode EXCLUDED_ARCHS="arm64" clean build -sdk iphonesimulator
2424

2525
# Step 2. Copy the framework structure (from iphoneos build) to the universal folder
2626
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${MODULE_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"

scripts/create-xcframework-zips.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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

Comments
 (0)