diff --git a/sentry-android-core/build.gradle.kts b/sentry-android-core/build.gradle.kts index f61cec8926..abcca4f883 100644 --- a/sentry-android-core/build.gradle.kts +++ b/sentry-android-core/build.gradle.kts @@ -70,6 +70,13 @@ tasks.withType().configureEach { } } +// Snapshot PNGs are written by ScreenshotEventProcessorTest at runtime but must be declared as +// outputs so Gradle's build cache restores them on cache hits (otherwise the CLI upload step +// finds an empty directory). +tasks + .matching { it.name == "testDebugUnitTest" || it.name == "testReleaseUnitTest" } + .configureEach { outputs.dir(layout.buildDirectory.dir("test-snapshots")) } + dependencies { api(projects.sentry) compileOnly(libs.jetbrains.annotations)