gradle: Support multiple version catalogs#14067
Open
dimitripantelli wants to merge 1 commit intodependabot:mainfrom
Open
gradle: Support multiple version catalogs#14067dimitripantelli wants to merge 1 commit intodependabot:mainfrom
dimitripantelli wants to merge 1 commit intodependabot:mainfrom
Conversation
6a4bf1e to
7da8869
Compare
7da8869 to
be76c25
Compare
5 tasks
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
Currently
dependabot-coreonly supports a single Gradle version catalog located at the default pathgradle/libs.versions.toml. However Gradle supports defining multiple catalogs and locating them in arbitrary paths viasettings.gradle1. This change affords Dependabot the ability to update dependencies for catalogs defined beyond the canonical location.This PR updates the
SettingsFileParserto discover additional version catalogs declared insettings.gradle. The parser extracts catalog paths by identifyingfrom(files(...))declarations withinversionCatalogsblocks in thedependencyResolutionManagementsection, supporting both Groovy and Kotlin DSL syntax.The work continues to include the standard
gradle/libs.versions.tomlby default (even if not explicitly declared).Resolves
* Support custom version catalogs configured through
settings.gradle[.kts]#6831* Support custom non-toml version catalogs configured through settings.gradle[.kts] #6838
This supersedes #12996.
Anything you want to highlight for special attention from reviewers?
The current parser uses Regex to capture paths. A more complete approach would be using the Gradle Tooling API (#1164) when that work is in place.
This is my first contribution to the project (in fact, any open-source project) so please let me know if there's anything to adjust and I'll endeavour to do so. If this PR is accepted, I'll follow up with a PR to github/docs to reflect the change.
How will you know you've accomplished your goal?
Updated specs to include test cases for
settings.gradle.tomlfilesChecklist
Footnotes
https://docs.gradle.org/current/userguide/version_catalogs.html#sec:multiple-catalogs ↩