chore(build): Add debug symbols to release build (#1)

* chore(build): Add debug symbols to release build and make simulator build the Debug configuration
* chore(build): Update build script to just checkout the version tag ahead of next capacitor release
* chore(build): Remove now unused function
This commit is contained in:
Steven Sherry 2022-07-14 09:28:01 -05:00 committed by GitHub
parent b5b34d78eb
commit 640291de3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,15 +1,12 @@
#!/bin/bash -eoux pipefail #!/bin/bash -eoux pipefail
portals_dev_release_commit() {
git log --oneline | grep -B 1 "Release $1" | head -n1 | sed 's/ /\n/g' | head -n1 | xargs git checkout
}
build_capacitor_simulator() { build_capacitor_simulator() {
xcodebuild archive \ xcodebuild archive \
-scheme Capacitor \ -scheme Capacitor \
-workspace Capacitor.xcworkspace \ -workspace Capacitor.xcworkspace \
-destination "generic/platform=iOS Simulator" \ -destination "generic/platform=iOS Simulator" \
-archivePath ./Build/iOS-Simulator \ -archivePath ./Build/iOS-Simulator \
-configuration Debug \
SKIP_INSTALL=NO \ SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES BUILD_LIBRARY_FOR_DISTRIBUTION=YES
} }
@ -21,9 +18,19 @@ build_capacitor_ios() {
-destination "generic/platform=iOS" \ -destination "generic/platform=iOS" \
-archivePath ./Build/iOS \ -archivePath ./Build/iOS \
SKIP_INSTALL=NO \ SKIP_INSTALL=NO \
SWIFT_SERIALIZE_DEBUGGING_OPTIONS=NO \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES BUILD_LIBRARY_FOR_DISTRIBUTION=YES
} }
cap_bcsymbol() {
echo -n $(dwarfdump -u $PWD/Build/iOS.xcarchive/Products/Library/Frameworks/Capacitor.framework/Capacitor | grep -Ewo '[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}')
}
cordova_bcsymbol() {
echo -n $(dwarfdump -u $PWD/Build/iOS.xcarchive/Products/Library/Frameworks/Cordova.framework/Cordova | grep -Ewo '[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}')
}
create_xcframeworks() { create_xcframeworks() {
build_capacitor_simulator build_capacitor_simulator
build_capacitor_ios build_capacitor_ios
@ -34,11 +41,15 @@ create_xcframeworks() {
xcodebuild -create-xcframework \ xcodebuild -create-xcframework \
-framework ./Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Capacitor.framework \ -framework ./Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Capacitor.framework \
-framework ./Build/iOS.xcarchive/Products/Library/Frameworks/Capacitor.framework \ -framework ./Build/iOS.xcarchive/Products/Library/Frameworks/Capacitor.framework \
-debug-symbols $PWD/Build/iOS.xcarchive/dSYMs/Capacitor.framework.dSYM \
-debug-symbols $PWD/Build/iOS.xcarchive/BCSymbolMaps/$(cap_bcsymbol).bcsymbolmap \
-output Capacitor.xcframework -output Capacitor.xcframework
xcodebuild -create-xcframework \ xcodebuild -create-xcframework \
-framework ./Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Cordova.framework \ -framework ./Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Cordova.framework \
-framework ./Build/iOS.xcarchive/Products/Library/Frameworks/Cordova.framework \ -framework ./Build/iOS.xcarchive/Products/Library/Frameworks/Cordova.framework \
-debug-symbols $PWD/Build/iOS.xcarchive/dSYMs/Cordova.framework.dSYM \
-debug-symbols $PWD/Build/iOS.xcarchive/BCSymbolMaps/$(cordova_bcsymbol).bcsymbolmap \
-output Cordova.xcframework -output Cordova.xcframework
zip -r Capacitor.xcframework.zip Capacitor.xcframework zip -r Capacitor.xcframework.zip Capacitor.xcframework
@ -82,8 +93,7 @@ EOF
git clone https://github.com/ionic-team/capacitor capacitor-checkout git clone https://github.com/ionic-team/capacitor capacitor-checkout
cd capacitor-checkout/ios/Capacitor cd capacitor-checkout/ios/Capacitor
git checkout portals-dev git checkout $1
portals_dev_release_commit $1
create_xcframeworks create_xcframeworks