Repository navigation
Support GitVersion v7
#755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,10 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/Fallout-build/Fallout/main/src/Fallout.Tooling.Generator/schema.json", | ||
| "references": [ | ||
| "https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/more-info/variables.md", | ||
| "https://raw.githubusercontent.com/GitTools/GitVersion/master/src/GitVersionExe/HelpWriter.cs" | ||
| "https://gitversion.net/docs/usage/cli/arguments" | ||
| ], | ||
| "name": "GitVersion", | ||
| "officialUrl": "http://gitversion.readthedocs.io/en/stable/", | ||
| "officialUrl": "https://gitversion.net/docs/", | ||
| "help": "GitVersion is a tool to help you achieve Semantic Versioning on your project.", | ||
| "nugetPackageId": "GitVersion.Tool", | ||
| "nugetFramework": true, | ||
|
|
@@ -25,142 +24,195 @@ | |
| { | ||
| "name": "Version", | ||
| "type": "bool", | ||
| "format": "/version", | ||
| "format": "--version", | ||
| "help": "Displays the version of GitVersion." | ||
| }, | ||
| { | ||
| "name": "Diagnostics", | ||
| "type": "bool", | ||
| "format": "/diag", | ||
| "help": "Runs GitVersion with additional diagnostic information (requires git.exe to be installed)." | ||
| "format": "--diagnose", | ||
| "help": "Runs GitVersion with additional diagnostic information. Also needs <c>--log-file</c> (requires git.exe to be installed)." | ||
| }, | ||
| { | ||
| "name": "Output", | ||
| "type": "GitVersionOutput", | ||
| "format": "/output {value}", | ||
| "help": "Determines the output to the console. Can be either <em>json</em> or <em>buildserver</em>, will default to <em>json</em>." | ||
| "format": "--output {value}", | ||
| "help": "Determines the output to the console. Can be <c>json</c>, <c>file</c>, <c>buildserver</c>, or <c>dotenv</c>. The default is <c>json</c>." | ||
| }, | ||
| { | ||
| "name": "OutputFile", | ||
| "type": "string", | ||
| "format": "--output-file {value}", | ||
| "help": "Path to the output file. Used together with <c>--output file</c>." | ||
| }, | ||
| { | ||
| "name": "ShowVariable", | ||
| "type": "string", | ||
| "format": "/showvariable {value}", | ||
| "help": "Used in conjuntion with <c>/output</c> json, will output just a particular variable. E.g., <c>/output json /showvariable SemVer</c> - will output <c>1.2.3+beta.4</c>." | ||
| "format": "--show-variable {value}", | ||
| "help": "Used together with <c>--output json</c>. Prints one variable. For example, <c>--output json --show-variable SemVer</c> prints <c>1.2.3+beta.4</c>." | ||
| }, | ||
| { | ||
| "name": "Format", | ||
| "type": "string", | ||
| "format": "--format {value}", | ||
| "help": "Used together with <c>--output json</c>. Prints a format string that contains version variables. For example, <c>--format {Major}.{Minor}</c> prints <c>1.2</c>." | ||
| }, | ||
| { | ||
| "name": "LogFile", | ||
| "type": "string", | ||
| "format": "/l {value}", | ||
| "help": "Path to logfile." | ||
| "format": "--log-file {value}", | ||
| "help": "Path to the log file. Use <c>console</c> to write the log to stderr." | ||
| }, | ||
| { | ||
| "name": "Config", | ||
| "type": "string", | ||
| "format": "--config {value}", | ||
| "help": "Path to the config file. The default is <c>GitVersion.yml</c>, <c>GitVersion.yaml</c>, <c>.GitVersion.yml</c>, or <c>.GitVersion.yaml</c>." | ||
| }, | ||
| { | ||
| "name": "ShowConfig", | ||
| "type": "bool", | ||
| "format": "/showconfig", | ||
| "help": "Outputs the effective GitVersion config (defaults + custom from GitVersion.yml) in yaml format." | ||
| "format": "--show-config", | ||
| "help": "Prints the effective GitVersion config in YAML format." | ||
| }, | ||
| { | ||
| "name": "ConfigurationOverride", | ||
| "type": "Dictionary<string, object>", | ||
| "format": "/overrideconfig {key}={value}", | ||
| "help": "Overrides GitVersion config values inline (semicolon-separated key value pairs e.g. <c>/overrideconfig tag-prefix=Foo</c>). Currently supported config overrides: <c>tag-prefix</c>." | ||
| "format": "--override-config {key}={value}", | ||
| "help": "Overrides GitVersion config values inline. For example, <c>--override-config workflow=GitHubFlow/v1</c>." | ||
| }, | ||
| { | ||
| "name": "NoCache", | ||
| "type": "bool", | ||
| "format": "/nocache", | ||
| "help": "Bypasses the cache, result will not be written to the cache." | ||
| "format": "--no-cache", | ||
| "help": "Bypasses the cache. The result is not written to the cache." | ||
| }, | ||
| { | ||
| "name": "NoNormalize", | ||
| "type": "bool", | ||
| "format": "--no-normalize", | ||
| "help": "Disables the normalize step on a build server." | ||
| }, | ||
| { | ||
| "name": "AllowShallow", | ||
| "type": "bool", | ||
| "format": "--allow-shallow", | ||
| "help": "Allows GitVersion to run on a shallow clone. The clone must still contain the history needed to calculate the version." | ||
| }, | ||
| { | ||
| "name": "UpdateAssemblyInfo", | ||
| "type": "bool", | ||
| "format": "/updateassemblyinfo", | ||
| "help": "Will recursively search for all 'AssemblyInfo.cs' files in the git repo and update them." | ||
| "format": "--update-assembly-info", | ||
| "help": "Recursively searches for <c>AssemblyInfo.cs</c> files in the git repo and updates them." | ||
| }, | ||
| { | ||
| "name": "UpdateAssemblyInfoFileNames", | ||
| "type": "List<string>", | ||
| "format": "/updateassemblyinfofilename {value}", | ||
| "format": "--update-assembly-info {value}", | ||
| "separator": " ", | ||
| "help": "Specify name of AssemblyInfo files to update." | ||
| "help": "Names of AssemblyInfo files to update." | ||
| }, | ||
| { | ||
| "name": "EnsureAssemblyInfo", | ||
| "type": "bool", | ||
| "format": "/ensureassemblyinfo", | ||
| "help": "If the assembly info file specified with <c>/updateassemblyinfo</c> or <c>/updateassemblyinfofilename</c> is not found, it will be created with these attributes: AssemblyFileVersion, AssemblyVersion and AssemblyInformationalVersion." | ||
| "format": "--ensure-assembly-info", | ||
| "help": "Creates a missing assembly info file named by <c>--update-assembly-info</c>. The file gets AssemblyFileVersion, AssemblyVersion, and AssemblyInformationalVersion." | ||
| }, | ||
| { | ||
| "name": "UpdateProjectFiles", | ||
| "type": "List<string>", | ||
| "format": "--update-project-files {value}", | ||
| "separator": " ", | ||
| "help": "Project files (<c>.csproj</c>, <c>.vbproj</c>, <c>.fsproj</c>, <c>.sqlproj</c>) to update. Only SDK-style projects are supported." | ||
| }, | ||
| { | ||
| "name": "UpdateWixVersionFile", | ||
| "type": "bool", | ||
| "format": "--update-wix-version-file", | ||
| "help": "Writes the GitVersion variables to <c>GitVersion_WixVersion.wxi</c>." | ||
| }, | ||
| { | ||
| "name": "Url", | ||
| "type": "string", | ||
| "format": "/url {value}", | ||
| "help": "Url to remote git repository." | ||
| "format": "--url {value}", | ||
| "help": "Url to the remote git repository." | ||
| }, | ||
| { | ||
| "name": "Branch", | ||
| "type": "string", | ||
| "format": "/b {value}", | ||
| "help": "Name of the branch to use on the remote repository, must be used in combination with <c>/url</c>." | ||
| "format": "--branch {value}", | ||
| "help": "Branch to version. This is used on its own for a local branch, or together with <c>--url</c> for a remote repository." | ||
| }, | ||
| { | ||
| "name": "Username", | ||
| "type": "string", | ||
| "format": "/u {value}", | ||
| "help": "Username in case authentication is required." | ||
| "format": "--username {value}", | ||
| "help": "Username when authentication is required." | ||
| }, | ||
| { | ||
| "name": "Password", | ||
| "type": "string", | ||
| "format": "/p {value}", | ||
| "format": "--password {value}", | ||
| "secret": true, | ||
| "help": "Password in case authentication is required." | ||
| "help": "Password when authentication is required." | ||
| }, | ||
| { | ||
| "name": "Commit", | ||
| "type": "string", | ||
| "format": "/c {value}", | ||
| "help": "The commit id to check. If not specified, the latest available commit on the specified branch will be used." | ||
| "format": "--commit {value}", | ||
| "help": "The commit id to check. If not specified, the latest commit on the specified branch is used." | ||
| }, | ||
| { | ||
| "name": "DynamicRepositoryLocation", | ||
| "type": "string", | ||
| "format": "/dynamicRepoLocation {value}", | ||
| "help": "By default dynamic repositories will be cloned to %tmp%. Use this switch to override." | ||
| "format": "--dynamic-repo-location {value}", | ||
| "help": "Directory for dynamic repositories. The default is the temp directory." | ||
| }, | ||
| { | ||
| "name": "NoFetch", | ||
| "type": "bool", | ||
| "format": "/nofetch", | ||
| "help": "Disables <c>git fetch</c> during version calculation. Might cause GitVersion to not calculate your version as expected." | ||
| "format": "--no-fetch", | ||
| "help": "Disables <c>git fetch</c> during version calculation. GitVersion may then calculate a different version than expected." | ||
| }, | ||
| { | ||
| "name": "Executable", | ||
| "type": "string", | ||
| "format": "/exec {value}", | ||
| "help": "Executes target executable making GitVersion variables available as environmental variables." | ||
| "noArgument": true, | ||
| "help": "Removed in GitVersion 7.", | ||
| "deprecationMessage": "Removed in GitVersion 7." | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These four properties get a plain |
||
| }, | ||
| { | ||
| "name": "ExecutableArguments", | ||
| "type": "string", | ||
| "format": "/execargs {value}", | ||
| "help": "Arguments for the executable specified by <c>/exec</c>." | ||
| "noArgument": true, | ||
| "help": "Removed in GitVersion 7.", | ||
| "deprecationMessage": "Removed in GitVersion 7." | ||
| }, | ||
| { | ||
| "name": "MSBuildProject", | ||
| "type": "string", | ||
| "format": "/proj {value}", | ||
| "help": "Build an MSBuild file, GitVersion variables will be passed as MSBuild properties." | ||
| "noArgument": true, | ||
| "help": "Removed in GitVersion 7.", | ||
| "deprecationMessage": "Removed in GitVersion 7." | ||
| }, | ||
| { | ||
| "name": "MSBuildProjectArguments", | ||
| "type": "string", | ||
| "format": "/projargs {value}", | ||
| "help": "Additional arguments to pass to MSBuild." | ||
| "noArgument": true, | ||
| "help": "Removed in GitVersion 7.", | ||
| "deprecationMessage": "Removed in GitVersion 7." | ||
| }, | ||
| { | ||
| "name": "TelemetryOptOut", | ||
| "type": "bool", | ||
| "format": "--telemetry-opt-out", | ||
| "help": "Disables optional sampled usage telemetry." | ||
| }, | ||
| { | ||
| "name": "Verbosity", | ||
| "type": "GitVersionVerbosity", | ||
| "format": "/verbosity {value}", | ||
| "help": "Set Verbosity level (<c>debug</c>, <c>info</c>, <c>warn</c>, <c>error</c>, <c>none</c>). Default is <c>info</c>." | ||
| "format": "--verbosity {value}", | ||
| "help": "Amount of information to display (<c>Quiet</c>, <c>Minimal</c>, <c>Normal</c>, <c>Verbose</c>, <c>Diagnostic</c>). The default is <c>Normal</c>." | ||
| } | ||
| ] | ||
| } | ||
|
|
@@ -171,17 +223,19 @@ | |
| "name": "GitVersionOutput", | ||
| "values": [ | ||
| "json", | ||
| "buildserver" | ||
| "file", | ||
| "buildserver", | ||
| "dotenv" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "GitVersionVerbosity", | ||
| "values": [ | ||
| "debug", | ||
| "info", | ||
| "warn", | ||
| "error", | ||
| "none" | ||
| "Quiet", | ||
| "Minimal", | ||
| "Normal", | ||
| "Verbose", | ||
| "Diagnostic" | ||
| ] | ||
| } | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,9 +46,10 @@ public override object GetValue(MemberInfo member, object instance) | |
| } | ||
|
|
||
| var gitVersion = GitVersionTasks.GitVersion(s => s | ||
| .SetFramework(Framework) | ||
| .SetFramework(Framework ?? "net10.0") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔🤖 A null |
||
| .SetNoFetch(NoFetch) | ||
| .SetNoCache(NoCache) | ||
| .SetVerbosity(GitVersionVerbosity.Quiet) | ||
| .DisableProcessOutputLogging() | ||
| .SetUpdateAssemblyInfo(UpdateAssemblyInfo) | ||
| .When(TeamCity.Instance is { IsPullRequest: true } && !EnvironmentInfo.Variables.ContainsKey("Git_Branch"), _ => _ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/website/03-common/06-versioning.mddoesn't mention that a v6GitVersion.ymlneedsGITVERSION_CONFIGURATION_VERSION=v6with GitVersion 7. The PR text explains it well. Could one line go into the docs too?