paparazzi
paparazzi copied to clipboard
./gradlew clean leaves traces
Description
When I do a gradlew clean
I expect a clean slate. Regardless of what plugins are applied.
Steps to Reproduce
- Any project having Paparazzi.
-
gradlew recordPaparazziDebug
- Make a change that would fail verification
-
gradlew verifyPaparazziDebug
- output is in
path/to/module/out/failures
-
gradlew clean
Expected behavior Any output from the Gradle execution is cleaned at the end.
Additional information:
- Paparazzi Version: 1.0
- OS: any
- Compile SDK: N/A
- Gradle Version: Gradle 7.4 (but I observed it a few months ago on 6.9.x as well)
- Android Gradle Plugin Version: 7.2.1
Workaround
// In every module that has app.cash.paparazzi plugin applied.
target.tasks.named<Delete>("clean") {
delete(project.file("out/failures"))
}
Suggestion
Don't use hardcoded paths like out/failures
, put the failed diffs into some ${project.buildDir}/.../paparazzi folder
. Try not to hardcode build/...
either, because it's relocatable (see org.gradle.api.Project#setBuildDir(java.io.File)
).
In addition to this, I would also expect the out/failures
folder to be cleared automatically before running verifyPaparazzi
again.
I currently have to clean this folder manually to only have a list of failed test images of the last verify run.
Suggestion: Clean up out/failure
first when verifyPaparazzi
is executed.