Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple NetBeans Gradle Tooling #6829

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lkishalmi
Copy link
Contributor

This one is a proposed draft to allow plugins to provide their own discovery tooling library.

The motivation is that right now every Gradle discovery has to go into netbeans-gradle-tooling external library,Which is already stuffed. Also to be future proof we probably would use different version of these libraries when working with different Gradle versions. Right now we are using Gradle 7.4 to build our tooling on, which still has support for deprecated APIs, but already has new enough recent features. That might be no longer true with Gradle 9.0.

This would be a multi commit series PR. The first one is extending NetBeans with a GradlePluginProvider service.
The following would be figuring out how to wire this support into the project introspection.

@lkishalmi lkishalmi added this to the NB21 milestone Dec 11, 2023
@lkishalmi lkishalmi added the Gradle [ci] enable "build tools" tests label Dec 11, 2023
try (var wr = new StringWriter()) {
wr.append("initscript {\n");
wr.append(" dependencies {\n");
for (GradlePluginProvider pvd : providers) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A suggestion: if a GradlePluginProvider had a method boolean accepts(GradleRuntime r), then the providers can be filtered centrally. In the current state, each of the methods (classpath, plugins) need to accept GradleRuntime and test for applicable version.
Alternatively (future-compatible), suggest to have just

@CheckForNull GradlePluginDescriptor getPlugins(GradleRuntime r);

public final class GradlePluginDescriptor {
    Collection<File> getClasspath(GradleRuntime runtime) {...}
    Collection<String> getPlugins(GradleRuntime runtime) {...}
}

which could eventually allow to compatibly add more information in the future, if needed.

@sdedic
Copy link
Member

sdedic commented Dec 11, 2023

A question: I couldn't find a roadmap / tentative schedule for Gradle 9.0 ... can you share a link?

@lkishalmi
Copy link
Contributor Author

There is not too much info on Gradle 9.0, besides a bunch of warnings, that things are up for a removal.

So I do not know for sure if Gradle 9.0 would break anything. I think you would agree that the tooling code is already "stretched" enough with beforeGradle() and afretGradle() phases.

@sdedic
Copy link
Member

sdedic commented Dec 11, 2023

There is not too much info on Gradle 9.0, besides a bunch of warnings, that things are up for a removal.

So I do not know for sure if Gradle 9.0 would break anything. I think you would agree that the tooling code is already "stretched" enough with beforeGradle() and afretGradle() phases.

Definitely.

Do you plan also to make the Extractors to be version-aware ?

@lkishalmi
Copy link
Contributor Author

Do you plan also to make the Extractors to be version-aware ?

Good point. Shall we? I'm thinking of that they are providing an ugly but stable serialization facade to NetBeans. If it is not necessary I would don't go into that direction.

The primary goal here is to provide plugins to have their own tooling. I'd like to have one that provides ANTLR source sets on the project UI. with the current structure, I'd need to add that as a GradleJavaSourceSet.SourceType which oddly fits there and I would like to avoid that.

@neilcsmith-net neilcsmith-net modified the milestones: NB21, NB22 Jan 12, 2024
@ebarboni ebarboni modified the milestones: NB22, NB23 Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gradle [ci] enable "build tools" tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants