Skip to content

Versioning problems - sbt-git plugin's versionWithGit & git.baseVersion does not work #14

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

Open
nightwolfzor opened this issue Nov 12, 2014 · 2 comments

Comments

@nightwolfzor
Copy link

Looks like some of the examples are a bit broken in Ch12 (also ch10).

We have git.baseVersion := "0.1"

Then in our def PreownedKittenProject we have .settings(versionWithGit:_*)

This does not work, when running sbt version we see something like 1.0-gitSha... Not 0.1-gitSha...

Also the version.properties file val content = "version=%s" format (gitHeadCommitSha.value) is just using the gitHeadCommitSha not the value from the sbt-git plugin... This gives inconsistent versions. I will agree that it makes it nicer as you dont need to reload the project on each commit to get the version.properties file updated but its a big inconsistency.

versionWithGit seems to be the way to go, so it would be nice to have this working consistently...

I think git.baseVersion := "0.1" should be a part of the settings block in the def PreownedKittenProject(name: String) block (where organization is defined)...

How to use this in the version.properties file I'm not sure... Changing to val content = "version=%s" format (version.value) will work but it wont pickup changes when committing without doing a sbt reload which is a hassle... We need some taskKey to update the version value... I'm not that far through the book so not sure where to start on this one...

@WorkDayHeyHey
Copy link

I am trying to use this for my builds too and find that it works sometimes.

If I load and enter version I get git.baseVersion+SHA, even though I have previously tagged versions, that I see if I enter git tag.

If I "release v#.#" and then run version I see that version. If I release V#.#+1, the tag is added to git but the jar (I am using assemly) is versioned with the first tag of the session and version also shows the first tag also.

If I exit I come back to base+SHA

@WorkDayHeyHey
Copy link

also:

knows about at least the latest tags: > gitCurrentTags
[info] List(v0.4, v0.5)

and if I add useJGit then >version shows the oldest of the two

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

2 participants