I’m developing a plugin (using Gradle 4.6 but I can migrate) and would like to use a PolymorphicDomainObjectContainer in my custom plugin extension to name individual source files, or set of source files. For example
+1. I would like to do the very same thing in a custom plugin. I can create a NamedDomainObjectContainer no problem (Project#container). But I have no idea how to get a reference to a PolymorphicDomainObjectContainer. Is there some magic like all NamedDomainObjectContainer impls are also PolymorphicDomainObjectContainer impls?
I still have not figured out how to actually use these things “properly” as they are documented in the guides for Gradle’s own PolymorphicDomainObjectContainer (tasks, etc). The syntax is supposed to be:
myContainer {
standard {...}
custom( CustomType ) {...}
}
For me, the custom( CustomType ) reference always fails - it tries to find a method named custom. Ugh