Skip to content

Commit cb18245

Browse files
committed
Merge branch 'release/10.0.0'
2 parents 2ca91d0 + 903e16a commit cb18245

File tree

8 files changed

+82
-47
lines changed

8 files changed

+82
-47
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"cake.tool": {
6-
"version": "6.0.0",
6+
"version": "6.1.0",
77
"commands": [
88
"dotnet-cake"
99
]

CodeCoverage.runsettings

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
<!-- Match fully qualified names of functions: -->
1111
<Functions>
1212
<Exclude>
13-
<Function>HttpMultipartParser\.Properties\..*</Function>
14-
<Function>HttpMultipartParser\.Models\..*</Function>
15-
<Function>HttpMultipartParser\.Utilities\.Log\..*</Function>
16-
<Function>System\.Text\.Json\.SourceGeneration\..*</Function>
17-
<Function>System\.Runtime\.CompilerServices\..*</Function>
13+
<Function>^HttpMultipartParser\.Properties\..*</Function>
14+
<Function>^HttpMultipartParser\.Models\..*</Function>
15+
<Function>^HttpMultipartParser\.Utilities\.Log\..*</Function>
16+
<Function>^System\.Text\.Json\.SourceGeneration\..*</Function>
17+
<Function>^System\.Runtime\.CompilerServices\..*</Function>
1818
</Exclude>
1919
</Functions>
2020

2121
<!-- Match attributes on any code element: -->
2222
<Attributes>
2323
<Exclude>
24-
<Attribute>HttpMultipartParser\.Utilities\.ExcludeFromCodeCoverageAttribute</Attribute>
25-
<Attribute>System\.Obsolete</Attribute>
26-
<Attribute>System\.CodeDom\.Compiler\.GeneratedCodeAttribute</Attribute>
27-
<Attribute>System\.Runtime\.CompilerServices\.CompilerGeneratedAttribute</Attribute>
24+
<Attribute>^System\.Diagnostics\.DebuggerHiddenAttribute$</Attribute>
25+
<Attribute>^System\.Diagnostics\.DebuggerNonUserCodeAttribute$</Attribute>
26+
<Attribute>^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute>
27+
<Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>
2828
</Exclude>
2929
</Attributes>
3030

Source/HttpMultipartParser.Benchmark/HttpMultipartParser.Benchmark.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="BenchmarkDotNet" Version="0.15.6" />
9+
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

Source/HttpMultipartParser.UnitTests/HttpMultipartParser.UnitTests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
23-
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.1.0" />
24-
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.0" />
22+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
23+
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.5.1" />
24+
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
2525
</ItemGroup>
2626

2727
<ItemGroup>

Source/HttpMultipartParser/HttpMultipartParser.csproj

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net48;netstandard2.1</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
55
<LangVersion>preview</LangVersion>
66
<PlatformTarget>anycpu</PlatformTarget>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -40,18 +40,13 @@
4040
</PropertyGroup>
4141

4242
<ItemGroup>
43-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
43+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.103" PrivateAssets="All" />
4444
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
4545
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
4646
<PackageReference Include="System.Buffers" Version="4.6.1" />
4747
</ItemGroup>
4848

49-
<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
50-
<Reference Include="Microsoft.CSharp" />
51-
<Reference Include="System" />
52-
</ItemGroup>
53-
54-
<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) ">
49+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
5550
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
5651
</ItemGroup>
5752

appveyor.psm1

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ $ErrorActionPreference = 'Stop'
55
# Implements the AppVeyor 'install' step and installs the desired .NET SDK if not already installed.
66
function Invoke-AppVeyorInstall {
77

8+
$StartTime = Get-Date
9+
810
Write-Verbose -Verbose "Determining the desired version of .NET SDK"
911
$globalDotJson = Get-Content (Join-Path $PSScriptRoot 'global.json') -Raw | ConvertFrom-Json
1012
$desiredDotNetCoreSDKVersion = $globalDotJson.sdk.version
@@ -51,8 +53,17 @@ function Invoke-AppVeyorInstall {
5153
sudo bash dotnet-install.sh --version $desiredDotNetCoreSDKVersion --install-dir /usr/share/dotnet
5254
}
5355
else {
56+
# Starting in late 2024, installing .NET SDK without specifying the installation location caused
57+
# ONLY the newly installed .NET SDK to be detected instead of being installed side-by-side with
58+
# the other version(s) of the SDK already installed. I did not notice this situation until a year
59+
# later (November 30 2025) when GitVersion.Tool 2.5.1 would error out with the following exception:
60+
# "You must install or update .NET to run this application.". Presumably, this exception was caused
61+
# by the fact that GitVersion requires a different version of the .NET SDK to be present.
62+
#
63+
# This situation is eerily similar with what I experienced on Ubuntu in AppVeyor several years ago.
64+
5465
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile dotnet-install.ps1
55-
.\dotnet-install.ps1 -Version $desiredDotNetCoreSDKVersion
66+
.\dotnet-install.ps1 -Version $desiredDotNetCoreSDKVersion -InstallDir "$env:ProgramFiles\dotnet"
5667
}
5768
}
5869
finally {
@@ -64,4 +75,8 @@ function Invoke-AppVeyorInstall {
6475
else {
6576
Write-Verbose -Verbose "We have determined that the desired version of the .NET SDK is already installed on this machine"
6677
}
78+
79+
# Display elapsed time in a readable format
80+
$Elapsed = (Get-Date) - $StartTime
81+
Write-Verbose -Verbose "Checking/installing the desired .NET SDK took: $Elapsed"
6782
}

build.cake

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Install tools.
2-
#tool dotnet:?package=GitVersion.Tool&version=6.5.0
2+
#tool dotnet:?package=GitVersion.Tool&version=6.6.0
33
#tool nuget:?package=GitReleaseManager&version=0.20.0
4-
#tool nuget:?package=ReportGenerator&version=5.5.0
4+
#tool nuget:?package=ReportGenerator&version=5.5.2
55
#tool nuget:?package=xunit.runner.console&version=2.9.3
66
#tool nuget:?package=CodecovUploader&version=0.8.0
77

88
// Install addins.
99
#addin nuget:?package=Cake.Git&version=5.0.1
10-
#addin nuget:?package=Cake.Codecov&version=3.0.0
10+
#addin nuget:?package=Cake.Codecov&version=6.0.0
1111

1212

1313
///////////////////////////////////////////////////////////////////////////////
@@ -428,19 +428,7 @@ Task("Generate-Benchmark-Report")
428428
.Append($"-tl:{terminalLogger}")
429429
});
430430

431-
using (DiagnosticVerbosity())
432-
{
433-
var processResult = StartProcess(
434-
publishedAppLocation,
435-
new ProcessSettings()
436-
{
437-
Arguments = $"-f * --artifacts={artifactsLocation}"
438-
});
439-
if (processResult != 0)
440-
{
441-
throw new Exception($"dotnet-benchmark.exe did not complete successfully. Result code: {processResult}");
442-
}
443-
}
431+
Context.ExecuteCommand(publishedAppLocation, $"-f * --artifacts={artifactsLocation}");
444432
});
445433

446434

@@ -452,7 +440,7 @@ Task("Coverage")
452440
.IsDependentOn("Generate-Code-Coverage-Report")
453441
.Does(() =>
454442
{
455-
StartProcess("cmd", $"/c start {codeCoverageDir}index.htm");
443+
Context.ExecuteCommand("cmd", $"/c start {codeCoverageDir}index.htm");
456444
});
457445

458446
Task("Benchmark")
@@ -463,7 +451,7 @@ Task("Benchmark")
463451
var htmlReports = GetFiles($"{benchmarkDir}results/*-report.html", new GlobberSettings { IsCaseSensitive = false });
464452
foreach (var htmlReport in htmlReports)
465453
{
466-
StartProcess("cmd", $"/c start {htmlReport}");
454+
Context.ExecuteCommand("cmd", $"/c start {htmlReport}");
467455
}
468456
});
469457

@@ -497,7 +485,6 @@ Task("Default")
497485
RunTarget(target);
498486

499487

500-
501488
///////////////////////////////////////////////////////////////////////////////
502489
// PRIVATE METHODS
503490
///////////////////////////////////////////////////////////////////////////////
@@ -518,17 +505,55 @@ static string TrimStart(this string source, string value, StringComparison compa
518505
return source.Substring(startIndex);
519506
}
520507

521-
static List<string> ExecuteCommand(this ICakeContext context, FilePath exe, string args)
508+
static IDisposable GetDisposableVerbosity(this ICakeContext context, Verbosity verbosity)
509+
{
510+
return verbosity switch
511+
{
512+
Verbosity.Diagnostic => context.DiagnosticVerbosity(),
513+
Verbosity.Minimal => context.MinimalVerbosity(),
514+
Verbosity.Normal => context.NormalVerbosity(),
515+
Verbosity.Quiet => context.QuietVerbosity(),
516+
Verbosity.Verbose => context.VerboseVerbosity(),
517+
_ => throw new ArgumentOutOfRangeException(nameof(verbosity), $"Unknown verbosity: {verbosity}"),
518+
};
519+
}
520+
521+
static List<string> ExecuteCommand(this ICakeContext context, FilePath exe, string args, bool captureStandardOutput = false, Verbosity verbosity = Verbosity.Diagnostic)
522522
{
523-
context.StartProcess(exe, new ProcessSettings { Arguments = args, RedirectStandardOutput = true }, out var redirectedOutput);
523+
return context.ExecuteCommand(exe, new ProcessArgumentBuilder().Append(args), captureStandardOutput, verbosity);
524+
}
524525

525-
return redirectedOutput.ToList();
526+
static List<string> ExecuteCommand(this ICakeContext context, FilePath exe, ProcessArgumentBuilder argsBuilder, bool captureStandardOutput = false, Verbosity verbosity = Verbosity.Diagnostic)
527+
{
528+
using (context.GetDisposableVerbosity(verbosity))
529+
{
530+
var processResult = context.StartProcess(
531+
exe,
532+
new ProcessSettings()
533+
{
534+
Arguments = argsBuilder,
535+
RedirectStandardOutput = captureStandardOutput,
536+
RedirectStandardError= true
537+
},
538+
out var redirectedOutput,
539+
out var redirectedError
540+
);
541+
542+
if (processResult != 0 || redirectedError.Count() > 0)
543+
{
544+
var errorMsg = string.Join(Environment.NewLine, redirectedError.Where(s => !string.IsNullOrWhiteSpace(s)));
545+
var innerException = !string.IsNullOrEmpty(errorMsg) ? new Exception(errorMsg) : null;
546+
throw new Exception($"{exe} did not complete successfully. Result code: {processResult}", innerException);
547+
}
548+
549+
return (redirectedOutput ?? Array.Empty<string>()).ToList();
550+
}
526551
}
527552

528553
static List<string> ExecGitCmd(this ICakeContext context, string cmd)
529554
{
530555
var gitExe = context.Tools.Resolve(context.IsRunningOnWindows() ? "git.exe" : "git");
531-
return context.ExecuteCommand(gitExe, cmd);
556+
return context.ExecuteCommand(gitExe, cmd, true);
532557
}
533558

534559
static string GetBuildBranch(this ICakeContext context)

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "10.0.100",
3+
"version": "10.0.103",
44
"rollForward": "patch",
55
"allowPrerelease": false
66
},

0 commit comments

Comments
 (0)