From 63ed251266077130df2d3a329b28bd4718163a8c Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Tue, 12 Nov 2024 17:42:41 +0200 Subject: [PATCH] Fix: Aligns Android autoupload logic with iOS (#4262) * Aligns Android autoupload logic with iOS * fix(gradle): DISABLE_NATIVE_UPLOAD should not affect JS source maps upload (#4263) --------- Co-authored-by: Krystof Woldrich <31292499+krystofwoldrich@users.noreply.github.com> --- packages/core/sentry.gradle | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/core/sentry.gradle b/packages/core/sentry.gradle index e5630ef458..f0adc88a7f 100644 --- a/packages/core/sentry.gradle +++ b/packages/core/sentry.gradle @@ -3,9 +3,16 @@ import org.apache.tools.ant.taskdefs.condition.Os import java.util.regex.Matcher import java.util.regex.Pattern +project.ext.shouldSentryAutoUploadNative = { -> + return System.getenv('SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD') != 'true' +} + +project.ext.shouldSentryAutoUploadGeneral = { -> + return System.getenv('SENTRY_DISABLE_AUTO_UPLOAD') != 'true' +} + project.ext.shouldSentryAutoUpload = { -> - return System.getenv('SENTRY_DISABLE_AUTO_UPLOAD') != 'true' || - System.getenv('SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD') != 'true' + return shouldSentryAutoUploadGeneral() && shouldSentryAutoUploadNative() } def config = project.hasProperty("sentryCli") ? project.sentryCli : []; @@ -99,7 +106,7 @@ gradle.projectsEvaluated { /** Upload source map file to the sentry server via CLI call. */ def cliTask = tasks.create(nameCliTask) { - onlyIf { shouldSentryAutoUpload() } + onlyIf { shouldSentryAutoUploadGeneral() } description = "upload debug symbols to sentry" group = 'sentry.io'