This message was deleted.
# community-support
s
This message was deleted.
e
Looks like maybe this will work:
Copy code
listOfProviders.zipWithNext { a, b -> 
  a.zip(b) { listA, listB ->
    listA + listB
  }
}
Full solution:
Copy code
fun <T> combineProviders(
  providers: List<Provider<List<T>>>
): Provider<List<T>> {
  var p = providers
          
  while(p.size > 1) {
    p = p.zipWithNext { a, b ->
      a.zip(b) { listA, listB ->
        listA + listB
      }
    }
  

  return p.first()
 }
Now of course someone will point out that there's a Gradle API for this 🙈
t
Maybe something like:
Copy code
val listProperty = objects.listProperty<T>()
providers.forEach { listProperty.addAll(it) }
return listProperty as Provider<List<T>>