Skip to content

v3.0.0-rc

Compare
Choose a tag to compare
@kzu kzu released this 10 Feb 01:54
· 94 commits to main since this release
Set Version and PackageVersion to a default value

It's not entirely intuitive that you install GitInfo and by default
"nothing happens", as in, you get new code from ThisAssembly,
but otherwise, no versioning changes happen. This might be
counterintuitive to newcomers, who might just care to get
something (a sensible default) going, before investing more
in customizing GitInfo.

This is how MinVer does it (provided there's a version tag
in the repository) and it's quite intuitive.

The way we do it here should be mostly backwards compat
because:
1. Users leveraging assembly-version attributes will already
    have disabled .NET SDK assembly attribute generation
2. Users leveraging MSBuild targets to do this would be
    following the recommended guidance of creating a target
    that runs before specific targets, not as InitialTargets

We make our version-setting target run as an inital target,
which may have a minor impact on initial build perf, but
but shouldn't be a problem since the same targets are
run for DTB anyway (if you make them run before
GetAssemblyVersion, which also runs before
BeforeCompile and CoreCompile in the SDK).

By being an initial target, we allow for existing customization
in pretty much any target, prevail our own one, which becomes
just a default.

Even so, we check for GitVersion=false as an escape hatch for
users who may encounter unforseen broken scenarios.