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

Caveat: refreshVersions might show available updates in versions catalog for dependencies you don't actually use #571

Closed
jmfayard opened this issue Aug 5, 2022 · 0 comments · Fixed by #509
Assignees
Labels
problem Something isn't working
Milestone

Comments

@jmfayard
Copy link
Member

jmfayard commented Aug 5, 2022

The next version of refreshVersions will support Gradle Versions Catalog.

Caveat

The task ./gradlew refreshVersions will show available updates inside gradle/libs.versions.toml

 [versions]
 okhttp3 = "3.5.0"
### available = "3.6.0"
### available = "3.7.0"

 [libraries]
 okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp3" }

The issue is: what happens to your build if you upgrade the version in that file?

Well actually... nothing if you don't use implementation(libs.okhttp) everywhere in your build.

If you have hardcoded it with implementation("com.squareup.okhttp3:okhttp:4.10.0"), then nothing will happen.

Workaround

If you run the task ./gradlew refreshVersionsMigrate, your build will be updated to use the dependency notations

If the versions in Gradle (4.10.0) and the gradle/libs.versions.toml file are different, refreshVersions will detect that and mark the okhttp property as being unused (## unused) to avoid confusing you.

On the other hand, if it's the same version, you will see the updates and only get the unused comment in the next run.

@jmfayard jmfayard added this to the v1.0.0 milestone Aug 6, 2022
@jmfayard jmfayard added the problem Something isn't working label Aug 6, 2022
@jmfayard jmfayard self-assigned this Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
1 participant