Skip to content

Commit

Permalink
Merge pull request #668 from /issues/667-include-ios-debug-symbols
Browse files Browse the repository at this point in the history
Include debug symbols into precompiled PowerAuthCore
  • Loading branch information
hvge authored Jan 27, 2025
2 parents f2a8322 + 48c0308 commit f817cc4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PowerAuthCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Pod::Spec.new do |s|

# XCFramework build
s.prepare_command = <<-CMD
./scripts/ios-build-sdk.sh buildCore --out-dir Build/PowerAuthCore --optional-tvos
./scripts/ios-build-sdk.sh buildCore --out-dir Build/PowerAuthCore --optional-tvos --include-dsyms
CMD

# Produced files
Expand Down
16 changes: 13 additions & 3 deletions scripts/ios-build-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ DO_COPYSDK=0
OPT_LEGACY_ARCH=0
OPT_USE_BITCODE=0
OPT_WEAK_TVOS=0
OPT_INCLUDE_DSYMS=0

# -----------------------------------------------------------------------------
# USAGE prints help and exits the script with error code from provided parameter
Expand All @@ -81,6 +82,7 @@ function USAGE
echo " -nc | --no-clean disable 'clean' before 'build'"
echo " also disables temporary data cleanup after build"
echo " --optional-tvos tvOS is not required when SDK is not installed"
echo " --include-dsyms include debug symbols into final xcframework"
echo " -v0 turn off all prints to stdout"
echo " -v1 print only basic log about build progress"
echo " -v2 print full build log with rich debug info"
Expand Down Expand Up @@ -347,8 +349,14 @@ function BUILD_COMMAND

# Add produced platform framework to the list
local FINAL_FW="${ARCHIVE_PATH}/Products/Library/Frameworks/${OUT_FW}.framework"
local FINAL_DSYM="${ARCHIVE_PATH}/dSYMs/${OUT_FW}.framework.dSYM"
[[ ! -d "${FINAL_FW}" ]] && FAILURE "Xcode build did not produce '${OUT_FW}.framework' for platform ${PLATFORM}"
ALL_FAT_LIBS+=("${FINAL_FW}")
ALL_XCFW_ARGS+=" -framework ${FINAL_FW}"
if [ x$OPT_INCLUDE_DSYMS == x1 ]; then
[[ ! -d "${FINAL_DSYM}" ]] && FAILURE "Xcode build did not produce dSYMs for '${OUT_FW}.framework' for platform ${PLATFORM}"
ALL_XCFW_ARGS+=" -debug-symbols ${FINAL_DSYM}"
fi
}

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -377,6 +385,7 @@ function BUILD_LIB
PREPARE_OPENSSL

ALL_FAT_LIBS=()
ALL_XCFW_ARGS=

BUILD_PATCH_ARCHITECTURES

Expand All @@ -390,14 +399,12 @@ function BUILD_LIB
LOG_LINE
LOG "Creating final ${OUT_FW}.xcframework..."
local XCFW_PATH="${OUT_DIR}/${OUT_FW}.xcframework"
local XCFW_ARGS=
for ARG in ${ALL_FAT_LIBS[@]}; do
XCFW_ARGS+="-framework ${ARG} "
DEBUG_LOG " - source fw: ${ARG}"
done
DEBUG_LOG " - target fw: ${XCFW_PATH}"

xcodebuild -create-xcframework $XCFW_ARGS -output "${XCFW_PATH}"
xcodebuild -create-xcframework $ALL_XCFW_ARGS -output "${XCFW_PATH}"
}

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -527,6 +534,9 @@ do
--optional-tvos)
OPT_WEAK_TVOS=1
;;
--include-dsyms)
OPT_INCLUDE_DSYMS=1
;;
--legacy-archs)
OPT_LEGACY_ARCH=1
;;
Expand Down
2 changes: 1 addition & 1 deletion scripts/templates/PowerAuth2.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
s.cocoapods_version = '>= 1.10'
s.name = 'PowerAuth2'
s.version = '%DEPLOY_VERSION%'
s.summary = 'PowerAuth Mobile SDK for iOS'
s.summary = 'PowerAuth Mobile SDK for iOS and tvOS'
s.homepage = 'https://github.com/wultra/powerauth-mobile-sdk'
s.social_media_url = 'https://twitter.com/wultra'
s.documentation_url = 'https://github.com/wultra/powerauth-mobile-sdk/blob/develop/docs/PowerAuth-SDK-for-iOS.md'
Expand Down
4 changes: 2 additions & 2 deletions scripts/templates/PowerAuthCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
s.cocoapods_version = '>= 1.10'
s.name = 'PowerAuthCore'
s.version = '%DEPLOY_VERSION%'
s.summary = 'PowerAuthCore library for iOS'
s.summary = 'PowerAuthCore library for iOS and tvOS'
s.homepage = 'https://github.com/wultra/powerauth-mobile-sdk'
s.social_media_url = 'https://twitter.com/wultra'
s.documentation_url = 'https://github.com/wultra/powerauth-mobile-sdk/blob/develop/docs/PowerAuth-SDK-for-iOS.md'
Expand All @@ -27,7 +27,7 @@ Pod::Spec.new do |s|

# XCFramework build
s.prepare_command = <<-CMD
./scripts/ios-build-sdk.sh buildCore --out-dir Build/PowerAuthCore --optional-tvos
./scripts/ios-build-sdk.sh buildCore --out-dir Build/PowerAuthCore --optional-tvos --include-dsyms
CMD

# Produced files
Expand Down

0 comments on commit f817cc4

Please sign in to comment.