Skip to content

Commit f8b12ef

Browse files
authored
Add NDK references to source context setup (#7472)
1 parent df9bc80 commit f8b12ef

File tree

1 file changed

+54
-0
lines changed
  • src/platform-includes/source-context

1 file changed

+54
-0
lines changed

src/platform-includes/source-context/java.mdx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,48 @@ sentry {
194194

195195
</PlatformSection>
196196

197+
<PlatformSection supported={["android"]}>
198+
199+
### Include NDK Source Context with Gradle Plugin
200+
201+
By default native code (C/C++) is not uploaded with the Java/Kotlin code. Add the following options to enable Source Context for native code:
202+
203+
```groovy
204+
sentry {
205+
// Includes the source code of native code when uploading native symbols for Sentry.
206+
// This executes sentry-cli with the --include-sources param. automatically so
207+
// you don't need to do it manually. This only works with uploadNativeSymbols enabled.
208+
//
209+
// Default is disabled.
210+
includeNativeSources = true
211+
212+
// Enables the automatic configuration of Native Symbols for Sentry.
213+
// This executes sentry-cli automatically so you don't need to do it manually.
214+
//
215+
// Default is disabled.
216+
uploadNativeSymbols = true
217+
}
218+
```
219+
220+
```kotlin
221+
sentry {
222+
// Includes the source code of native code when uploading native symbols for Sentry.
223+
// This executes sentry-cli with the --include-sources param. automatically so
224+
// you don't need to do it manually. This only works with uploadNativeSymbols enabled.
225+
//
226+
// Default is disabled.
227+
includeNativeSources.set(true)
228+
229+
// Enables the automatic configuration of Native Symbols for Sentry.
230+
// This executes sentry-cli automatically so you don't need to do it manually.
231+
//
232+
// Default is disabled.
233+
uploadNativeSymbols.set(true)
234+
}
235+
```
236+
237+
</PlatformSection>
238+
197239
<PlatformSection notSupported={["android"]}>
198240

199241
## Using the Maven Build Tool Plugin
@@ -310,3 +352,15 @@ sentry.bundle-ids=A_VALID_UUID`
310352
```Java
311353
options.addBundleId("A_VALID_UUID");
312354
```
355+
356+
<PlatformSection supported={["android"]}>
357+
358+
## Manually Uploading Debug Symbols and Native Source Code
359+
360+
Upload the native debug symbols manually using the `debug-files upload command`. Adding the `--include-sources` flag, sentry-cli will automatically generate source bundles on the fly and upload them. Here's a typical example for Android:
361+
362+
```
363+
sentry-cli debug-files upload app/build/intermediates/merged_native_libs/ --include-sources
364+
```
365+
366+
</PlatformSection>

0 commit comments

Comments
 (0)