Kevin Brightwell
06/26/2024, 3:42 PMSetProperty<> from a provider that may be Missing and not have the entire set conclude it is Missing?Kevin Brightwell
06/26/2024, 3:43 PMinternal val subprojectRootsMap: MapProperty<String, Boolean> = objects.mapProperty<String, Boolean>().empty()
val subprojectRoots = subprojectRootsMap.asTrueSetProvider()
private fun MapProperty<String, Boolean>.asTrueSetProvider(): Provider<Set<String>> {
return objects.setProperty<String>()
.value(this.map { it.filterValues { v -> v }.keys })
.apply {
finalizeValueOnRead()
}
}ephemient
06/26/2024, 4:02 PMFelix de Souza
06/27/2024, 12:55 PMaddAll with a provider that can never be empty? I.e. your provider that might be empty should map to a singleton set but you can then do orElse(Set.of())? Then your set property is never empty due to other providers. Iām going on your initial question, not your workaround.Kevin Brightwell
06/27/2024, 12:56 PMaddAll(ā¦) was adding single elements. Of which any could be empty. but it turns out if any are empty the entire collection is empty š¬Felix de Souza
06/27/2024, 12:56 PMFelix de Souza
06/27/2024, 12:57 PMKevin Brightwell
06/27/2024, 12:58 PMsetProperty.addAll(boolProperty.map { setOfNotNull("foo".takeIf { it } })