I had to add the closure method manually otherwise it didn’t work, there was a comment on the link I posted that says it won’t generate them if it’s added via create.
It is decorated when using the create() method, but not when you call new XYZ(). We plan to improve nested DSL creation with a public Instantiator API. Currently that API is internal
without adding the closure methods manually, its looking for the method() method on the dsl class and not the nested class, do i need action methods on the nested class?
You can leave out the Closure overloads on objects created by Gradle, only the Action overloads are needed there. But if you create any object yourself using new XYZ(), they will not be enhanced.
Seem to have tracked it down, it only likes two levels of nesting, heres an example project with three levels of nesting https://github.com/a1dutch/nested-dsl. Adding the closure methods manually makes it works as expected.
You are calling new Outer()here. That means that this object is not enhanced and will have no auto-generated Closure methods. Only objects created by Gradle have auto-generated methods.