Instead of use
val mobileMain by creating {...}
, can we put this result in a map, without creating a new
val
?
For example, something similar to:
myMap["mobileMain"] by creating {...}
(do not compile)
My motivation is that I would like to create a helper method to store sourceSets in a map, since I would like to consult this map later.
The
creating
delegation is using something like:
operator fun provideDelegate(thisRef: Any?, property: KProperty<*>) = ExistingDomainObjectDelegate.of(
when (configuration) {
null -> container.create(property.name)
else -> container.create(property.name, configuration)
}
)