ajoberstar / reckon

Infer a project's version from your Git repository.
Apache License 2.0
185 stars 28 forks source link

Property for last stable version #118

Open sgarfinkel opened 5 years ago

sgarfinkel commented 5 years ago

I use Asciidoctor to build my documentation, which is convenient because I can simply pass in the version number as an attribute to my documentation. However, I'd like a way of passing in the last "stable" version (a non-snapshot/final version) rather than just the current version, which might be a SNAPSHOT version.

Is there any convenient way to access this information?

ajoberstar commented 5 years ago

Just confirming I'm following. So if you had released 1.2.3 and were now working on 1.3.0-SNAPSHOT, you want to be able to access the 1.2.3 version somehow?

If so, you can't access that right now, though I agree that there's value in it. Probably involves some subset (or all of) the VcsInventory being accessible.

sgarfinkel commented 5 years ago

@ajoberstar That's exactly what I'd like. There's a lot of times I might have a snapshot release living in master, which might be several commits ahead of the last stable release, but when I generate my documentation I'd like to have access to both the current version and whatever the last stable version.

sgarfinkel commented 5 years ago

@ajoberstar Is there any way to do this temporarily with a buildSrc script? It looks like a lot of API is private or package private.

ajoberstar commented 5 years ago

No, it's all hidden at this point. I'll have to expose something new in the API to make this possible.

keykey7 commented 4 years ago

Having exactly the same usecase and would like to see this feature. My current workaround is to pass this as an asciidoc attribute:

"git tag -l --sort=-v:refname".execute().in.readLines().find {it ==~ /\d+\.\d+\.\d+/}