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

How to avoid generating `versions.properties`? #640

Open joffrey-bion opened 2 years ago

joffrey-bion commented 2 years ago

I'm using exclusively the version catalog libs.versions.toml, but when running refreshVersions, the versions.properties file is always regenerated (with nothing but the header comment in it).

Is there any way to prevent this?

LouisCAD commented 2 years ago

Not yet

joffrey-bion commented 2 years ago

Ok, thanks for your very quick response! Should I leave this open to track it or is there already an issue for this? (I couldn't find it)

Vampire commented 1 year ago

This way you can avoid it if you do not use the library notations coming with the plugin:

gradle.rootProject {
    tasks.configureEach {
        if (name == "refreshVersions") {
            doLast {
                delete("versions.properties")
            }
        }
    }
}
Vampire commented 1 year ago

Or you configure a path for the file that is not version controlled and doesn't disturb like

refreshVersions {
    file("build/tmp/refreshVersions").mkdirs()
    versionsPropertiesFile = file("build/tmp/refreshVersions/versions.properties")
}
joffrey-bion commented 1 year ago

Thanks! I don't know why I didn't think of that. It still feels a bit hacky of course, but better than versioning a comment-only version file.

It would be great if the plugin detected that the file doesn't need to be created we there is nothing to write to it

joffrey-bion commented 1 year ago

Any chance this could get some attention?

LouisCAD commented 1 year ago

Yes, hopefully this year.