From b35215a4c36ca6285e7631e01d62c24a6b520340 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Tue, 24 Nov 2026 15:58:06 -0800 Subject: [PATCH] Declare only test.properties as initProperties output Copy's destination made the whole testAutomation directory an output, which Gradle 9 rejected alongside processResources when test.properties was missing. --- build.gradle | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index ffa62d9b02..441b5b2fa1 100644 --- a/build.gradle +++ b/build.gradle @@ -126,23 +126,18 @@ if (!BuildUtils.isIntellij()) { } File testPropertiesFile = project.file('test.properties') -def initPropertiesTask = project.tasks.register("initProperties", Copy) { - Copy task -> +File testPropertiesTemplate = project.file('test.properties.template') +// Not a Copy task: its destination (this whole directory) would become an output overlapping processResources inputs +def initPropertiesTask = project.tasks.register("initProperties") { + Task task -> task.group = GroupNames.TEST task.description = "Create test.properties if missing" - task.from(project.file('test.properties.template')) - task.into(".") - task.outputs.files(testPropertiesFile) - task.rename('test.properties.template', 'test.properties') - task.filter { String line -> - if (line.startsWith("#!!")) { - return null - } - else { - return line - } - } + task.inputs.file(testPropertiesTemplate) + task.outputs.file(testPropertiesFile) task.onlyIf{ !testPropertiesFile.exists() } + task.doLast { + testPropertiesFile.text = testPropertiesTemplate.readLines().findAll { !it.startsWith("#!!") }.join(System.lineSeparator()) + System.lineSeparator() + } } def harInFile = project.findProperty('harInFile')