-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
68 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters