Skip to content

[Build] Fix more gradle deprecation warnings scheduled to be removed in 9.0 #14783

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 3 commits into from
Jun 16, 2025

Conversation

breskeby
Copy link
Contributor

@breskeby breskeby commented Jun 15, 2025

Description

This fixes three more types of deprecations seen in the build:

  1. Fix file permission setup using non deprecated Gradle API
  2. Using Configuration#getFirstLevelModuleDependencies().findAll instead of deprecated getFirstLevelModuleDependencies(Spec)
  3. Fix deprecated usage of other projects configurations
    Resolution of the configuration :icu_current was done from a context different than the root project.
    This is problematic and deprecated behavior scheduled to be removed in Gradle 9.0.

See https://docs.gradle.org/8.14/userguide/how_to_share_outputs_between_projects.html\#variant-aware-sharing for details how dependencies should be shared accross projects.

breskeby added 2 commits June 15, 2025 12:33
Resolution of the configuration :icu_current was done from a context different than the root project.
This is problematic and deprecated behavior scheduled to be removed in Gradle 9.0.

See https://docs.gradle.org/8.14/userguide/how_to_share_outputs_between_projects.html\#variant-aware-sharing for details how
dependencies should be shared accross projects.
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.

@@ -30,14 +30,15 @@ def resources = rootProject.file("gradle/regenerate/icu")
* download and compile a matching icu4c version automatically.
*/

// Configure different icu4j dependencies.
configure(rootProject) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Declaring a configuration in one project and use it in another as done here before was one. of those things that had been technically possible forever, never recommended and now been deprecated. A good example of the problem with the historical approach in Gradle that in build logic there hasn't been any boundaries accross projects and the whole global model has been available from everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO this plugin is a good example of something that can benefit from been ported into a binary plugin and only keep its actual implementation in this convention plugin rather all the nitty bits of implementation details.

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.

@dweiss dweiss added this to the 11.0.0 milestone Jun 16, 2025
@dweiss dweiss merged commit 7f24753 into apache:main Jun 16, 2025
7 checks passed
@dweiss dweiss mentioned this pull request Jun 14, 2025
8 tasks
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