refreshVersions icon indicating copy to clipboard operation
refreshVersions copied to clipboard

How to avoid generating `versions.properties`?

Open joffrey-bion opened this issue 3 years ago • 7 comments

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?

joffrey-bion avatar Oct 09 '22 22:10 joffrey-bion

Not yet

LouisCAD avatar Oct 09 '22 22:10 LouisCAD

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)

joffrey-bion avatar Oct 09 '22 22:10 joffrey-bion

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 avatar Feb 06 '23 02:02 Vampire

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")
}

Vampire avatar Feb 06 '23 02:02 Vampire

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 avatar Feb 06 '23 06:02 joffrey-bion

Any chance this could get some attention?

joffrey-bion avatar Apr 29 '23 12:04 joffrey-bion

Yes, hopefully this year.

LouisCAD avatar Aug 18 '23 21:08 LouisCAD