Skip to content

fix(GitVersion.Core, GitVersion.Schema): improve implementation of Types and JSON keywords in GitVersion.Configuration.json #3749

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

Merged
merged 16 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
b558b7b
feat(GitVersion.Core, GitVersion.Schema): add support for JSON `defau…
BinToss Nov 25, 2023
1978e75
fix(GitVersion.Configuration): refactor 'JsonPropertyPattern' usage t…
BinToss Nov 16, 2023
bce0ab3
feat(GitVersion.Core, GitVersion.Schema): decouple `format` annotatio…
BinToss Nov 15, 2023
de0377c
refactor(GitVersion.Configuration): utilize JsonPropertyFormat
BinToss Nov 2, 2023
e286f91
refactor(GitVersion.Schema): call AddHandler for Default, Format attr…
BinToss Nov 25, 2023
9364cb0
refactor(GitVersion.Configuration): add .NET 7 StringSyntaxAttribute …
BinToss Nov 2, 2023
63127c3
refactor(GitVersion.Core): add configuration defaults to Configuratio…
BinToss Dec 4, 2023
aa8524e
refactor(GitVersion.Configuration): use 'default' constants in JsonPr…
BinToss Dec 4, 2023
27d22d4
refactor(GitVersion.Core, GitVersion.Configuration): add const var De…
BinToss Nov 27, 2023
82b9a9c
refactor(GitVersion.Configuration): assign 'default' constants to the…
BinToss Dec 4, 2023
ca54838
refactor(GitVersion.Configuration): utilize new const vars in GitFlow…
BinToss Dec 4, 2023
89cc83d
build: fix build.ps1 argument parsing and passing
BinToss Nov 18, 2023
af134dd
refactor(Common): when gitversion.dll not found, throw FileNotFound a…
BinToss Nov 18, 2023
47f2cff
refactor(GitVersion.Configuration): add BeforeString to avoid seriali…
BinToss Nov 27, 2023
9a70b19
chore: regen GitVersion configuration schema (6.0)
BinToss Dec 4, 2023
3dddd7e
cleanup
arturcic Dec 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,30 @@ $Arguments = @{
exclusive=$Exclusive;
nuget_useinprocessclient=$true;
}.GetEnumerator() | ForEach-Object {
if ($_.value -ne "") { "--{0}=`"{1}`"" -f $_.key, $_.value }
if ($($_.Key -ceq "dryrun") -or ($_.Key -ceq "exclusive")) {
if ($_.Value -eq $true) {
# switches must not be assigned true or false, but must be passed to indicate true.
"--{0}" -f $_.Key
}
}
else {
if ($_.Value -cne "") {
if ($_.Value -as [string] -contains " ") {
$_.Value = "$($_.Value)" # if it contains spaces, enclose it.
}
"--{0}={1}" -f $_.Key, $_.Value
}
}
};

$Arguments | Join-String -Separator " " | Write-Verbose

# Start Cake
Write-Host "Running build stage $Stage..."

& dotnet run --project build/$Stage/$Stage.csproj -- $Arguments $ScriptArgs
$cmdline = "& dotnet run --project build/$Stage/$Stage.csproj -- $Arguments $ScriptArgs"
Write-Verbose $cmdline
Invoke-Command -ScriptBlock ([scriptblock]::Create($cmdline))

if ($env:APPVEYOR) {
$host.SetShouldExit($LASTEXITCODE)
Expand Down
3 changes: 1 addition & 2 deletions build/common/Lifetime/BuildLifetimeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ public override void Setup(T context, ISetupContext info)
context.Information("Running BuildPrepare...");
return;
}
var gitVersionTool = context.GetGitVersionDotnetToolLocation();
var gitVersionSettings = new GitVersionSettings
{
OutputTypes = new() { GitVersionOutput.Json, GitVersionOutput.BuildServer },
ToolPath = context.Tools.Resolve(new[] { "dotnet.exe", "dotnet" }),
ArgumentCustomization = args => args.Prepend(gitVersionTool!.FullPath)
ArgumentCustomization = args => args.Prepend(context.GetGitVersionDotnetToolLocation()?.FullPath ?? throw new FileNotFoundException("Failed to locate the Release build of gitversion.dll in ./tools/gitversion. Try running \"./build.ps1 -Stage build -Target BuildPrepare\""))
};

var gitVersion = context.GitVersion(gitVersionSettings);
Expand Down
Loading