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

Feature Request: Optionally fail when not using a version catalog to define a dependency #230

Open
codefish1 opened this issue Sep 27, 2022 · 2 comments

Comments

@codefish1
Copy link
Contributor

Version Catalogs provide the ability to centrally define your dependency versions rather than defining the versions multiple times across various sub projects. This also has the added benefit of easily been able to up-version a dependency using tools like depend-a-bot.

I'd like to see adoption of version catalogs be driven through gradle doctor to encourage this by warning (and optionally failing the build) when it detects that a version has been defined directly within a build.gradle(.kts) file

@runningcode
Copy link
Owner

How can this be detected? I feel like this is a bit out of scope of the Gradle doctor though.

@codefish1
Copy link
Contributor Author

Might be out of scope for Gradle docker in that it won't make your builds faster. Just helps to keep them tider and less errorprone.

We can detect it since you end up with the version number in the string when you defined a dependency.

If the dependency is managed with a BOM there is no version number. The version catalog will import it via an accessor (if I've got the right name for it)

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

No branches or pull requests

2 participants