Skip to content

Support for multiple NetBeans Gradle Tooling - #6829

Draft
lkishalmi wants to merge 1 commit into
apache:masterfrom
lkishalmi:gradle-multi-tooling
Draft

lkishalmi wants to merge 1 commit into
apache:masterfrom
lkishalmi:gradle-multi-tooling

Conversation

@lkishalmi

Copy link
Copy Markdown
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 requested review from mbien and sdedic December 11, 2023 07:02
@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
Copy Markdown
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

sdedic commented Dec 11, 2023

Copy link
Copy Markdown
Member

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

@lkishalmi

Copy link
Copy Markdown
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

sdedic commented Dec 11, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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
@mbien mbien removed this from the NB23 milestone Jul 18, 2024
@lkishalmi
lkishalmi force-pushed the gradle-multi-tooling branch from ecac527 to d47cb69 Compare November 8, 2026 23:15
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.

5 participants