Skip to content

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

@nightwolfzor

Description

@nightwolfzor

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions