Open nightwolfzor opened 9 years ago
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
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
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 like1.0-gitSha...
Not 0.1-gitSha...Also the
version.properties
fileval content = "version=%s" format (gitHeadCommitSha.value)
is just using thegitHeadCommitSha
not the value from thesbt-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 theversion.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 thedef PreownedKittenProject(name: String)
block (whereorganization
is defined)...How to use this in the
version.properties
file I'm not sure... Changing toval 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 sometaskKey
to update the version value... I'm not that far through the book so not sure where to start on this one...