-
Notifications
You must be signed in to change notification settings - Fork 103
Closed
Description
Background:
- Multi-module project, where I want to release submodules separately, tag them accordingly, and base versioning on tags with separate prefixes
- In Gradle world, I would use the Axion-release plugin and configure the
prefixproperty. - In SBT world, I can use
sbt-releasefor the release logic, but for deriving version numbers implicitly from tagssbt-gitis the place to go.
Diving into the details in sbt-git:
- Under the covers, using
useGitDescribeinvokes the equivalent ofgit describe --tags, as documented here. For my project which includes two submodulesadaptersandtransformers, this will always give me the tag of whatever was most recently released, rather than the one I'm interested in, for example:
$ git describe --tags
adapters-0.28.0-2-g4bc98ad- What I would like to do is to be able to configure
sbt-gitto set a tag prefix based on which module I'm interested in. Under the covers, this could usegit describe's native regex matching, i.e.
$ git describe --tags --match "transformers-*"
transformers-0.22.0-5-g4bc98ad
$ git describe --tags --match "adapters-*"
adapters-0.28.0-2-g4bc98ad- An alternative (which I originally was looking at) would be to use a custom
gitTagToVersionNumberfunction. However, the tags passed to this function bysbt-gitare only the ones that explicitly match the current commit - thegitCurrentTagsvalue filters out any tag whose associated commit does not exactly match the commit at HEAD - so it doesn't find "closest match" tags in the way thatgit describedoes. - However, I do notice that
JGitdoesn't yet support the--matchfunctionality.
Next steps
I need this functionality, so I'll probably go down the road of implementing it myself. Rather than have it just a local change, I'd prefer to contribute it back as I imagine other developers may find it useful. To this end:
- Are you interested in having this functionality publicly available in
sbt-git? - If so:
- how would you prefer to have it configured?
- how would you prefer to have it implemented? I guess the ideal would be to add explicit JGit support for
--match, and then use that; however it may be quicker to implement the--matchfunctionality locally. Or alternatively, you may prefer to update thegitCurrentTagsfunctionality to return all tags that relate to the current commit's history, rather than just to the current commit itself.
Thanks for your time in reading this.
sdether
Metadata
Metadata
Assignees
Labels
No labels