Skip to content

Commit

Permalink
Fix: Aligns Android autoupload logic with iOS (#4262)
Browse files Browse the repository at this point in the history
* Aligns Android autoupload logic with iOS

* fix(gradle): DISABLE_NATIVE_UPLOAD should not affect JS source maps upload (#4263)

---------

Co-authored-by: Krystof Woldrich <[email protected]>
  • Loading branch information
antonis and krystofwoldrich authored Nov 12, 2024
1 parent 7bc4d75 commit 63ed251
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/core/sentry.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 : [];
Expand Down Expand Up @@ -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'

Expand Down

0 comments on commit 63ed251

Please sign in to comment.