From 815e90d47fd27bc5a758b1ca05f8d1ae265a066e Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:35:02 -0700 Subject: [PATCH] Add testDataNewTargets sourceSet --- build.gradle.kts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6a67a6c..94516e3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,6 @@ import org.incendo.cloudbuildlogic.jmp +import kotlin.io.path.exists +import kotlin.io.path.invariantSeparatorsPathString plugins { val indraVer = "3.1.3" @@ -74,7 +76,17 @@ allprojects { } val testDataSet = sourceSets.create("testData") +val testDataNewTargets = sourceSets.create("testDataNewTargets") dependencies { - testImplementation(testDataSet.output) + val oldRoot = layout.buildDirectory.dir("java/testData").get().asFile.toPath() + val newRoot = layout.buildDirectory.dir("java/testDataNewTargets").get().asFile.toPath() + testImplementation(testDataSet.output.filter { + if (it.toPath().startsWith(oldRoot)) { + !newRoot.resolve(oldRoot.relativize(it.toPath()).invariantSeparatorsPathString).exists() + } else { + true + } + }) + testImplementation(testDataNewTargets.output) }