gradle / declarative-gradle

Declarative Gradle is a project targeting better isolation of concern and expressing any build in a clear and understandable way
https://declarative.gradle.org/
Other
109 stars 11 forks source link

Apply new pattern to convention extensions #86

Closed tresat closed 4 months ago

tresat commented 4 months ago
tresat commented 4 months ago

I largely feel like we added these "optional" blocks to simulate a behavior that we don't have yet but intend to provide - i.e. things that extend software types (we need better terms for some of these things). Now we're running into something where, in order to simulate it (i.e. setting conventions for one of these optional things without opting in), we have to do something in the DSL that we would not do in an actual implementation of the thing we want to provide (i.e. setting an "enabled" flag). Although this is a clever enough approach and would allow us to "mostly" demonstrate conventions for these things, it could lead to confusion about what the intended vision is for this sort of thing, especially if the DSL for applying conventions to optional things without opting in turns out to be very different.

It feels like the drawbacks outweigh the benefits here and we'd be better off just saying you can't currently apply conventions to optional things without opting in for now and then possibly add this in later if we decide this actually does properly align with our intended approach.

Hi Gary, after much discussion with the rest of team, I'm going to go ahead and merge this as a temporary workaround, despite the drawbacks. I'm happy to help work on a better solution, and I think it's important to do this soon. This will allow work to continue for now, and when we have a better solution available, we can migrate everything at once, since it will be working the same way.

I'm going to add a disclaimer to the docs noting this is a temporary pattern not to be copied.

ghale commented 4 months ago

👍 I'm fine with that. I don't feel strongly about it.