Skip to content

Commit da847d2

Browse files
runningcodeclaude
andauthored
feat(snapshot): Register sentryUploadSnapshots for all variants (#1135)
* feat(snapshot): Register sentryUploadSnapshots for all variants The sentryUploadSnapshots task is now registered outside the variant filter so it is available for all variants, including those in ignoredVariants/ignoredBuildTypes/ignoredFlavors. Since this task is never auto-wired to assemble/bundle tasks and must be explicitly invoked, there is no risk of accidental uploads for ignored variants. Telemetry is passed as null since it is configured per-variant inside the filter block and the register function already supports nullable telemetry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: Apply spotless formatting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 25070c3 commit da847d2

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

plugin-build/src/main/kotlin/io/sentry/android/gradle/AndroidComponentsConfig.kt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ fun ApplicationAndroidComponentsExtension.configure(
7878
}
7979
}
8080

81+
variant.configureSnapshotsTasks(project, extension, cliExecutable, sentryOrg, sentryProject)
82+
8183
if (isVariantAllowed(extension, variant.name, variant.flavorName, variant.buildType)) {
8284
val paths = OutputPaths(project, variant.name)
8385
val sentryTelemetryProvider =
@@ -142,15 +144,6 @@ fun ApplicationAndroidComponentsExtension.configure(
142144
sentryProject,
143145
)
144146

145-
variant.configureSnapshotsTasks(
146-
project,
147-
extension,
148-
sentryTelemetryProvider,
149-
cliExecutable,
150-
sentryOrg,
151-
sentryProject,
152-
)
153-
154147
// we can't hook into asset generation, nor manifest merging, as all those tasks
155148
// are dependencies of the compilation / minification task
156149
// and as our ProGuard UUID depends on minification itself; creating a
@@ -465,7 +458,6 @@ private fun ApplicationVariant.configureDistributionPropertiesTask(
465458
private fun ApplicationVariant.configureSnapshotsTasks(
466459
project: Project,
467460
extension: SentryPluginExtension,
468-
sentryTelemetryProvider: Provider<SentryTelemetryService>,
469461
cliExecutable: Provider<String>,
470462
sentryOrg: String?,
471463
sentryProject: String?,
@@ -476,7 +468,7 @@ private fun ApplicationVariant.configureSnapshotsTasks(
476468
return SentryUploadSnapshotsTask.register(
477469
project = project,
478470
extension = extension,
479-
sentryTelemetryProvider = sentryTelemetryProvider,
471+
sentryTelemetryProvider = null,
480472
cliExecutable = cliExecutable,
481473
sentryOrgOverride = sentryOrg,
482474
sentryProjectOverride = sentryProject,

0 commit comments

Comments
 (0)