Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot output directory should be a task input not output #852

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ class PaparazziPlugin : Plugin<Project> {
test.inputs.files(nativePlatformFileCollection)
.withPropertyName("paparazzi.nativePlatform")
.withPathSensitivity(PathSensitivity.NONE)
test.inputs.files(snapshotOutputDir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "side note" as a comment here to prevent inadvertent future "optimizations"?

.withPropertyName("paparazzi.snapshot.output.dir")
.withPathSensitivity(PathSensitivity.RELATIVE)

test.outputs.dir(reportOutputDir)
test.outputs.dir(snapshotOutputDir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling this ambiguity comes from the fact that the same task can run in record and verify modes. In record mode the output is snapshots, and in verify mode snapshots are input and the output is reports. Does this mean that adding snapshotOutputDir as input/output should be based on the isRecordRun/isVerifyRun properties? (e.g. something like isRecordRun.map { if (it) snapshotOutputDir else "dummyNonExistentFolder" })?


@Suppress("ObjectLiteralToLambda")
// why not a lambda? See: https://docs.gradle.org/7.2/userguide/validation_problems.html#implementation_unknown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ class PaparazziPluginTest {
assertThat(resourceFileContents[4]).isEqualTo("intermediates/assets/debug")
assertThat(resourceFileContents[5]).isEqualTo("app.cash.paparazzi.plugin.test")
assertThat(resourceFileContents[6]).isEqualTo("src/main/res,src/debug/res")
assertThat(resourceFileContents[7]).isEqualTo("caches/transforms-3/6e46d558be9195722df23f983e56c9d0/transformed/external/res")
assertThat(resourceFileContents[7]).isEqualTo("caches/transforms-3/0a93740b0d39bc4cff875b0e543c2c2e/transformed/external/res")
}

@Test
Expand All @@ -785,7 +785,7 @@ class PaparazziPluginTest {
assertThat(resourceFileContents[4]).isEqualTo("intermediates/assets/debug")
assertThat(resourceFileContents[5]).isEqualTo("app.cash.paparazzi.plugin.test")
assertThat(resourceFileContents[6]).isEqualTo("src/main/res,src/debug/res")
assertThat(resourceFileContents[7]).isEqualTo("caches/transforms-3/6e46d558be9195722df23f983e56c9d0/transformed/external/res")
assertThat(resourceFileContents[7]).isEqualTo("caches/transforms-3/0a93740b0d39bc4cff875b0e543c2c2e/transformed/external/res")
}

@Test
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.