Skip to content

Commit 399d023

Browse files
authored
Merge pull request #18865 from rjernst/fix_extra_config_file
Test: Fix integ test extra config files to work with more than one
2 parents 3032a7c + 0508fc3 commit 399d023

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

+3-2
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,10 @@ class ClusterFormationTasks {
291291
File configDir = new File(node.homeDir, 'config')
292292
copyConfig.into(configDir) // copy must always have a general dest dir, even though we don't use it
293293
for (Map.Entry<String,Object> extraConfigFile : node.config.extraConfigFiles.entrySet()) {
294+
Object extraConfigFileValue = extraConfigFile.getValue()
294295
copyConfig.doFirst {
295296
// make sure the copy won't be a no-op or act on a directory
296-
File srcConfigFile = project.file(extraConfigFile.getValue())
297+
File srcConfigFile = project.file(extraConfigFileValue)
297298
if (srcConfigFile.isDirectory()) {
298299
throw new GradleException("Source for extraConfigFile must be a file: ${srcConfigFile}")
299300
}
@@ -303,7 +304,7 @@ class ClusterFormationTasks {
303304
}
304305
File destConfigFile = new File(node.homeDir, 'config/' + extraConfigFile.getKey())
305306
// wrap source file in closure to delay resolution to execution time
306-
copyConfig.from({ extraConfigFile.getValue() }) {
307+
copyConfig.from({ extraConfigFileValue }) {
307308
// this must be in a closure so it is only applied to the single file specified in from above
308309
into(configDir.toPath().relativize(destConfigFile.canonicalFile.parentFile.toPath()).toFile())
309310
rename { destConfigFile.name }

0 commit comments

Comments
 (0)