-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RN Gradle Integration Advance options (#11163)
- Loading branch information
1 parent
05e0195
commit 5c2f27b
Showing
1 changed file
with
29 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,6 +138,35 @@ We enable the Gradle integration in your `android/app/build.gradle` file by addi | |
apply from: "../../node_modules/@sentry/react-native/sentry.gradle" | ||
``` | ||
|
||
To change the default behavior, you can pass the following Sentry Gradle Integration options and environmental variables: | ||
|
||
```bash | ||
export SENTRY_PROPERTIES=path/to/sentry.properties | ||
export SENTRY_DISABLE_AUTO_UPLOAD=true # Temporarily disable source maps upload | ||
|
||
export SENTRY_DIST=1234 | ||
export [email protected] | ||
``` | ||
|
||
```groovy {filename:android/app/build.gradle} | ||
project.ext.sentryCli = [ | ||
logLevel: "debug" // Enable verbose debug output | ||
sentryProperties: "path/to/sentry.properties", | ||
flavorAware: false, // When enabled looks for sentry-{flavor}-{build_type}.properties | ||
modulesPaths: [ | ||
"node_modules", | ||
"../node_modules", | ||
], | ||
skipCollectModules: false, | ||
collectModulesScript: "path/to/node_modules/@sentry/react-native/dist/js/tools/collectModules.js", | ||
copyDebugIdScript: "path/to/node_modules/@sentry/react-native/scripts/copy-debugid.js", | ||
hasSourceMapDebugIdScript: "path/to/node_modules/@sentry/react-native/scripts/has-sourcemap-debugid.js", | ||
] | ||
apply from: "../../node_modules/@sentry/react-native/sentry.gradle" | ||
``` | ||
|
||
### Enable Sentry AGP | ||
|
||
You can enable native symbol upload and other features by adding the [Sentry Android Gradle Plugin (AGP)](/platforms/android/configuration/gradle) dependency to `android/build.gradle`. | ||
|
@@ -180,32 +209,3 @@ sentry { | |
} | ||
} | ||
``` | ||
|
||
### Enable Logging for `sentry-cli` | ||
|
||
You can also enable logging for `sentry-cli` by adding this config before the above `apply from:` line: | ||
|
||
```groovy {filename:android/app/build.gradle} | ||
project.ext.sentryCli = [ | ||
logLevel: "debug" | ||
] | ||
apply from: "../../node_modules/@sentry/react-native/sentry.gradle" | ||
``` | ||
|
||
### Fetch `sentry.properties` | ||
|
||
We also support fetching different `sentry.properties` files for different flavors. For that, you need to add: | ||
|
||
```groovy {filename:android/app/build.gradle} | ||
project.ext.sentryCli = [ | ||
logLevel: "debug", | ||
flavorAware: true | ||
] | ||
apply from: "../../node_modules/@sentry/react-native/sentry.gradle" | ||
``` | ||
|
||
The corresponding flavor files should also be placed within the specific build type folder where you intend to use them. For example, the "Android demo release" flavor would be `react-native/android/sentry-demo-release.properties`. | ||
|
||
We recommend leaving `logLevel: "debug"` since we look for specific `sentry.properties` files depending on your flavor's name. |