ref(proguard): Detect mappings from produced artifacts - #1377
ref(proguard): Detect mappings from produced artifacts#1377sentry-junior[bot] wants to merge 11 commits into
Conversation
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0379c48. Configure here.
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
0xadam-brown
left a comment
There was a problem hiding this comment.
A few quick comments; otherwise lgtm (and also prefer this route to #1376) 👍
| try { | ||
| mappingFile.orNull?.asFile?.takeIf { it.exists() } | ||
| ?: fallbackMappingFiles.files.firstOrNull { it.exists() } | ||
| } catch (_: GradleException) { |
There was a problem hiding this comment.
Can we narrow these to the known “provider has no value” / missing-artifact cases (and rethrow anything else)? Worried we might suppress exceptions we shouldn't....
| @@ -374,9 +374,10 @@ class SentryPluginTest : | |||
|
|
|||
There was a problem hiding this comment.
Looks like we should also update creates proguard mapping tasks when app optimization is enabled() above. (It's still limited to --dry-run task-name presence, so presumably will pass even if execution-time detection never consumes a produced mapping.)

Detect ProGuard/R8 mapping availability from the produced mapping artifact instead of AGP minification flags. This removes the AGP 9.3 internal reflection boundary and should naturally support future optimization DSL changes.
Lazy mapping tasks
Mapping UUID and upload tasks are registered whenever mapping support is enabled, then skipped when no mapping file exists. Non-minified builds keep producing no UUID and no upload, while optimized builds use the existing artifact wiring.
Compatibility
The existing AGP 8.3+
toListenTopath and pre-8.3/DexGuard task wiring remain intact. The branch is based on #1376 so the design can be reviewed independently before deciding whether to replace that targeted fix.Compilation succeeded. Targeted tests reached test compilation but the sandbox Gradle daemon was killed before execution; the Android integration test could not run because the sandbox has no Android SDK.
#skip-changelog
Requested by Roman Zavarnitsyn.
--
View Junior Session Sentry