This message was deleted.
# community-support
s
This message was deleted.
c
interesting. perhaps
providers.provider { collectionA.map { a-> … }}
would suffice to make this lazy.
z
I don’t think that will work because I want to do the following later:
Copy code
domainObjectCollectionB
  .configureEach { b ->
  }
I could run the transform function (
(A) -> B
) within a
.configureEach { }
- but I would have to duplicate calling that in multiple places, which is less than ideal
c
ok. what is the broader use-case here?
would something like
collectionA.whenObjectAdded { // add to collectionB }
work?
z
I have a type:
Copy code
// there are more properties, reduced for simplicity
data class MyModule(val gradlePath: String) // equivalent to project path
I have a live
DomainObjectCollection<MyModule>
that I want to convert to
DomainObjectCollection<String>
(the
project.path
) and I need to keep the
MyModule
type around for other things
would something like
collectionA.whenObjectAdded { // add to collectionB }
work?
yeah this would probably work, not super clean though but may be my best bet
c
ok. give
collectionA.whenObjectAdded { // add to collectionB }
a try.
the other option would be to look at why a separate collection is needed for the String/path - can that be simplified to be somehow derived e.g. provider).
z
I’m basically moving from a
Modules.ALL
statically defined global list to each subproject specifying it itself. so I can move from
Modules.ALL: List<MyModule>
to
modules.all
(
modules
returns a gradle extension,
.all
is a live
DomainObjectCollection<MyModule>
that I use
.configureEach { }
to access)