Joshua Hansen
11/14/2024, 4:57 PMval
property in an abstract class's initialization? I notice that it only works when subclasses override the getter specifically, which makes sense. But there doesn't seem to be any way to enforce that subclasses specifically override the getter rather than just initialize the property (which causes an error in the super's init).Vampire
11/14/2024, 5:26 PMProperty
properties. Using those in the constructor for example to set conventions usually is fine, as you know that the decorated class Gradle generates has the getters implemented in a compatible way.
But even there it is most often better to not do such things in the constructor of the task or extension, not particularly because of the leaking this, but because it is more idiomatic to have tasks and extensions just as providing the work logic or configuration dsl but otherwise as opinionless as possible, and add the opinion like setting property conventions or wiring task properties and extension properties together done in the plugin that registers those tasks or extensions, which improves potential reusability.Daniel Pitts
11/14/2024, 5:49 PMVampire
11/14/2024, 5:58 PM