-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
Disable sourcemaps file upload for debug builds #525
Comments
/* Disable Sentry tasks for test environments / flavors. */
gradle.projectsEvaluated {
// Grab all build types and product flavors
def buildTypes = android.buildTypes.collect { type -> type.name }
def productFlavors = android.productFlavors.collect { flavor -> flavor.name }
// When no product flavors defined, use empty
if (!productFlavors) productFlavors.add("")
productFlavors.each { flavor ->
buildTypes.each { buildt ->
def isEnabled = !isTestEnvironment(flavor.toString())
/* disable sentry tasks for test environments */
[
"bundle${flavor.capitalize()}${buildt.capitalize()}JsAndAssets${flavor}-${buildt}SentryUpload",
"bundle${flavor.capitalize()}${buildt.capitalize()}JsAndAssets${flavor}-${buildt}SentryUploadCleanUp",
].each { name ->
def task = tasks.findByPath(name)
if (null != task) {
task.enabled = isEnabled
task.group = "sentry.io"
}
}
}
}
}
/** Is flavor variation recognized as test environment. */
static isTestEnvironment(variantName) {
return variantName.startsWith("appium")
}
|
A shorter version: gradle.projectsEvaluated {
def tasksToSkip = project.tasks.matching {
it.name.contains("SentryUpload") &&
it.name.contains("Debug")
}
tasksToSkip.all { enabled = false }
} |
So I should directly modify ./node_modules/react-native-sentry/sentry.gradle? Is there a way to do this in my main build.gradle or app/build.gradle? |
@jussirantala you can place this code into |
I added it at the end of the file but nothing changed |
Since version https://github.com/getsentry/react-native-sentry/blob/master/CHANGELOG.md#0420 Edit: This is PR that fixed this: #546 |
cool, thanks @OleksandrKucherenko |
Any idea how to also prevent uploading to sentry just from running UnitTests? Every prod release it uploads twice. first for the job running the unit tests and then secondly for the actual app bundle job. |
Just in case, the code @sorrat mentioned should be added after this line: So it would be like this: |
Hello everyone, Read more at https://docs.sentry.io/platforms/react-native/sourcemaps/#disable-automatic-upload |
Is there a way to disable uploading sourcemaps for android and iOS debug builds?
I can add add
if [ "${CONFIGURATION}" = "Release" ]; then ...
check for ios run script but I don't understand why does that even run in debug schemeThe text was updated successfully, but these errors were encountered: