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

Make Java Platform available on non-java Gradle Projects #5053

Conversation

lkishalmi
Copy link
Contributor

This is a workaround. It enables non-java project (root project, or others) to have a Java Platform specified and used during project discovery.

This should be provided by the base Gradle Project support, not the Gradlle Java Project support, but that's for the future.

@lkishalmi lkishalmi added Gradle [ci] enable "build tools" tests 16u1 labels Dec 6, 2022
@lkishalmi lkishalmi added this to the NB17 milestone Dec 6, 2022
@lkishalmi lkishalmi requested a review from sdedic December 6, 2022 06:53
@lkishalmi
Copy link
Contributor Author

FYI: The platform customizer is already always enabled.

Copy link
Member

@sdedic sdedic left a comment

Choose a reason for hiding this comment

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

While I think this is fine as a workaround, I have some mixed feelings in general about more and more java-related services exposed on generic root projects - see JavaCompilerProcessorFactory, JPDAProcessorFactory: they will now apply to (e.g.) C++ Gradle builds as well.

Maybe some other approach (or registration mechanism) is needed for umbrella / parent / root projects in this case ?

@lkishalmi lkishalmi merged commit ee7d2dd into apache:master Dec 6, 2022
@lkishalmi
Copy link
Contributor Author

@sdedic I share your feelings. I took the plugin based ProjectService registration from Maven, where it was based on the packaging type. The multi-project Gradle projects were just started to take off and usually even with that the root project had the java plugin applied on most projects I've seen.

If you have ideas, let's start a discussion. I'm open to change. Though now with the new native interfaces in Java, I'd expect more mixed languages project, where one sub-project is a C library, then the next one is a Java. You could expect a JavaExec task show up anywhere in debug mode, or get some stacktrace here and there.

I could imagine, that most of these services would be registered globally. Though the output processors could be dynamic, as we can get some info from the task being executed...

Regarding this JavaPlatformProviderImpl. It shall be in the Gradle Project Support. Also this setting shall be taken from the root project. That's a medium change for NB17.

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

2 participants