@@ -168,32 +168,6 @@ build_ios_static() {
168168 -sdk iphoneos \
169169 SKIP_INSTALL=NO
170170
171- run " Creating simulator static library from libLeanplum.a ..." \
172- lipo -create \
173- Release/static/LeanplumSDK-iphonesimulator.xcarchive/Products/Library/Frameworks/libLeanplum.a \
174- -output Release/static/LeanplumSDK-iphonesimulator.xcarchive/Products/Library/Frameworks/Leanplum.framework/Leanplum
175-
176- run " Creating ios static library from libLeanplum.a ..." \
177- lipo -create \
178- Release/static/LeanplumSDK-iphoneos.xcarchive/Products/Library/Frameworks/libLeanplum.a \
179- -output Release/static/LeanplumSDK-iphoneos.xcarchive/Products/Library/Frameworks/Leanplum.framework/Leanplum
180-
181- run " Copying modulemap for simulator ..." \
182- cp -r Release/dynamic/LeanplumSDK-iphonesimulator.xcarchive/Products/Library/Frameworks/Leanplum.framework/Modules \
183- Release/static/LeanplumSDK-iphonesimulator.xcarchive/Products/Library/Frameworks/Leanplum.framework/Modules
184-
185- run " Copying modulemap for ios ..." \
186- cp -r Release/dynamic/LeanplumSDK-iphoneos.xcarchive/Products/Library/Frameworks/Leanplum.framework/Modules \
187- Release/static/LeanplumSDK-iphoneos.xcarchive/Products/Library/Frameworks/Leanplum.framework/Modules
188-
189- run " Copying Info.plist to static simulator framework ..." \
190- cp Release/dynamic/LeanplumSDK-iphonesimulator.xcarchive/Products/Library/Frameworks/Leanplum.framework/Info.plist \
191- Release/static/LeanplumSDK-iphonesimulator.xcarchive/Products/Library/Frameworks/Leanplum.framework/Info.plist
192-
193- run " Copying Info.plist to static iphone framework ..." \
194- cp Release/dynamic/LeanplumSDK-iphoneos.xcarchive/Products/Library/Frameworks/Leanplum.framework/Info.plist \
195- Release/static/LeanplumSDK-iphoneos.xcarchive/Products/Library/Frameworks/Leanplum.framework/Info.plist
196-
197171 run " Creating Leanplum-SDK-iOS static xcframework ..." \
198172 xcodebuild -create-xcframework \
199173 -framework Release/static/LeanplumSDK-iphonesimulator.xcarchive/Products/Library/Frameworks/Leanplum.framework \
@@ -235,9 +209,28 @@ zip_ios() {
235209 cd Release/dynamic
236210 zip -r Leanplum.framework.zip *
237211 mv Leanplum.framework.zip ..
212+
213+ echo " zipping dynamic xcframework for SPM"
214+ zip -r Leanplum.xcframework.zip *
238215 cd -
239216}
240217
218+ update_spm_info (){
219+ echo " updating SPM checksum and url"
220+ package_file=Package.swift
221+ package_tmp_file=Package_tmp.swift
222+ checksum=` swift package compute-checksum Release/dynamic/Leanplum.xcframework.zip`
223+ awk -v value=" \" $checksum \" ;" ' !x{x=sub(/checksum:.*/, "checksum: "value)}1' $package_file > $package_tmp_file \
224+ && mv $package_tmp_file $package_file
225+
226+ version=` cat sdk-version.txt`
227+ lp_framework=" Leanplum.xcframework.zip"
228+ github_url=" https://github.com/Leanplum/Leanplum-iOS-SDK/releases/download"
229+ url=" $github_url /$version /$lp_framework "
230+ awk -v value=" \" $url \" ;" ' !x{x=sub(/url: .*/, "url: "value)}1' $package_file > $package_tmp_file \
231+ && mv $package_tmp_file $package_file
232+ }
233+
241234zip_unreal_engine () {
242235 echo " zipping for Unreal Engine release"
243236 pwd
0 commit comments