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 check if current version is a snapshot programatically #678

Open
solonovamax opened this issue Nov 20, 2023 · 1 comment · May be fixed by #749
Open

How to check if current version is a snapshot programatically #678

solonovamax opened this issue Nov 20, 2023 · 1 comment · May be fixed by #749

Comments

@solonovamax
Copy link

How would one check if the current version is a snapshot programmatically?

Currently, I am using

val Project.isSnapshot: Boolean
    get() = version.toString().endsWith("-SNAPSHOT")

however, this feels sub-par.

There currently exists a class VersionContext, which contains the field snapshot, which is what I'd like to use, however there is no easy way to get this.
It would be nice if this was exposed publicly (Or some other way to check if the current version is a snapshot)

@bgalek
Copy link
Collaborator

bgalek commented Nov 29, 2023

hi, sure, i think it could be useful, I'll be happy to merge such PR :)

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

Successfully merging a pull request may close this issue.

2 participants