Do NamedDomainObjectProviders by default register ...
# plugin-development
r
Do NamedDomainObjectProviders by default register configurations for all of their members? I have one as part of my DSL, and it seems like without doing anything configurations are being created - i.e. if I create a custom member named "example", "exampleRuntimeOnly" exists
v
No, that would be total non-sense. If you get
exampleRuntimeOnly
, then you added a source set called
example
directly or indirectly.
Besides that a named domain object provider does not have multiple members, but I guess you meant a named domain object collection. 🙂
r
Yes, collection. That's what I thought, but I figured I'd check - time to go find which dependency is doing it!
v
Just set a breakpoint in the
JavaBasePlugin
where the runtime only configuration is created, then you should see in the stacktrace where the source set is registered
(given it comes from a source set and not someone is creating a configuration that just is named the same as in that case.)
p
BTW if you are using a (convention) plugin and the kotlin DSL, all the configurations are evaluated/created: https://github.com/gradle/gradle/issues/36147 Maybe that's where the confusion comes.
v
I don't think so, as the question is why it exists, not why it is realized. :-)
r
No, I've found the dependency in this case causing the realization :)
👌 1