Add roborazzi.compare.output.dir gradle.properties #592
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Behavior Changes to
roborazzi.outputDir.set(file("somedir"))
inbuild.gradle
Previously, when modifying
roborazzi.outputDir
, such as setting it tosrc/screenshots
, this option also affected the paths for comparison images, likefoo_compare.png
. This behavior often caused issues, such as unintentionally saving comparison images to version control systems (e.g., Git). To address this, we have discontinued this behavior. Comparison images are now saved inbuild/outputs/roborazzi
by default, while the behavior for reference images remains unchanged.For users who wish to customize the path for comparison images, we have introduced a new option:
roborazzi.compare.outputDir
.While I don't believe there are strong use cases for this, if you want to save the comparison images in a custom directory as you did before, you can specify
roborazzi.compare.outputDir
as follows:I believe this adjustment will be highly beneficial for most use cases involving changes to
outputDir
.Note
By default, when you use
captureRoboImage("image.png")
, the image will be saved asmodule/image.png
.You can customize the file path strategy for the recorded image. The default strategy is
relativePathFromCurrentDirectory
. If you selectrelativePathFromRoborazziContextOutputDirectory
, the file will be saved in the output directory specified byroborazzi.outputDir
.This can be configured in your
gradle.properties
file:roborazzi.record.filePathStrategy=relativePathFromRoborazziContextOutputDirectory