quarkus application gradle plugin model design #25511
Replies: 12 comments 98 replies
-
The following people showed active interest in the Zulip Chat conversation so tagging them here: @sebersole @glefloch |
Beta Was this translation helpful? Give feedback.
-
@sebersole I have finally gotten a sample project working in Gradle with the three extensions in the conditional extension dependencies documentation. (It appears that the Quarkus Gradle plugin doesn't like resolving dependency conditions when they involve extensions that are modules in the same project... possibly a bug lurking here.) I am taking a look again at your plugin projects [1] [2] to compare to try to gain a better understanding of where you think this is headed. I don't see any handling for conditional dependencies. Is that a Quarkus feature that came after you wrote your plugins, or did you simply not need it and ignored the metadata? |
Beta Was this translation helpful? Give feedback.
-
Still not understanding exactly what "conditional dependencies" are. But if I understand correctly, this is how my plugin handles
That configuration triggers the plugin to also pull in the Is that what you mean? |
Beta Was this translation helpful? Give feedback.
-
Wow, that's crazy non-intuitive. But that's y'alls call - 🤷 |
Beta Was this translation helpful? Give feedback.
-
So before any of us spend more time on this than we might want depending on these answers, I think we need to consider the questions I raised initially...
(3) goes back to where one of my roadblocks for the poc. I was able to generate and manage the Jandex Indexes much better, but the Quarkus internals insist on doing that itself. So this one is not critical, though do understand that it was far more performant. Granted that may have changed in the ensuing 1.5 years |
Beta Was this translation helpful? Give feedback.
-
If we add a new Configuration specifically intended for users to define platforms, then that's not going to be backwards compatible really.
Sure, and same as above these are obviously completely different approaches and not really compatible.
Yep, I remember this "dev mode" making some things very fugly. |
Beta Was this translation helpful? Give feedback.
-
@sebersole , I think you've been very focused on your POCs and how the concepts in them can be brought back into the Quarkus repos. I've been more focused on how I can incrementally improve the existing plugins to bring them more in line with modern Gradle best practices, and specifically the area where extension dependencies are computed (in the ConditionalDependenciesEnabler and ApplicationDeploymentClasspathBuilder classes), as I noted at the very top of this discussion, and as I started the Zulip chat. I don't fully know what the dynamics are between the Quarkus devs and Gradle, but the impression I've gotten is that there's a lot of things besides Gradle that they're focused on. I've always preferred incremental refactors to the existing code-base, particularly when I'm a new contributor, because it establishes a certain amount of trust between myself and the maintainers, gives me an opportunity to understand and adopt all the broader concerns that the maintainers have to juggle, and also gives the maintainers time and space to understand and adopt the direction my contributions are headed in. |
Beta Was this translation helpful? Give feedback.
-
Another aspect that I wanted to mention is breaking steps down in to Tasks. That was another focus of the poc. I broke down the process into as many individual steps as possible to better leverage Task dependencies and up-to-date checks. Ultimately it would be better (this "dev mode" stuff, that I do not really understand and seems to cause an awful lot of "difficulties", aside) if the Quarkus internals could delegate even more to the Gradle plugin. Gradle already implements (better most likely) much of the task/step dependencies that Quarkus itself seems to have tried to re-invent. At least this was all my take away from 1.5 years ago - lots can change in 1.5 years, so I am not sure how true this take away is still. But regardless of that part, breaking down "steps" into atomic tasks (as atomic as possible) will also help performance. |
Beta Was this translation helpful? Give feedback.
-
I started some work on the plugin that I will eventually send as a PR. First, I updated to Gradle 7.4 to better leverage the newest delayed config stuff. This is the version used to build the plugin, though it will mean a bump in the minimum usable version. However, it won't mean requiring as high as 7.4 for users, but I am not sure of the minimum version this implies. Whenever they started adding Provider, etc. The newer ones move them from incubating to supported though, so worth it imo. I'll leave such decisions to y'all though. But it is kind of needed to better leverage delayed config. Next I started with You guys basically recapture the following things that Gradle already exposes as configurable and I am not sure why.
Regardless, this seems like something that should NOT be exposed as input imo. The user already has a well-defined way to configure this. 2. If the answer is that these are just meant to expose "easy" access to these values from other parts of the plugin... ok, fine. But there are setters. |
Beta Was this translation helpful? Give feedback.
-
I have filed a PR with an incremental improvement: |
Beta Was this translation helpful? Give feedback.
-
@aloubyansky @glefloch - general question about design and how you "like" things... There seem to be a number of properties (both task and QuarkusPluginExtension) that maybe are not really intended to be properties in terms of it does not see like the user would actually set these. I think you do it so they can be configured externally (e.g. the extension configuring a task), but do not expect users to set them. How do you feel about not exposing those as properties proper? E.g., But what about constructor-injection instead? At the moment we have:
What about this instead?
Personally I'd constructor-inject other values as well, but for illustrative purposes... |
Beta Was this translation helpful? Give feedback.
-
First, I'll go through and categorize which fields I think are "real properties" and which seem to not be; I'll list them on #25615 so we can be explicit and transparent. From there, there are 2 patterns...
But I'll get the list first and we can talk through specifics. |
Beta Was this translation helpful? Give feedback.
-
This is a continuation of the discussion started here:
https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Gradle.20plugin.20model.20design
We were getting increasingly specialized and noisy, so we decided to break this topic into its own thread. This will allow us to "spam" discussion about a particular refactor being discussed for the Gradle plugin in which the Configuration objects created to track extensions and their dependencies is changed to happen during Gradle's configuration phase, rather than execution phase.
The refactor may change in scope but this at least is how it started. :)
Beta Was this translation helpful? Give feedback.
All reactions