-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Gradle build: cleanup of dependency resolution and consolidation of dependency versions #13484
Conversation
…erenced versions with the catalog.
… plugin with buildinfra extension.
I'm going to merge this in. Please report any problems with the build if you encounter them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall; thanks for doing this @dweiss !
What script generates versions.lock? The "because" sections look mysterious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A plugin does this. It is similar in nature to palantir's but "passive" - it only collects dependencies from selected configurations and makes sure they're consistent, it won't lock their versions or try to force them. It's more of a safety/ early warning mechanism - you'll have to use gradle's own mechanisms for version alignment, if something is not right.
The documentation is non-existent but you can grep through the code, if you're interested.
https://github.com/carrotsearch/gradle-dependencychecks-plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh - the "because" contain a hash key and all configurations/projects which refer to a dependency. These hashes are used next to dependencies to shorten up the list. For example these are pulled in by the same set of configurations:
"net.sourceforge.nekohtml:nekohtml:1.9.17" : "6f16ff86,refs=2",
"org.apache.commons:commons-compress:1.19" : "6f16ff86,refs=2",
from:
"because" : {
...
"6f16ff86" : [
{
"configuration" : "testCompileClasspath",
"projectPath" : ":lucene:benchmark"
},
{
"configuration" : "testRuntimeClasspath",
"projectPath" : ":lucene:benchmark"
}
],
the plugin needs a set of projects and configurations to take into account - this is set up in dependencies.gradle.
This patch attempts to clean up and consolidate all kinds of aspects related to dependencies used throughout the build and "versions", understood not only as dependency versions but also minimum java version, google java format version, etc.
Notable changes.
While this isn't strictly necessary, the concept of a "lock file" for dependencies used in the main and test modules is useful - it allows some manual control when transitive dependency versions or dependencies change (otherwise they'd go unnoticed). I used my own small plugin to collect these dependencies and update/ verify their consistency (on tidy and check tasks). This plugin does not alter dependency resolution (like palantir's did). It merely sums up what is used, in which version and where. See versions.lock to see the output.
I also corrected a few deprecations and minor glitches in gradle files.
This patch does not upgrade any dependencies - it's left as a follow up.