When using cake, I can set which semver part I want updated:
var settings = new MinVerSettings();
settings.AutoIncrement = MinVerAutoIncrement.Major;
var minver = MinVer(settings);
That example is for minver, but the same would apply for nerdbank or gitversion.
How can I do the equivalent with nuke? The docs cover the basics only.
I use this: [MinVer] private readonly MinVer _minVer;
, but am unsure what to do next.
(If you have a working sample for any of gitversion/nerdbank/minver that's fine, I'll adapt it for my needs, as it seems the basic mechanism is identical.)
It depends on the specific tool you are using for the versioning, as its external API is different from each other (and so the tool that nuke inject into your build).
For example, with Nerdbank i can obtain the various parts of the version info like this:
Anyway, keep in mind that you have the freedom to call CLI tools with nuke if the injected tools doesn't satisfy your use case. Check this:
https://nuke.build/docs/common/cli-tools/#lightweight-api
And here an example for your use case that uses this approach: