This message was deleted.
# plugin-development
s
This message was deleted.
p
Copy code
val foos = extensions.create<Foo>("foo")
foos.s.register("a")
Copy code
val a: NamedDomainObjectProvider<S> = foo.s.a
Results into
Unresolved reference: a
a
Yeah, it's weird.
Foo.s
is a property, but
s
needs to be an extension on Foo.
try this
Copy code
abstract class Foo : ExtensionAware {
  val s: NamedDomainObjectContainer<S> = extensions.create("s")
}
p
this code results into
Copy code
Could not create an instance of type app.softwork.kobol.gradle.Foo.
      > Could not create an instance of type org.gradle.api.NamedDomainObjectContainer.
         > Could not generate a decorated class for type NamedDomainObjectContainer.
            > Cannot have abstract method NamedDomainObjectCollection.getAsMap().
same error when using:
interface Foo: NamedDomainObjectContainer<S>
But this code works:
Copy code
abstract class Foo : ExtensionAware {
    abstract val s: NamedDomainObjectContainer<S>

    init {
        extensions.add("s", s)
    }
}
And I found a PR which generates nested accessors: https://github.com/gradle/gradle/pull/23665