Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ high_risk_code: &high_risk_code
# Source Maps and Native Debug Files Autoupload
- 'scripts/sentry-xcode.sh'
- 'scripts/sentry-xcode-debug-files.sh'
- 'sentry.gradle'
- 'sentry.gradle.kts'

# --- Platform-specific filters for CI optimization ---
# Used by detect-changes.yml to skip platform-irrelevant CI jobs.
Expand All @@ -32,7 +32,7 @@ ios_native:
android_native:
- 'packages/core/android/**'
- 'packages/core/RNSentryAndroidTester/**'
- 'packages/core/sentry.gradle'
- 'packages/core/sentry.gradle.kts'

# Changes to JS/TS source code (affects ALL platforms)
js_source:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
- Fix duplicate JS error reporting on iOS New Architecture when the native SDK is initialized early via `sentry.options.json` ("Capture App Start Errors"). It's done by applying the `ExceptionsManager.reportException` C++ wrapper filter in both init paths ([#6145](https://github.com/getsentry/sentry-react-native/pull/6145))
- Fix boolean options from `sentry.options.json` being ignored on Android when using `RNSentrySDK.init` ([#6130](https://github.com/getsentry/sentry-react-native/pull/6130))

### Internal

- Convert `sentry.gradle` to Kotlin DSL (`sentry.gradle.kts`) ([#6119](https://github.com/getsentry/sentry-react-native/pull/6119))
- The old `sentry.gradle` is kept as a shim forwarding to the new `.kts` file for backward compatibility

### Dependencies

- Bump JavaScript SDK from v10.51.0 to v10.53.1 ([#6108](https://github.com/getsentry/sentry-react-native/pull/6108), [#6139](https://github.com/getsentry/sentry-react-native/pull/6139))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (!args['app-build-gradle']) {
debug.log('Patching app/build.gradle', args['app-build-gradle']);

const sentryGradlePatch = `
apply from: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../sentry.gradle")
apply from: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../sentry.gradle.kts")
`;
const reactNativeGradleRex = /^android {/m;

Expand Down
1 change: 1 addition & 0 deletions packages/core/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
!ts3.8/**/*
!RNSentry.podspec
!sentry.gradle
!sentry.gradle.kts
!react-native.config.js
!/ios/**/*
!/android/**/*
Expand Down
10 changes: 8 additions & 2 deletions packages/core/plugin/src/withSentryAndroid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ const resolveSentryReactNativePackageJsonPath =
* adding the relevant @sentry/react-native script.
*/
export function modifyAppBuildGradle(buildGradle: string): string {
if (buildGradle.includes('sentry.gradle')) {
if (buildGradle.includes('sentry.gradle.kts')) {
return buildGradle;
}

// Migrate old sentry.gradle references to sentry.gradle.kts
// Use a regex to avoid matching package names like io.sentry.android.gradle
if (/(?<=[/"'])sentry\.gradle(?!\.kts)/.test(buildGradle)) {
return buildGradle.replace(/(?<=[/"'])sentry\.gradle(?!\.kts)/g, 'sentry.gradle.kts');
}

// Use the same location that sentry-wizard uses
// See: https://github.com/getsentry/sentry-wizard/blob/e9b4522f27a852069c862bd458bdf9b07cab6e33/lib/Steps/Integrations/ReactNative.ts#L232
const pattern = /^android {/m;
Expand All @@ -55,7 +61,7 @@ export function modifyAppBuildGradle(buildGradle: string): string {
return buildGradle;
}

const applyFrom = `apply from: new File(${resolveSentryReactNativePackageJsonPath}, "sentry.gradle")`;
const applyFrom = `apply from: new File(${resolveSentryReactNativePackageJsonPath}, "sentry.gradle.kts")`;

return buildGradle.replace(pattern, match => `${applyFrom}\n\n${match}`);
}
Expand Down
589 changes: 1 addition & 588 deletions packages/core/sentry.gradle

Large diffs are not rendered by default.

Loading
Loading