Skip to content

Commit 373cc8e

Browse files
Feat: Add flag to disable debug file upload (#4223)
* add SENTRY_DISABLE_DEBUG_FILE_UPLOAD flag for ios * nit * changelog * also apply it for Android
1 parent ce7794e commit 373cc8e

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,28 @@
88
99
## Unreleased
1010

11+
### Features
12+
13+
- Add env flag `SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD` to allow disabling the debug file upload ([#4223](https://github.com/getsentry/sentry-react-native/pull/4223))
14+
15+
How to use in Android project? It works by default, just set `export SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD=true` in your build environment. For Sentry Android Gradle Plugin add the following to your `android/app/build.gradle`.
16+
17+
```gradle
18+
apply from: "../../../sentry.gradle"
19+
20+
sentry {
21+
autoUploadProguardMapping = shouldSentryAutoUpload()
22+
uploadNativeSymbols = shouldSentryAutoUpload()
23+
}
24+
```
25+
26+
How to use in Xcode? Make sure you are using `scripts/sentry-xcode.sh` and `scripts/sentry-xcode-debug-files.sh` in your
27+
build phases. And add the following to your `ios/.xcode.env.local` file.
28+
29+
```bash
30+
export SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD=true
31+
```
32+
1133
### Fixes
1234

1335
- Skips ignoring require cycle logs for RN 0.70 or newer ([#4214](https://github.com/getsentry/sentry-react-native/pull/4214))

packages/core/scripts/sentry-xcode-debug-files.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ XCODE_BUILD_CONFIGURATION="${CONFIGURATION}"
3535

3636
if [ "$SENTRY_DISABLE_AUTO_UPLOAD" == true ]; then
3737
echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping debug files upload"
38+
elif [ "$SENTRY_DISABLE_XCODE_DEBUG_UPLOAD" == true ]; then
39+
echo "SENTRY_DISABLE_XCODE_DEBUG_UPLOAD=true, skipping native debug files upload"
3840
elif echo "$XCODE_BUILD_CONFIGURATION" | grep -iq "debug"; then # case insensitive check for "debug"
3941
echo "Skipping debug files upload for *Debug* configuration"
4042
else

packages/core/sentry.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import java.util.regex.Matcher
44
import java.util.regex.Pattern
55

66
project.ext.shouldSentryAutoUpload = { ->
7-
return System.getenv('SENTRY_DISABLE_AUTO_UPLOAD') != 'true'
7+
return System.getenv('SENTRY_DISABLE_AUTO_UPLOAD') != 'true' ||
8+
System.getenv('SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD') != 'true'
89
}
910

1011
def config = project.hasProperty("sentryCli") ? project.sentryCli : [];

0 commit comments

Comments
 (0)