diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyList.java b/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyList.java index 1d302ded632..9f8bbe1c024 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyList.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyList.java @@ -170,13 +170,23 @@ public class LazyPropertyList extends AbstractLazyPropertyCollection implemen } @Override - public List getNormalizedCollection() { + public List> getNormalizedCollection() { return delegate.stream() .peek(this::validate) .filter(entry -> entry.getNormalization() != PropertyNormalization.IGNORE_VALUE) .collect(Collectors.toList()); } + /** + * Return a "flattened" collection. This should be used when the collection type is itself a complex type with properties + * annotated as Gradle inputs rather than a simple type like {@link String}. + * + * @return a flattened collection filtered according to normalization strategy + */ + public List getFlatNormalizedCollection() { + return getNormalizedCollection().stream().map(PropertyListEntry::getValue).collect(Collectors.toList()); + } + private void validate(PropertyListEntry entry) { assertNotNull(entry.getValue(), "entry"); } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index 9fe8c41004d..bff6cc3fea7 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -1188,7 +1188,7 @@ public class ElasticsearchNode implements TestClusterConfiguration { @Nested public List getCliSetup() { - return cliSetup.getNormalizedCollection(); + return cliSetup.getFlatNormalizedCollection(); } @Nested