Under the hood the configuration is immediately accessed as well, configurationContainer.getByName(configurationName). Even using an explicit add method taking a string results in the same call. And there are no lazy variant (regarding the configuration).
This raises some questions there, as I understand that getByName is eager, it realizes the “named” element. Which makes basically other efforts in build files to reduce eager API to have less impacts if configurations are still created early via this seemingly innocent APIs.
I have no idea why there the things are realized eagerly though even if you use providers.
Maybe a bug report - if none present - would be appropriate.
Interesting! Thanks I completely missed the ConfigurationsContainer::dependencyScope. I noticed it’s still incubating, so that’s something to keep monitoring if any change happens.
It seems that DependencyScopeConfiguration extends a Configuration, so what’s the difference with (in pseudo code) with “regular” lazy api, e.g. :
The dependencyScope is totally different from named, because it registers a new configuration set up as dependency bucket (non-resolvable, no-consumable).
If you want to get an existing, named is still the right thing to use.