Skip to content

Fix usage of deprecated Gradle APIs scheduled to be removed in Gradle 9.0 #14781

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

Merged
merged 1 commit into from
Jun 14, 2025

Conversation

breskeby
Copy link
Contributor

Description

With Gradle 9.0 approaching soon, this fixes incompatibilities with Gradle 9.0 by fixing two types of deprecated api usage in the build logic:

  1. The org.gradle.api.plugins.JavaPluginConvention type has been deprecated
  2. The Project.exec(Closure) method has been deprecated.

With Gradle 9.0 approaching soon, this fixes incompatibilities with Gradle 9.0 by
fixing two types of deprecated api usage in the build logic:

1. The org.gradle.api.plugins.JavaPluginConvention type has been deprecated
2. The Project.exec(Closure) method has been deprecated.
Copy link

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR.

Copy link
Contributor

@dweiss dweiss left a comment

Choose a reason for hiding this comment

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

Right... This is among those things I mentioned that I don't understand - perhaps there are benefits to configuration caching or other advanced features... but overall it's a lot more boilerplate for something that is conceptually dead simple and that should remain simple. Eh.

@dweiss dweiss merged commit 5638a8d into apache:main Jun 14, 2025
7 checks passed
@dweiss dweiss added this to the 11.0.0 milestone Jun 14, 2025
@dweiss dweiss mentioned this pull request Jun 14, 2025
8 tasks
@breskeby
Copy link
Contributor Author

Right... This is among those things I mentioned that I don't understand - perhaps there are benefits to configuration caching or other advanced features... but overall it's a lot more boilerplate for something that is conceptually dead simple and that should remain simple. Eh.

One problem that gradle is suffering from is, all the freedom it had given in the (groovy) DSL implementation in its early days. which makes it hard to move forward with making substantial progress on optimizing the gradle configuration phase.

In this example just everything was kind of slammed into the project object (type Project) which is mutable by contract which makes optimizations way harder. Since ~2 major releases, Gradle keeps slowly deprecating and cutting back on this.

Furthermore some of this "magic" like the way Conventions had been implemented back then makes IDE support way harder.

Currently almost all of the build logic is jammed into the gradle files. The approach Gradle recommends usually is to keep convention plugins and build scripts small and only contain conventions and a few configurations and keep more complex implementation logic in testable binary plugin and task implementation. "Weired" boilerplate like the "InjectedExec" class I added as part of this PR I consider workarounds to achieve stuff in in build scripts that should probably better live in this binary (plain java?) implementation. There the boilerplate is usually minimal and not as bad as when staying with gradle files only.

@breskeby breskeby deleted the fix-90-deprecations branch June 15, 2025 09:37
@dweiss
Copy link
Contributor

dweiss commented Jun 16, 2025

One problem that gradle is suffering from is, all the freedom it had given in the (groovy) DSL implementation in its early days.

Thanks. It's subjective, I know, but I have been a user of gradle since these early days and that freedom... I miss it. My subjective gut feeling is also that in the early days - when stripped of all the added-on features like build caches, configuration caches, etc. - gradle startup wasn't even a problem. My memory may be playing tricks on me but I do miss the simplicity of the early days (when it was basically ant tasks + groovy to configure everything).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants