From c03aef593e429debfbae71913bffa74100227320 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Fri, 1 Mar 2024 13:19:06 +0100 Subject: [PATCH] fix(xcode): Upload debug files only for non-debug builds --- CHANGELOG.md | 1 + scripts/sentry-xcode-debug-files.sh | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb57c47337..efb36408fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - expo-upload-sourcemaps now works on Windows ([#3643](https://github.com/getsentry/sentry-react-native/pull/3643)) - Option `enabled: false` ensures no events are sent ([#3606](https://github.com/getsentry/sentry-react-native/pull/3606)) - Ignore JSON response when retrieving source context from local Expo Dev Server ([#3611](https://github.com/getsentry/sentry-react-native/pull/3611)) +- Upload native debug files only for non-debug builds ([#3649](https://github.com/getsentry/sentry-react-native/pull/3649)) ### Dependencies diff --git a/scripts/sentry-xcode-debug-files.sh b/scripts/sentry-xcode-debug-files.sh index b522ba5fe3..8fcc403fbd 100755 --- a/scripts/sentry-xcode-debug-files.sh +++ b/scripts/sentry-xcode-debug-files.sh @@ -28,8 +28,12 @@ EXTRA_ARGS="$SENTRY_CLI_EXTRA_ARGS $SENTRY_CLI_DEBUG_FILES_UPLOAD_EXTRA_ARGS $IN UPLOAD_DEBUG_FILES="\"$SENTRY_CLI_EXECUTABLE\" debug-files upload $EXTRA_ARGS \"$DWARF_DSYM_FOLDER_PATH\"" -if [ "$SENTRY_DISABLE_AUTO_UPLOAD" != true ]; then - /bin/sh -c "\"$LOCAL_NODE_BINARY\" $UPLOAD_DEBUG_FILES" -else +XCODE_BUILD_CONFIGURATION="${CONFIGURATION}" + +if [ "$SENTRY_DISABLE_AUTO_UPLOAD" == true ]; then echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping debug files upload" +elif echo "$XCODE_BUILD_CONFIGURATION" | grep -iq "debug"; then # case insensitive check for "debug" + echo "Skipping debug files upload for *Debug* configuration" +else + /bin/sh -c "\"$LOCAL_NODE_BINARY\" $UPLOAD_DEBUG_FILES" fi