Skip to content

Commit

Permalink
Fix order of copy
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Nov 4, 2024
1 parent a42223d commit acfc5d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ class RoborazziGradleProjectTest {
}

@Test
fun ifWeUseDeleteOldScreenshotsTheScreenshotsShouldNotExitOldScreenshot() {
fun ifWeUseDeleteOldScreenshotsTheOldScreenshotsShouldNotExit() {
RoborazziGradleRootProject(testProjectDir).appModule.apply {
recordWithDeleteOldScreenshots()
removeTests()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,17 +396,6 @@ abstract class RoborazziPlugin : Plugin<Project> {
// Run only root suite
return
}
// Copy all files from outputDir to intermediateDir
// so that we can use Gradle's output caching
test.infoln("Roborazzi: test.doLast Copy files from ${outputDir.get()} to ${intermediateDir.get()}")
// outputDir.get().asFileTree.forEach {
// println("Copy file ${finalizeTask.absolutePath} to ${intermediateDir.get()}")
// }
outputDir.get().asFile.mkdirs()
outputDir.get().asFile.copyRecursively(
target = intermediateDir.get().asFile,
overwrite = true
)

val results: List<CaptureResult> = resultDirFileTree.get().mapNotNull {
if (it.name.endsWith(".json")) {
Expand All @@ -432,6 +421,18 @@ abstract class RoborazziPlugin : Plugin<Project> {
outputDir = outputDir,
roborazziResults = roborazziResults,
)

// Copy all files from outputDir to intermediateDir
// so that we can use Gradle's output caching
test.infoln("Roborazzi: test.doLast Copy files from ${outputDir.get()} to ${intermediateDir.get()}")
// outputDir.get().asFileTree.forEach {
// println("Copy file ${finalizeTask.absolutePath} to ${intermediateDir.get()}")
// }
outputDir.get().asFile.mkdirs()
outputDir.get().asFile.copyRecursively(
target = intermediateDir.get().asFile,
overwrite = true
)
}

override fun beforeTest(testDescriptor: TestDescriptor?) {
Expand Down

0 comments on commit acfc5d5

Please sign in to comment.