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

Manage dependencies with a version catalog #727

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Manage dependencies with a version catalog #727

merged 3 commits into from
Nov 27, 2024

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Nov 13, 2024

Version catalog is the best practice for managing dependencies. It makes it easier to track and update versions, and allows to centralize dependencies in a multi-module context. It is an alternative to the buildSrc workaround used in some of our projects.

This PR does not update libraries versions.

Each commit offers an alternative approach:
a) define the version catalog in settings.gradle
b) define the version catalog in libs.versions.toml
c) only manage versions (not full dependencies) in the version catalog

Option c) has my preference because we get all the benefit of centralizing versions, but we don't really need to define all dependencies in the version catalog if they are not used by several modules.

@pm47 pm47 requested a review from dpad85 November 13, 2024 13:14
Copy link
Member

@dpad85 dpad85 left a comment

Choose a reason for hiding this comment

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

I also prefer option c).

  • option b) is less readable, because 1) we can't easily parse which dependency is used by which target by just reading the build.gradle.kts file ; 2) the toml file is very busy.
  • option a) is the same, but somewhat worse since the data are put in the settings file.

Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

Works on my machine ™️

@pm47 pm47 merged commit 49ed521 into master Nov 27, 2024
2 checks passed
@pm47 pm47 deleted the version-catalog branch November 27, 2024 10:15
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.

3 participants