-
-
Notifications
You must be signed in to change notification settings - Fork 233
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
feat: Introduce Version Catalog for Dependency Management #1607
base: master
Are you sure you want to change the base?
Conversation
This commit introduces a version catalog via `libs.versions.toml` to centralize and manage project dependencies. It replaces the previous hardcoded dependency versions in `app/build.gradle` with references to the version catalog. This change enhances maintainability and organization by centralizing dependency management. - Added `gradle/libs.versions.toml` to define dependencies and their versions. - Updated `app/build.gradle` to utilize dependencies from the version catalog.
-Sorts `versions`, `dependencies`, and `plugins` references alphabetically.
* Suppressed warning about updating zxing-core to avoid confusion. * Added a note to avoid updating zxing-core.
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.
LGTM 🥳 Happy to see this!
I pulled and tested a build to verify as well, all good (I just can't accept PRs yet). I don't think we have to change anything with Renovate for this to just work with dependency updates but I'm not 100% sure on that
app/build.gradle
Outdated
def appcompat_version = '1.7.0' | ||
implementation "androidx.appcompat:appcompat:$appcompat_version" | ||
|
||
implementation libs.appcompat |
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.
Minor nit: using parenthesis for most other deps here:
implementation libs.appcompat | |
implementation(libs.appcompat) |
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.
eh actually further down it's more of a norm to not use them in this file - I like the idea of using them throughout just because it's forced if we move to kts vs Groovy, but nbd either way
gradle/libs.versions.toml
Outdated
firebase-crashlytics-gradle = { module = "com.google.firebase:firebase-crashlytics-gradle" } | ||
fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragment-ktx" } | ||
google-services = { module = "com.google.gms:google-services", version.ref = "google-services" } | ||
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } |
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.
Minor nit: I might call this agp
or android-gradle-plugin
, was just confused at first when I saw gradle
Thank you! Also just noticed the parantheses inconsistency. Inconsistency in the version catalog definitions too: Considering some |
- Ensures all library dependencies are called with `implementation(libs.xxx)` instead of `implementation libs.xxx` in `build.gradle`.
- Updated dependencies in the app build.gradle to use bundles where possible.
This introduces a version catalog via
libs.versions.toml
to centralize and manage project dependencies. It replaces the previous hardcoded dependency versions in.gradle
files with references to the version catalog. This change enhances maintainability and organization by centralizing dependency management.gradle/libs.versions.toml
to define dependencies, plugins, and their versions.build.gradle
to utilize references from the version catalog,app/build.gradle
to utilize references from the version catalog.zxing-core
dependency[bundles]