-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RN Gradle Integration Advance options #11163
Merged
krystofwoldrich
merged 1 commit into
master
from
kw-add-rn-gradle-integration-advance-options
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you remove this on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, its included in https://github.com/getsentry/sentry-docs/pull/11163/files#diff-d112867dfaecab66d0fcf0d26378af89f8610d07275f290819e64f96775292f7R153 and https://github.com/getsentry/sentry-docs/pull/11163/files#diff-d112867dfaecab66d0fcf0d26378af89f8610d07275f290819e64f96775292f7R155
Hopefully it will be easier to find as based on the incoming issues, the section at the end of the page was easily overlooked.