Splitties / refreshVersions

Life is too short to google for dependencies and versions
https://splitties.github.io/refreshVersions/
MIT License
1.66k stars 107 forks source link

Version is flagged as unused when it's only used by `versionFor()` #511

Closed pvarry closed 2 years ago

pvarry commented 2 years ago

⚠️ Current behavior

My versions get unused

✅ Expected behavior

Do not add unused when it's used by versionFor()

💣 Steps to reproduce

composeOptions {
    kotlinCompilerExtensionVersion = versionFor(AndroidX.compose.compiler)
}

Note: Compose Compiler need to be used only in versionFor to be annotated with unused

📱 Tech info

PS: Thanks for this wonderful library

pvarry commented 2 years ago

Hello, any news on this @jmfayard @LouisCAD ?

LouisCAD commented 2 years ago

Hello, I just made an experiment to see if we can avoid this unwanted unused comment, and it should work, so I'll try to implement it soon.

We should also be able to factor these usages in when looking for available versions.

Thanks for raising this back.

LouisCAD commented 2 years ago

The 0.41.0-SNAPSHOT version contains the change that addresses this issue. I'll publish a release this weekend or next week.

jmfayard commented 2 years ago

Please don't override version 0.40.2-SNAPSHOT@louiscad

Some people use it since months to get dependencies updates in their versions catalog

https://github.com/jmfayard/refreshVersions/pull/509

LouisCAD commented 2 years ago

I think the 0.40.2 release did remove the related snapshot, not this 0.41.0 snapshot.

mcpiroman commented 1 year ago

OK, but apparently the version is still not being updated by refreshVersions? I expect it to be as it is indeed used.

LouisCAD commented 1 year ago

@mcpiroman Wrong issue, or you're on an older version?

mcpiroman commented 1 year ago

I mean I have

[versions]
skiko = "0.7.42"
[libraries]
skiko = { module = "org.jetbrains.skiko:skiko", version.ref = "skiko" }

Then I do api("org.jetbrains.skiko:skiko-awt-runtime-${targetOs}-${targetArch}:${versionFor("org.jetbrains.skiko:skiko:_")}") Then the update comments are not generated for skiko.

Is this maybe some other issue? I use 0.51.0

LouisCAD commented 1 year ago

Are you using configureOnDemand?

mcpiroman commented 1 year ago

I don't.