diff --git a/src/platforms/android/common/gradle.mdx b/src/platforms/android/common/gradle.mdx index 3954310254949..6d47e4ba6207d 100644 --- a/src/platforms/android/common/gradle.mdx +++ b/src/platforms/android/common/gradle.mdx @@ -8,6 +8,7 @@ The [Sentry Android Gradle Plugin](https://github.com/getsentry/sentry-android-g seamless integration with the Gradle build system. It supports the following features: - ProGuard/R8 mappings upload +- Java/Kotlin Source Context upload - Native debug symbols and sources upload - Auto-instrumentation tracing through bytecode manipulation - Logcat breadcrumb logging @@ -85,6 +86,11 @@ sentry { // Default is disabled. uploadNativeSymbols = false + // Generates a source bundle and uploads your source code to Sentry. + // This enables source context, allowing you to see your source + // code as part of your stack traces in Sentry. + includeSourceContext = false + // Does or doesn't include the source code of native code for Sentry. // This executes sentry-cli with the --include-sources param. automatically so // you don't need to do it manually. @@ -168,6 +174,11 @@ sentry { // Default is disabled. uploadNativeSymbols.set(false) + // Generates a source bundle and uploads your source code to Sentry. + // This enables source context, allowing you to see your source + // code as part of your stack traces in Sentry. + includeSourceContext.set(false) + // Does or doesn't include the source code of native code for Sentry. // This executes sentry-cli with the --include-sources param. automatically so // you don't need to do it manually. @@ -288,6 +299,24 @@ You can find your authentication token [on the Sentry API page](https://sentry.i +## Java/Kotlin Source Context + +The plugin can automatically upload your source code to Sentry so it can be shown as part of the stacktraces. + +```groovy +sentry { + includeSourceContext = true +} +``` + +```kotlin +sentry { + includeSourceContext.set(true) +} +``` + +Checkout the full documentation on Source Context for more details. + ## Tracing Auto-instrumentation The plugin uses the [bytecode manipulation](https://www.infoq.com/articles/Living-Matrix-Bytecode-Manipulation/) framework to inject a code snippet