Commit ec8a132
feat(snapshots): Emit diff_threshold in snapshot sidecar (EME-1055)
The generated Paparazzi test now reflects on each @Preview to read an
optional @SentrySnapshot(diffThreshold) annotation and writes the value
as "diff_threshold" in the per-snapshot sidecar JSON, but only when the
annotation is present and the threshold differs from the 0f default.
Changes SentrySnapshot's retention from BINARY to RUNTIME so the JVM
retains it for reflection. Java's Method.getAnnotation cannot see
CLASS/BINARY-retained annotations.
The lookup is guarded by runCatching so a missing runtime jar or a
class-loading failure degrades to "field omitted" rather than a test
failure.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0d949ec commit ec8a132
4 files changed
Lines changed: 33 additions & 1 deletion
File tree
- plugin-build/src
- main/kotlin/io/sentry/android/gradle/snapshot
- test/kotlin/io/sentry/android/gradle/snapshot
- sentry-snapshots-runtime/src/main/kotlin/io/sentry/snapshots/runtime
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
379 | 390 | | |
380 | 391 | | |
381 | 392 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
129 | 149 | | |
130 | 150 | | |
131 | 151 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments