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

How to avoid generating versions.properties? #640

Open
joffrey-bion opened this issue Oct 9, 2022 · 7 comments
Open

How to avoid generating versions.properties? #640

joffrey-bion opened this issue Oct 9, 2022 · 7 comments
Assignees

Comments

@joffrey-bion
Copy link

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
Copy link
Member

LouisCAD commented Oct 9, 2022

Not yet

@joffrey-bion
Copy link
Author

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
Copy link
Contributor

Vampire commented Feb 6, 2023

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
Copy link
Contributor

Vampire commented Feb 6, 2023

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
Copy link
Author

joffrey-bion commented Feb 6, 2023

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
Copy link
Author

Any chance this could get some attention?

@LouisCAD LouisCAD pinned this issue Aug 18, 2023
@LouisCAD
Copy link
Member

Yes, hopefully this year.

@LouisCAD LouisCAD self-assigned this Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants