Commit a02999b
feat(snapshot): Merge snapshot extension into main sentry DSL (#1136)
* feat(snapshot): Merge snapshot extension into main sentry DSL
Move snapshot configuration from the standalone `sentrySnapshot` plugin
into the main `sentry { snapshots { } }` extension. This consolidates
the DSL surface and auto-detects Paparazzi for test generation.
- Add `SnapshotsExtension` nested under `SentryPluginExtension`
- Move Paparazzi detection and test generation wiring into `SentryPlugin`
- Wire `sentryUploadSnapshots` task to Paparazzi output directory
- Rename generate task to `sentryGenerateSnapshotsTests` for consistency
- Remove standalone `SentrySnapshotPlugin` and `SentrySnapshotExtension`
- Use plural "snapshots" naming consistently
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(snapshot): Wire upload task to test task output
Use dependsOn to ensure Paparazzi record task runs before upload,
and derive snapshotsPath from the test task's output directory
instead of a hardcoded path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(snapshot): Add enabled flag to snapshots extension
Gate test generation and dependency addition on snapshots.enabled
so that applying Paparazzi alongside the Sentry plugin doesn't
affect normal Paparazzi task execution. Defaults to false.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(snapshot): Remove stale distribution config for deleted plugin
Remove the sentrySnapshotPlugin marker distribution and publication
task references that were left behind when the plugin was removed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(snapshot): Gate upload task registration on snapshots.enabled
The upload task and its Paparazzi wiring were registered
unconditionally for all variants. This caused projects using both
the Sentry plugin and Paparazzi to get unwanted task dependencies
even with snapshots disabled.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(snapshot): Move dependency addition outside onVariants loop
testImplementation is a global configuration, not per-variant.
Move the ComposablePreviewScanner dependency addition to
afterEvaluate (gated on enabled) so it runs once instead of
once per variant.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* release: 6.4.0-alpha.5
* fix(snapshot): Defer test task lookup to afterEvaluate
The testDebugUnitTest task is not yet registered by AGP when
onVariants runs. Wrap the Paparazzi wiring in afterEvaluate so
the test task exists when we look it up.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(snapshot): Consolidate all snapshot logic in AndroidComponentsConfig
Move test generation, dependency addition, and upload task wiring
into configureSnapshotsTasks so all snapshot logic lives in one
place. Use the AGP hostTests/unitTest API for generated source
wiring, and afterEvaluate for the test task output lookup.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: Remove snapshot changelog entry
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style(snapshot): Apply spotless formatting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(snapshot): Guard against missing unit test tasks
Not all variants have unit test tasks (e.g. users can disable them),
so skip wiring the snapshot upload task if the test task doesn't exist.
Uses tasks.names to avoid eagerly realizing tasks.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(snapshot): Remove unnecessary afterEvaluate for dependency addition
Adding the testImplementation dependency inside a nested afterEvaluate
risks the configuration already being resolved and immutable. The
withPlugin callback already fires during configuration, so the wrapper
is unnecessary.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(snapshot): Move dependency addition outside per-variant loop
The testImplementation dependency for ComposablePreviewScanner was
being added N times (once per variant) since configureSnapshotsTasks
runs inside onVariants. Move it to a single withPlugin block before
onVariants to add it only once.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Revert "fix(snapshot): Move dependency addition outside per-variant loop"
This reverts commit f77e724.
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: runningcode <332597+runningcode@users.noreply.github.com>
Co-authored-by: sentry-release-bot[bot] <180476844+sentry-release-bot[bot]@users.noreply.github.com>1 parent da847d2 commit a02999b
9 files changed
Lines changed: 100 additions & 105 deletions
File tree
- plugin-build
- src/main/kotlin/io/sentry/android/gradle
- extensions
- snapshot
- sentry-kotlin-compiler-plugin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
3 | 12 | | |
4 | 13 | | |
5 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 167 | | |
172 | 168 | | |
173 | 169 | | |
| |||
205 | 201 | | |
206 | 202 | | |
207 | 203 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | 204 | | |
212 | 205 | | |
213 | 206 | | |
| |||
257 | 250 | | |
258 | 251 | | |
259 | 252 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | 253 | | |
269 | 254 | | |
270 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
Lines changed: 72 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| |||
461 | 467 | | |
462 | 468 | | |
463 | 469 | | |
464 | | - | |
| 470 | + | |
465 | 471 | | |
466 | 472 | | |
| 473 | + | |
467 | 474 | | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
479 | 538 | | |
480 | 539 | | |
481 | 540 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 9 | | |
13 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | | - | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
Lines changed: 0 additions & 66 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments