From 2ec71da2fbe36565c59c20f960c72fc75737275c Mon Sep 17 00:00:00 2001 From: omidshafaei Date: Mon, 7 Oct 2024 20:16:26 +0330 Subject: [PATCH 1/3] fix: Upload source maps for Android splits separately (#4125) --- CHANGELOG.md | 6 ++++++ sentry.gradle | 9 +++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8bb13270..fb4760024 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixes + +- Upload source maps for all release variants on Android (not only the last found) ([#4125](https://github.com/getsentry/sentry-react-native/pull/4125)) + ## 5.33.2 ### Fixes diff --git a/sentry.gradle b/sentry.gradle index 99f2bafdf..640f9a3b2 100644 --- a/sentry.gradle +++ b/sentry.gradle @@ -65,9 +65,6 @@ gradle.projectsEvaluated { def currentVariants = extractCurrentVariants(bundleTask, releases) if (currentVariants == null) return - def variant = null - def releaseName = null - def versionCode = null def previousCliTask = null def applicationVariant = null @@ -75,9 +72,9 @@ gradle.projectsEvaluated { def nameModulesCleanup = "${bundleTask.name}_SentryCollectModulesCleanUp" // Upload the source map several times if necessary: once for each release and versionCode. currentVariants.each { key, currentVariant -> - variant = currentVariant[0] - releaseName = currentVariant[1] - versionCode = currentVariant[2] + def variant = currentVariant[0] + def releaseName = currentVariant[1] + def versionCode = currentVariant[2] applicationVariant = currentVariant[3] try { From ba46d3f9965b5efe8281c4474176677b174764c7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:34:55 +0300 Subject: [PATCH 2/3] chore: update scripts/update-cli.sh to 2.37.0 (#4153) Co-authored-by: GitHub --- CHANGELOG.md | 6 ++++ package.json | 2 +- yarn.lock | 92 ++++++++++++++++++++++++++-------------------------- 3 files changed, 53 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb4760024..3852fef15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ - Upload source maps for all release variants on Android (not only the last found) ([#4125](https://github.com/getsentry/sentry-react-native/pull/4125)) +### Dependencies + +- Bump CLI from v2.36.6 to v2.37.0 ([#4153](https://github.com/getsentry/sentry-react-native/pull/4153)) + - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2370) + - [diff](https://github.com/getsentry/sentry-cli/compare/2.36.6...2.37.0) + ## 5.33.2 ### Fixes diff --git a/package.json b/package.json index 859abb9ad..e14fee1da 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "dependencies": { "@sentry/babel-plugin-component-annotate": "2.20.1", "@sentry/browser": "7.119.1", - "@sentry/cli": "2.36.6", + "@sentry/cli": "2.37.0", "@sentry/core": "7.119.1", "@sentry/hub": "7.119.0", "@sentry/integrations": "7.119.0", diff --git a/yarn.lock b/yarn.lock index 5bab8bded..cb86e5e0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3827,45 +3827,45 @@ "@sentry/types" "7.119.1" "@sentry/utils" "7.119.1" -"@sentry/cli-darwin@2.36.6": - version "2.36.6" - resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.36.6.tgz#c023d9552e141144dfb6512389fa253611be5877" - integrity sha512-2yKECENqMZKrJY5weA19g4gTgQfeuadWvVu7fVQVsgqoBRIaEhSHJc64ZgiHq2ur06qOuYcQr5FO1VrwUE1pZg== - -"@sentry/cli-linux-arm64@2.36.6": - version "2.36.6" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.36.6.tgz#6f0c604b5401441e62e89c3fe4450784dd93fda6" - integrity sha512-sLmmbZRE7F6UksovwcqEQ7oYXVBejpeL1CtiKVFwNoq9XB5kTiKlVColn+3yPcfwKCNj4H4HoeKc+xMtdd7wow== - -"@sentry/cli-linux-arm@2.36.6": - version "2.36.6" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.36.6.tgz#9cc4b041fc8e20e52f745128aa8acff2b3783fa9" - integrity sha512-6zB7w5NawmdzhPHxqkjlhbvQugCBiFrFaUGvb3u1Oo/VCehdmq/v4v8ob4PNN2cJhoDRqQj2mPTfL/ppYNMJuw== - -"@sentry/cli-linux-i686@2.36.6": - version "2.36.6" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.36.6.tgz#7c7b1c0ac83f89eda844586d51809797a868827b" - integrity sha512-M1pdxv7eZdGoG1wDpRb28aRUs/qb0C5jAe+a7sWHIg463jRLAahM8NDkv2bRQv0Xhw3JIkEGGvr46mPkQrOuMQ== - -"@sentry/cli-linux-x64@2.36.6": - version "2.36.6" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.36.6.tgz#eaec558b30acec0a295f737558db3a640cc02906" - integrity sha512-gVy/zAWY2DEERQ/i3V+oruMas/U29/tsRPcRkB67MIUWbW7W46+c3yH490O+t49qMYYhKYG2YfWoTzW6qMtSlA== - -"@sentry/cli-win32-i686@2.36.6": - version "2.36.6" - resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.36.6.tgz#29f586279e354c6fad932d09da5f32e57e883caf" - integrity sha512-urH+i+WtPeW8Dund0xY8zObvvbMM0XxeEIUS4oFBCB3EMYHVxgNw+woQUv9Vyv7v+OBjckB/r27nxlwNBj4pbg== - -"@sentry/cli-win32-x64@2.36.6": - version "2.36.6" - resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.36.6.tgz#b283460682a0cb824c4e16fc803de5f538bd1fcb" - integrity sha512-ZauqOqwFAqb/Njyc8Kj2l9Fhbms7T5zB2yu5zwvq1uiqhXqLmsb9mRTF8WJWl9WmO5hwq/GTOEQowvrwK8gblw== - -"@sentry/cli@2.36.6": - version "2.36.6" - resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.36.6.tgz#116d2441b7e3ac49d4d5b4c09ed8e00ac9c8a67e" - integrity sha512-1fcZVwe4H6a3Z1O+7m/z/2em1u67Tf0Zrt2oGEp82bqvCOHA904Wr2otc6GBEuFESB1/Mo8QgD/qwRd9Tv0Otw== +"@sentry/cli-darwin@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.37.0.tgz#9c890c68abf30ceaad27826212a0963b125b8bbf" + integrity sha512-CsusyMvO0eCPSN7H+sKHXS1pf637PWbS4rZak/7giz/z31/6qiXmeMlcL3f9lLZKtFPJmXVFO9uprn1wbBVF8A== + +"@sentry/cli-linux-arm64@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.37.0.tgz#2070155bade6d72d6b706807c6f365c65f9b82ea" + integrity sha512-2vzUWHLZ3Ct5gpcIlfd/2Qsha+y9M8LXvbZE26VxzYrIkRoLAWcnClBv8m4XsHLMURYvz3J9QSZHMZHSO7kAzw== + +"@sentry/cli-linux-arm@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.37.0.tgz#a08c2133e8e2566074fd6fe4f68e9ffd0c85664a" + integrity sha512-Dz0qH4Yt+gGUgoVsqVt72oDj4VQynRF1QB1/Sr8g76Vbi+WxWZmUh0iFwivYVwWxdQGu/OQrE0tx946HToCRyA== + +"@sentry/cli-linux-i686@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.37.0.tgz#53fff0e7f232b656b0ee3413b66006ee724a4abf" + integrity sha512-MHRLGs4t/CQE1pG+mZBQixyWL6xDZfNalCjO8GMcTTbZFm44S3XRHfYJZNVCgdtnUP7b6OHGcu1v3SWE10LcwQ== + +"@sentry/cli-linux-x64@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.37.0.tgz#2fbaf51ef3884bd6561c987f01ac98f544457150" + integrity sha512-k76ClefKZaDNJZU/H3mGeR8uAzAGPzDRG/A7grzKfBeyhP3JW09L7Nz9IQcSjCK+xr399qLhM2HFCaPWQ6dlMw== + +"@sentry/cli-win32-i686@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.37.0.tgz#fa195664da27ce8c40fdb6db1bf1d125cdf587d9" + integrity sha512-FFyi5RNYQQkEg4GkP2f3BJcgQn0F4fjFDMiWkjCkftNPXQG+HFUEtrGsWr6mnHPdFouwbYg3tEPUWNxAoypvTw== + +"@sentry/cli-win32-x64@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.37.0.tgz#84fa4d070b8a4a115c46ab38f42d29580143fd26" + integrity sha512-nSMj4OcfQmyL+Tu/jWCJwhKCXFsCZW1MUk6wjjQlRt9SDLfgeapaMlK1ZvT1eZv5ZH6bj3qJfefwj4U8160uOA== + +"@sentry/cli@2.37.0": + version "2.37.0" + resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.37.0.tgz#dd01e933cf1caed7d7b6abab5a96044fe1c9c7a1" + integrity sha512-fM3V4gZRJR/s8lafc3O07hhOYRnvkySdPkvL/0e0XW0r+xRwqIAgQ5ECbsZO16A5weUiXVSf03ztDL1FcmbJCQ== dependencies: https-proxy-agent "^5.0.0" node-fetch "^2.6.7" @@ -3873,13 +3873,13 @@ proxy-from-env "^1.1.0" which "^2.0.2" optionalDependencies: - "@sentry/cli-darwin" "2.36.6" - "@sentry/cli-linux-arm" "2.36.6" - "@sentry/cli-linux-arm64" "2.36.6" - "@sentry/cli-linux-i686" "2.36.6" - "@sentry/cli-linux-x64" "2.36.6" - "@sentry/cli-win32-i686" "2.36.6" - "@sentry/cli-win32-x64" "2.36.6" + "@sentry/cli-darwin" "2.37.0" + "@sentry/cli-linux-arm" "2.37.0" + "@sentry/cli-linux-arm64" "2.37.0" + "@sentry/cli-linux-i686" "2.37.0" + "@sentry/cli-linux-x64" "2.37.0" + "@sentry/cli-win32-i686" "2.37.0" + "@sentry/cli-win32-x64" "2.37.0" "@sentry/cli@^1.72.0": version "1.74.6" From 46b60abf2a15521db82890ffba94d955f560c92a Mon Sep 17 00:00:00 2001 From: Krystof Woldrich <31292499+krystofwoldrich@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:08:05 +0200 Subject: [PATCH 3/3] misc: Add easy enabled splits and flavors in RN Android samples (#4157) --- samples/react-native/android/app/build.gradle | 33 +++++++++++++++++++ samples/react-native/package.json | 3 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/samples/react-native/android/app/build.gradle b/samples/react-native/android/app/build.gradle index bc7b484bb..2cde7445c 100644 --- a/samples/react-native/android/app/build.gradle +++ b/samples/react-native/android/app/build.gradle @@ -146,6 +146,39 @@ android { keyPassword 'android' } } + + if (System.getenv('SENTRY_SAMPLE_ENABLE_ABI_SPLIT') == 'true') { + splits { + abi { + enable true + reset() + include 'x86', 'arm64-v8a' + universalApk true + } + } + project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9] + android.applicationVariants.all { variant -> + variant.outputs.each { output -> + output.versionCodeOverride = + project.ext.versionCodes.get(output.getFilter( + com.android.build.OutputFile.ABI), 0) * 10000000 + android.defaultConfig.versionCode + } + } + } + + if (System.getenv('SENTRY_SAMPLE_ENABLE_FLAVORS') == 'true') { + flavorDimensions "version" + productFlavors { + regular { + dimension "version" + } + demo { + dimension "version" + applicationIdSuffix "demo" + } + } + } + buildTypes { debug { signingConfig signingConfigs.debug diff --git a/samples/react-native/package.json b/samples/react-native/package.json index a4567bcac..53c0d28f6 100644 --- a/samples/react-native/package.json +++ b/samples/react-native/package.json @@ -17,7 +17,8 @@ "clean-watchman": "watchman watch-del-all", "set-build-number": "npx react-native-version --skip-tag --never-amend --set-build", "set-version": "npm version --no-git-tag-version", - "postversion": "npx react-native-version --skip-tag --never-amend" + "postversion": "npx react-native-version --skip-tag --never-amend", + "build-android-release-splits-flavors": "export SENTRY_SAMPLE_ENABLE_ABI_SPLIT=true; export SENTRY_SAMPLE_ENABLE_FLAVORS=true; cd android; ./gradlew assembleRelease; cd .." }, "dependencies": { "@react-navigation/bottom-tabs": "^6.5.12",