From cf474a37383899a41104285ca5f22b1b6f336583 Mon Sep 17 00:00:00 2001 From: Seabiscuit Date: Sat, 15 May 2021 23:24:56 +0800 Subject: [PATCH] Update tooling to .NET 5 (#39) * Update tooling to .NET 5 * Rename 'TaskCompletionSource' to 'DefaultPromise' (#30) --- Directory.Build.props | 21 +- DotnetCLIVersion.txt | 2 +- build.fsx | 185 ++++++++++-------- build.ps1 | 50 +---- build.sh | 25 +-- build/Dependencies.3rdParty.props | 50 ++--- build/Dependencies.AspNetCore.props | 106 +++++----- build/Dependencies.AspNetCore3.props | 71 +++++++ build/Dependencies.Extensions.props | 92 ++++----- build/Dependencies.Extensions3.props | 54 +++++ build/Dependencies.Roslyn.props | 32 +-- build/Dependencies.System.props | 138 ++++++------- build/Dependencies.System2.props | 52 +---- build/Dependencies.System3.props | 103 ++++++++++ build/Dependencies.Testing.props | 26 +-- build/Dependencies.props | 12 +- build/azure-pipeline.template.yaml | 4 +- build/pr-netfx-validation.yaml | 8 +- build/pr-validation.yaml | 14 +- buildNetstandard.fsx | 37 ++-- buildNetstandard.ps1 | 50 +---- buildNetstandard.sh | 25 +-- .../DotNetty.Microbench.csproj | 2 +- perf/DotNetty.Microbench/Program.cs | 2 + .../DotNetty.Buffers.Netstandard.csproj | 2 +- src/DotNetty.Buffers/DotNetty.Buffers.csproj | 2 +- .../DotNetty.Codecs.Http.Netstandard.csproj | 2 +- .../DotNetty.Codecs.Http.csproj | 2 +- .../DefaultHttp2Connection.cs | 2 +- .../DotNetty.Codecs.Http2.Netstandard.csproj | 2 +- .../DotNetty.Codecs.Http2.csproj | 2 +- .../DotNetty.Codecs.Netstandard.csproj | 2 +- src/DotNetty.Codecs/DotNetty.Codecs.csproj | 2 +- .../Concurrency/AbstractEventExecutor.cs | 4 +- .../Concurrency/DefaultProgressivePromise.cs | 2 +- ...kCompletionSource.cs => DefaultPromise.cs} | 27 ++- .../Concurrency/SimplePromiseAggregator.cs | 2 +- .../DotNetty.Common.Netstandard.csproj | 2 +- src/DotNetty.Common/DotNetty.Common.csproj | 9 +- .../Utilities/HashedWheelTimer.cs | 4 +- src/DotNetty.Common/Utilities/TaskEx.cs | 2 +- .../DotNetty.Handlers.Netstandard.csproj | 2 +- .../DotNetty.Handlers.csproj | 2 +- src/DotNetty.Handlers/Tls/TlsHandler.cs | 6 +- src/DotNetty.NetUV/DotNetty.NetUV.csproj | 2 +- .../DotNetty.Transport.Libuv.csproj | 2 +- .../Channels/AbstractChannel.cs | 4 +- .../Channels/AbstractChannelHandlerContext.cs | 4 +- .../Channels/DefaultChannelPipeline.cs | 4 +- .../Channels/Local/LocalChannel.cs | 6 +- .../Channels/Pool/FixedChannelPool.cs | 2 +- .../Channels/VoidChannelPromise.cs | 2 +- .../DotNetty.Transport.Netstandard.csproj | 2 +- .../DotNetty.Transport.csproj | 2 +- src/version.props | 5 + test/Directory.Build.props | 4 +- test/DotNetty.Buffers.Tests/run.net5.cmd | 1 + .../DotNetty.Codecs.Http.Tests.csproj | 4 - .../HttpClientCodecTest.cs | 6 +- test/DotNetty.Codecs.Http.Tests/run.net5.cmd | 1 + .../DefaultHttp2ConnectionDecoderTest.cs | 2 +- .../DefaultHttp2ConnectionEncoderTest.cs | 2 +- .../DefaultHttp2FrameWriterTest.cs | 2 +- .../Http2ConnectionHandlerTest.cs | 10 +- .../Http2ControlFrameLimitEncoderTest.cs | 2 +- .../Http2FrameCodecTest.cs | 2 +- .../Http2FrameRoundtripTest.cs | 2 +- .../StreamBufferingEncoderTest.cs | 2 +- test/DotNetty.Codecs.Http2.Tests/run.net5.cmd | 1 + test/DotNetty.Codecs.Mqtt.Tests/run.net5.cmd | 1 + .../run.net5.cmd | 1 + test/DotNetty.Codecs.Redis.Tests/run.net5.cmd | 1 + test/DotNetty.Codecs.Tests/run.net5.cmd | 1 + .../SingleThreadEventExecutorTests.cs | 6 +- .../Utilities/AsciiStringCharacterTest.cs | 2 + test/DotNetty.Common.Tests/run.net5.cmd | 1 + test/DotNetty.End2End.Tests/End2EndTests.cs | 6 +- test/DotNetty.End2End.Tests/run.net5.cmd | 1 + test/DotNetty.Handlers.Tests/run.net5.cmd | 1 + test/DotNetty.NetUV.Tests/run.net5.cmd | 1 + .../Socket/AbstractSocketReuseFdTest.cs | 4 +- .../Transport/Socket/SocketCancelWriteTest.cs | 4 +- .../Socket/SocketGatheringWriteTest.cs | 6 +- .../Transport/Socket/SocketStringEchoTest.cs | 4 +- test/DotNetty.Suite.Tests/run.net5.cmd | 1 + .../BufReleaseTests.cs | 4 +- .../CompositeBufferGatheringWriteTests.cs | 4 +- .../DetectPeerCloseWithoutReadTests.cs | 4 +- .../DotNetty.Transport.Libuv.Tests.csproj | 1 - .../EchoTests.cs | 4 +- .../EventLoopTests.cs | 4 +- .../ExceptionHandlingTests.cs | 4 +- .../ReadPendingTests.cs | 2 +- .../ResetTests.cs | 8 +- .../run.net5.cmd | 1 + .../Channel/AbstractChannelTest.cs | 2 +- .../AbstractCoalescingBufferQueueTest.cs | 2 +- .../Channel/CoalescingBufferQueueTest.cs | 2 +- .../Local/LocalTransportThreadModelTest.cs | 4 +- .../Pool/FixedChannelPoolMapDeadlockTest.cs | 4 +- test/DotNetty.Transport.Tests/run.net5.cmd | 1 + 101 files changed, 778 insertions(+), 631 deletions(-) create mode 100644 build/Dependencies.AspNetCore3.props create mode 100644 build/Dependencies.Extensions3.props create mode 100644 build/Dependencies.System3.props rename src/DotNetty.Common/Concurrency/{TaskCompletionSource.cs => DefaultPromise.cs} (89%) create mode 100644 test/DotNetty.Buffers.Tests/run.net5.cmd create mode 100644 test/DotNetty.Codecs.Http.Tests/run.net5.cmd create mode 100644 test/DotNetty.Codecs.Http2.Tests/run.net5.cmd create mode 100644 test/DotNetty.Codecs.Mqtt.Tests/run.net5.cmd create mode 100644 test/DotNetty.Codecs.Protobuf.Tests/run.net5.cmd create mode 100644 test/DotNetty.Codecs.Redis.Tests/run.net5.cmd create mode 100644 test/DotNetty.Codecs.Tests/run.net5.cmd create mode 100644 test/DotNetty.Common.Tests/run.net5.cmd create mode 100644 test/DotNetty.End2End.Tests/run.net5.cmd create mode 100644 test/DotNetty.Handlers.Tests/run.net5.cmd create mode 100644 test/DotNetty.NetUV.Tests/run.net5.cmd create mode 100644 test/DotNetty.Suite.Tests/run.net5.cmd create mode 100644 test/DotNetty.Transport.Libuv.Tests/run.net5.cmd create mode 100644 test/DotNetty.Transport.Tests/run.net5.cmd diff --git a/Directory.Build.props b/Directory.Build.props index 77d4841bd..93fee60d5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,12 +8,15 @@ + + + @@ -29,7 +32,7 @@ - 8.0 + 9.0 AnyCPU false @@ -44,6 +47,9 @@ netcore + + $(DefineConstants);NET50;NETCOREAPP;NETCOREAPP_2_0_GREATER;NETCOREAPP_2_1_GREATER;NETCOREAPP_2_X_GREATER;NETCOREAPP_3_0_GREATER;NETCOREAPP_3_1_GREATER;NET_4_0_GREATER;NET_4_5_GREATER;NET_4_6_GREATER + $(DefineConstants);NETCOREAPP;NETCOREAPP_2_0_GREATER;NETCOREAPP_2_1_GREATER;NETCOREAPP_2_X_GREATER;NETCOREAPP_3_0_GREATER;NET_4_0_GREATER;NET_4_5_GREATER;NET_4_6_GREATER @@ -334,6 +340,19 @@ prompt 4 + + True + portable + false + prompt + 5 + + + portable + true + prompt + 5 + diff --git a/DotnetCLIVersion.txt b/DotnetCLIVersion.txt index b365faa62..2563509cb 100644 --- a/DotnetCLIVersion.txt +++ b/DotnetCLIVersion.txt @@ -1 +1 @@ -3.1.404 \ No newline at end of file +5.0.203 \ No newline at end of file diff --git a/build.fsx b/build.fsx index 680327832..0c45041e2 100644 --- a/build.fsx +++ b/build.fsx @@ -49,6 +49,7 @@ let testNetFrameworkVersion = "net471" let testNetFramework451Version = "net452" let testNetCoreVersion = "netcoreapp3.1" let testNetCore21Version = "netcoreapp2.1" +let testNetVersion = "net5.0" Target "Clean" (fun _ -> ActivateFinalTarget "KillCreatedProcesses" @@ -64,10 +65,10 @@ Target "Clean" (fun _ -> //-------------------------------------------------------------------------------- -// Incrementalist targets +// Incrementalist targets //-------------------------------------------------------------------------------- // Pulls the set of all affected projects detected by Incrementalist from the cached file -let getAffectedProjectsTopology = +let getAffectedProjectsTopology = lazy( log (sprintf "Checking inside %s for changes" incrementalistReport) @@ -82,7 +83,7 @@ let getAffectedProjectsTopology = Some(d) ) -let getAffectedProjects = +let getAffectedProjects = lazy( let finalProjects = getAffectedProjectsTopology.Value match finalProjects with @@ -102,8 +103,8 @@ Target "ComputeIncrementalChanges" (fun _ -> match globalTool with | Some t -> t | None -> if isWindows then findToolInSubPath "incrementalist.exe" incrementalistDir - elif isMacOS then incrementalistDir @@ "incrementalist" - else incrementalistDir @@ "incrementalist" + elif isMacOS then incrementalistDir @@ "incrementalist" + else incrementalistDir @@ "incrementalist" let args = StringBuilder() @@ -115,12 +116,12 @@ Target "ComputeIncrementalChanges" (fun _ -> |> append incrementalistReport |> toText - let result = ExecProcess(fun info -> + let result = ExecProcess(fun info -> info.FileName <- incrementalistPath info.WorkingDirectory <- __SOURCE_DIRECTORY__ info.Arguments <- args) (System.TimeSpan.FromMinutes 5.0) (* Reasonably long-running task. *) - if result <> 0 then failwithf "Incrementalist failed. %s" args + if result <> 0 then failwithf "Incrementalist failed. %s" args else log "Skipping Incrementalist - not enabled for this build" ) @@ -145,9 +146,9 @@ let filterProjects selectedProject = Some selectedProject //-------------------------------------------------------------------------------- -// Build targets +// Build targets //-------------------------------------------------------------------------------- -let skipBuild = +let skipBuild = lazy( match getAffectedProjects.Value with | None when runIncrementally -> true @@ -162,12 +163,12 @@ let headProjects = | Some p -> p.Keys |> Seq.toArray ) -Target "Build" (fun _ -> +Target "Build" (fun _ -> if not skipBuild.Value then - let additionalArgs = if versionSuffix.Length > 0 then [sprintf "/p:VersionSuffix=%s" versionSuffix] else [] + let additionalArgs = if versionSuffix.Length > 0 then [sprintf "/p:VersionSuffix=%s" versionSuffix] else [] let buildProject proj = DotNetCli.Build - (fun p -> + (fun p -> { p with Project = proj Configuration = configuration @@ -179,16 +180,18 @@ Target "Build" (fun _ -> ) //-------------------------------------------------------------------------------- -// Tests targets +// Tests targets //-------------------------------------------------------------------------------- type Runtime = | NetCore + | Net | NetFramework let getTestAssembly runtime project = let assemblyPath = match runtime with | NetCore -> !! ("test" @@ "**" @@ "bin" @@ "Debug" @@ testNetCoreVersion @@ fileNameWithoutExt project + ".dll") | NetFramework -> !! ("test" @@ "**" @@ "bin" @@ "Debug" @@ "win-x64" @@ testNetFrameworkVersion @@ fileNameWithoutExt project + ".dll") + | Net -> !! ("src" @@ "**" @@ "bin" @@ "Release" @@ testNetVersion @@ fileNameWithoutExt project + ".dll") if Seq.isEmpty assemblyPath then None @@ -213,72 +216,41 @@ module internal ResultHandling = buildErrorMessage >> Option.iter (failBuildWithMessage errorLevel) -Target "RunTests" (fun _ -> - let projects = - let rawProjects = match (isWindows) with - | true -> !! "./test/*.Tests/*.Tests.csproj" - -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" - -- "./test/*.Tests/DotNetty.Buffers.ReaderWriter.Tests" - | _ -> !! "./test/*.Tests/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here - -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" - -- "./test/*.Tests/DotNetty.Buffers.ReaderWriter.Tests" - rawProjects |> Seq.choose filterProjects - - let runSingleProject project = - let arguments = - match (hasTeamCity) with - | true -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none -teamcity" testNetFrameworkVersion outputTests) - | false -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none" testNetFrameworkVersion outputTests) - - let result = ExecProcess(fun info -> - info.FileName <- "dotnet" - info.WorkingDirectory <- (Directory.GetParent project).FullName - info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0) - - ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result - - CreateDir outputTests - projects |> Seq.iter (runSingleProject) -) - -Target "RunTests451" (fun _ -> - let projects = - let rawProjects = match (isWindows) with - | true -> !! "./test/*.Tests/*.Tests.csproj" - -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" - -- "./test/*.Tests/DotNetty.Buffers.ReaderWriter.Tests" - | _ -> !! "./test/*.Tests/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here - -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" - -- "./test/*.Tests/DotNetty.Buffers.ReaderWriter.Tests" - rawProjects |> Seq.choose filterProjects - - let runSingleProject project = - let arguments = - match (hasTeamCity) with - | true -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none -teamcity" testNetFramework451Version outputTests) - | false -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none" testNetFramework451Version outputTests) +Target "RunTests" (fun _ -> + if not skipBuild.Value then + let projects = + let rawProjects = match (isWindows) with + | true -> !! "./test/*.Tests/*.Tests.csproj" + -- "./test/*.Tests/DotNetty.Transport.Tests.csproj" + -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" + | _ -> !! "./test/*.Tests/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here + -- "./test/*.Tests/DotNetty.Transport.Tests.csproj" + -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" + rawProjects |> Seq.choose filterProjects + + let runSingleProject project = + let arguments = + match (hasTeamCity) with + | true -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none -teamcity" testNetVersion outputTests) + | false -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none" testNetVersion outputTests) - let result = ExecProcess(fun info -> - info.FileName <- "dotnet" - info.WorkingDirectory <- (Directory.GetParent project).FullName - info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0) + let result = ExecProcess(fun info -> + info.FileName <- "dotnet" + info.WorkingDirectory <- (Directory.GetParent project).FullName + info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0) - ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result + ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result - CreateDir outputTests - projects |> Seq.iter (runSingleProject) + CreateDir outputTests + projects |> Seq.iter (runSingleProject) ) -Target "RunTestsNetCore" (fun _ -> +Target "RunTestsNetCore31" (fun _ -> if not skipBuild.Value then let projects = let rawProjects = match (isWindows) with | true -> !! "./test/*.Tests/*.Tests.csproj" - -- "./test/*.Tests/DotNetty.Transport.Tests.csproj" - -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" | _ -> !! "./test/*.Tests/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here - -- "./test/*.Tests/DotNetty.Transport.Tests.csproj" - -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" rawProjects |> Seq.choose filterProjects let runSingleProject project = @@ -303,9 +275,7 @@ Target "RunTestsNetCore21" (fun _ -> let projects = let rawProjects = match (isWindows) with | true -> !! "./test/*.Tests/*.Tests.csproj" - -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" | _ -> !! "./test/*.Tests/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here - -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" rawProjects |> Seq.choose filterProjects let runSingleProject project = @@ -325,9 +295,65 @@ Target "RunTestsNetCore21" (fun _ -> projects |> Seq.iter (runSingleProject) ) +Target "RunTestsNetFx471" (fun _ -> + let projects = + let rawProjects = match (isWindows) with + | true -> !! "./test/*.Tests/*.Tests.csproj" + -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" + -- "./test/*.Tests/DotNetty.Buffers.ReaderWriter.Tests" + | _ -> !! "./test/*.Tests/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here + -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" + -- "./test/*.Tests/DotNetty.Buffers.ReaderWriter.Tests" + rawProjects |> Seq.choose filterProjects + + let runSingleProject project = + let arguments = + match (hasTeamCity) with + | true -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none -teamcity" testNetFrameworkVersion outputTests) + | false -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none" testNetFrameworkVersion outputTests) + + let result = ExecProcess(fun info -> + info.FileName <- "dotnet" + info.WorkingDirectory <- (Directory.GetParent project).FullName + info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0) + + ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result + + CreateDir outputTests + projects |> Seq.iter (runSingleProject) +) + +Target "RunTestsNetFx451" (fun _ -> + let projects = + let rawProjects = match (isWindows) with + | true -> !! "./test/*.Tests/*.Tests.csproj" + -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" + -- "./test/*.Tests/DotNetty.Buffers.ReaderWriter.Tests" + | _ -> !! "./test/*.Tests/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here + -- "./test/*.Tests/DotNetty.Suite.Tests.csproj" + -- "./test/*.Tests/DotNetty.Buffers.ReaderWriter.Tests" + rawProjects |> Seq.choose filterProjects + + let runSingleProject project = + let arguments = + match (hasTeamCity) with + | true -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none -teamcity" testNetFramework451Version outputTests) + | false -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none" testNetFramework451Version outputTests) + + let result = ExecProcess(fun info -> + info.FileName <- "dotnet" + info.WorkingDirectory <- (Directory.GetParent project).FullName + info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0) + + ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result + + CreateDir outputTests + projects |> Seq.iter (runSingleProject) +) + FinalTarget "KillCreatedProcesses" (fun _ -> log "Shutting down dotnet build-server" - let result = ExecProcess(fun info -> + let result = ExecProcess(fun info -> info.FileName <- "dotnet" info.WorkingDirectory <- __SOURCE_DIRECTORY__ info.Arguments <- "build-server shutdown") (System.TimeSpan.FromMinutes 2.0) @@ -335,7 +361,7 @@ FinalTarget "KillCreatedProcesses" (fun _ -> ) //-------------------------------------------------------------------------------- -// Help +// Help //-------------------------------------------------------------------------------- Target "Help" <| fun _ -> @@ -349,7 +375,7 @@ Target "Help" <| fun _ -> " * All Builds, run tests, creates and optionally publish nuget packages" "" " Other Targets" - " * Help Display this help" + " * Help Display this help" ""] //-------------------------------------------------------------------------------- @@ -369,14 +395,17 @@ Target "RunTestsNetCoreFull" DoNothing // tests dependencies "Build" ==> "RunTests" -"Build" ==> "RunTests451" -"Build" ==> "RunTestsNetCore" +"Build" ==> "RunTestsNetCore31" "Build" ==> "RunTestsNetCore21" +"Build" ==> "RunTestsNetFx471" +"Build" ==> "RunTestsNetFx451" // all "BuildDebug" ==> "All" "RunTests" ==> "All" -"RunTests451" ==> "All" -"RunTestsNetCore" ==> "All" +"RunTestsNetCore31" ==> "All" +"RunTestsNetCore21" ==> "All" +"RunTestsNetFx471" ==> "All" +"RunTestsNetFx451" ==> "All" RunTargetOrDefault "Help" \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index a6fe46ee0..7e358ef57 100644 --- a/build.ps1 +++ b/build.ps1 @@ -30,13 +30,10 @@ Param( ) $FakeVersion = "4.63.0" -$DotNetChannel = "LTS"; -$DotNetVersion = "3.1.402"; -$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1"; -$NugetVersion = "5.7.0"; +$NugetVersion = "5.8.0"; $NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe" -$IncrementalistVersion = "0.2.2"; +$IncrementalistVersion = "0.4.0"; # Make sure tools folder exists $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent @@ -46,49 +43,6 @@ if (!(Test-Path $ToolPath)) { New-Item -Path $ToolPath -Type directory | out-null } -########################################################################### -# INSTALL .NET CORE CLI -########################################################################### - -Function Remove-PathVariable([string]$VariableToRemove) -{ - $path = [Environment]::GetEnvironmentVariable("PATH", "User") - if ($path -ne $null) - { - $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } - [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User") - } - - $path = [Environment]::GetEnvironmentVariable("PATH", "Process") - if ($path -ne $null) - { - $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } - [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process") - } -} - -# Get .NET Core CLI path if installed. -$FoundDotNetCliVersion = $null; -if (Get-Command dotnet -ErrorAction SilentlyContinue) { - $FoundDotNetCliVersion = dotnet --version; - $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 -} - -if($FoundDotNetCliVersion -ne $DotNetVersion) { - $InstallPath = Join-Path $PSScriptRoot ".dotnet" - if (!(Test-Path $InstallPath)) { - mkdir -Force $InstallPath | Out-Null; - } - (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1"); - & $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath -Architecture x64; - - Remove-PathVariable "$InstallPath" - $env:PATH = "$InstallPath;$env:PATH" - $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 -} - ########################################################################### # INSTALL NUGET ########################################################################### diff --git a/build.sh b/build.sh index 8c1aecb26..dc95c4425 100644 --- a/build.sh +++ b/build.sh @@ -9,15 +9,16 @@ TOOLS_DIR=$SCRIPT_DIR/tools INCREMENTALIST_DIR=$TOOLS_DIR/incrementalist INCREMENTALIST_EXE=$INCREMENTALIST_DIR/Incrementalist.Cmd.exe NUGET_EXE=$TOOLS_DIR/nuget.exe -NUGET_URL=https://dist.nuget.org/win-x86-commandline/v5.7.0/nuget.exe +NUGET_URL=https://dist.nuget.org/win-x86-commandline/v5.8.0/nuget.exe FAKE_VERSION=4.63.0 FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe DOTNET_EXE=$SCRIPT_DIR/.dotnet/dotnet -DOTNET_VERSION=3.1.402 +DOTNETCORE_VERSION=3.1.409 +DOTNET_VERSION=5.0.203 DOTNET_INSTALLER_URL=https://dot.net/v1/dotnet-install.sh DOTNET_CHANNEL=LTS PROTOBUF_VERSION=3.4.0 -INCREMENTALIST_VERSION=0.2.2 +INCREMENTALIST_VERSION=0.4.0 # Define default arguments. TARGET="Default" @@ -44,22 +45,6 @@ if [ ! -d "$TOOLS_DIR" ]; then mkdir "$TOOLS_DIR" fi -########################################################################### -# INSTALL .NET CORE CLI -########################################################################### - -echo "Installing .NET CLI..." -if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then - mkdir "$SCRIPT_DIR/.dotnet" -fi -curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" $DOTNET_INSTALLER_URL -bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --channel $DOTNET_CHANNEL --install-dir .dotnet --no-path -export PATH="$SCRIPT_DIR/.dotnet":$PATH -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -chmod -R 0755 ".dotnet" -"$SCRIPT_DIR/.dotnet/dotnet" --info - ########################################################################### # INSTALL NUGET ########################################################################### @@ -96,7 +81,7 @@ fi # INSTALL Incrementalist ########################################################################### if [ ! -f "$INCREMENTALIST_EXE" ]; then - "$SCRIPT_DIR/.dotnet/dotnet" tool install Incrementalist.Cmd --version $INCREMENTALIST_VERSION --tool-path "$INCREMENTALIST_DIR" + dotnet tool install Incrementalist.Cmd --version $INCREMENTALIST_VERSION --tool-path "$INCREMENTALIST_DIR" if [ $? -ne 0 ]; then echo "Incrementalist already installed." fi diff --git a/build/Dependencies.3rdParty.props b/build/Dependencies.3rdParty.props index a364bf4ce..b4589c671 100644 --- a/build/Dependencies.3rdParty.props +++ b/build/Dependencies.3rdParty.props @@ -2,8 +2,8 @@ - 0.1.6 - 2.3.0 + 0.4.1 + 2.8.0 2.16.0 1.3.0 1.5.0 @@ -11,20 +11,20 @@ 3.3.2 3.3.2 4.0.0 - 1.2.6 + 1.2.9 2.3.0 10.1.1 - 5.0.0 + 7.0.1 3.0.2.4 - 7.2.1 + 7.2.2 3.0.1 3.0.2 3.0.0 - 5.3.0 + 7.10.0 1.0.2 2019.1.3 @@ -33,7 +33,7 @@ 4.4.1 - 6.1.0 + 6.2.0 6.0.0 7.1.0 6.0.0 @@ -47,12 +47,12 @@ 1.0.15.93 - 18.0.0 + 27.0.2 2.10.1 1.0.10 2.2.0 0.7.2.6 - 2.0.35 + 2.0.90 14.0.1016.290 2.11.0 2.11.0 @@ -77,10 +77,10 @@ 1.0.112.1 - 4.2.1 - 4.2.1 - 4.2.1 - 4.2.1 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 4.7.6 @@ -143,22 +143,22 @@ 5.1.0 1.10.0 - 1.34.0.266 + 1.40.0.394 - 2.10.1 - 2.10.1 + 2.11.0 + 2.11.0 - 1.6.0 - 3.12.3 - 3.12.3 - 0.9.16 - 1.7.3.7 + 2.3.0 + 3.16.0 + 3.16.0 + 0.10.1 + 2.2.85 1.0.2 - 12.0.3 - 2.4.6 - 3.0.0-alpha.155 + 13.0.1 + 2.4.6 + 3.0.101 3.0.1 - 9.1.0 + 11.1.1 diff --git a/build/Dependencies.AspNetCore.props b/build/Dependencies.AspNetCore.props index 50cbf16f3..cd6246015 100644 --- a/build/Dependencies.AspNetCore.props +++ b/build/Dependencies.AspNetCore.props @@ -1,71 +1,71 @@ - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 - 3.1.10 + 5.0.6 - 3.1.10 + 5.0.6 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 - 3.1.10 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 + 5.0.6 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 + 5.0.6 - 3.1.10 - 3.1.10 - 3.1.10 + 5.0.6 + 5.0.6 + 5.0.6 - 4.2.0 - 4.2.0 + 5.0.0 + 5.0.0 \ No newline at end of file diff --git a/build/Dependencies.AspNetCore3.props b/build/Dependencies.AspNetCore3.props new file mode 100644 index 000000000..f9e5d045a --- /dev/null +++ b/build/Dependencies.AspNetCore3.props @@ -0,0 +1,71 @@ + + + + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + + 3.1.15 + + 3.1.15 + + 3.1.15 + 3.1.15 + + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + + 3.1.15 + 3.1.15 + 3.1.15 + + 3.1.15 + 3.1.15 + + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + + 3.1.15 + 3.1.15 + + 3.1.15 + 3.1.15 + + 3.1.15 + 3.1.15 + + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + + 3.1.15 + 3.1.15 + 3.1.15 + + 5.0.0 + 5.0.0 + + \ No newline at end of file diff --git a/build/Dependencies.Extensions.props b/build/Dependencies.Extensions.props index 6013fa47c..4f8d9ccdb 100644 --- a/build/Dependencies.Extensions.props +++ b/build/Dependencies.Extensions.props @@ -1,54 +1,54 @@ - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 3.1.6 - 3.1.6 + 5.0.0 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 - 3.1.10 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 \ No newline at end of file diff --git a/build/Dependencies.Extensions3.props b/build/Dependencies.Extensions3.props new file mode 100644 index 000000000..8574dfc1e --- /dev/null +++ b/build/Dependencies.Extensions3.props @@ -0,0 +1,54 @@ + + + + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + + 3.1.6 + 3.1.6 + + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + 3.1.15 + + \ No newline at end of file diff --git a/build/Dependencies.Roslyn.props b/build/Dependencies.Roslyn.props index 80a6b7991..0c891d017 100644 --- a/build/Dependencies.Roslyn.props +++ b/build/Dependencies.Roslyn.props @@ -2,24 +2,24 @@ 1.3.2 - 3.8.0 - 3.8.0 - 3.8.0 - 3.8.0 - 3.8.0 - 3.8.0 - 3.8.0 - 3.8.0 - 3.8.0 - 3.8.0 - 3.8.0 + 3.9.0 + 3.9.0 + 3.9.0 + 3.9.0 + 3.9.0 + 3.9.0 + 3.9.0 + 3.9.0 + 3.9.0 + 3.9.0 + 3.9.0 - 3.8.0 - 3.8.0 + 3.9.0 + 3.9.0 - 2.9.8 - 2.9.8 - 2.9.8 + 3.3.2 + 3.3.2 + 3.3.2 2.6.3 1.1.118 diff --git a/build/Dependencies.System.props b/build/Dependencies.System.props index 1d9695230..8268af387 100644 --- a/build/Dependencies.System.props +++ b/build/Dependencies.System.props @@ -2,69 +2,69 @@ - 1.1.1 + 5.0.0 1.0.6-e190117-3 4.7.0 - 2.0.1 - 5.0.0 + 2.1.2 + 5.0.1 4.7.2 5.4.0.201 - 1.0.0 + 5.20.1-preview 3.0.5 9.3.3 - 6.8.0 - 6.8.0 - 6.8.0 - 6.8.0 - 6.8.0 - 6.8.0 - 6.8.0 - 6.8.0 - 6.8.0 - 6.8.0 - 6.8.0 + 6.11.0 + 6.11.0 + 6.11.0 + 6.11.0 + 6.11.0 + 6.11.0 + 6.11.0 + 6.11.0 + 6.11.0 + 6.11.0 + 6.11.0 - 4.7.0 - 4.7.0 - 3.1.0 + 5.0.0 + 5.0.0 + 5.0.2 2.0.1 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 4.5.0 + 5.0.0 4.8.2 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.1 - 4.7.0 - 4.7.0 - 4.5.1 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 + 5.0.1 + 5.0.1 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.2 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.1 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 - 1.7.1 - 1.8.1 + 5.0.0 + 5.0.0 4.5.1 - 4.7.1 - 4.7.3 + 5.0.1 + 5.0.1 4.5.4 4.3.4 4.5.0 @@ -76,39 +76,39 @@ 4.3.0 4.7.0 - 4.7.1 + 5.0.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 + 4.8.1 + 4.8.1 + 4.8.1 + 4.8.1 + 4.8.1 + 4.8.1 + 5.0.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 + 5.0.0 - 4.7.1 - 4.7.2 - 4.7.1 - 4.7.1 - 4.11.1 + 5.0.0 + 5.0.2 + 5.0.1 + 5.0.0 + 5.0.0 4.5.4 4.5.0 - 4.1.1 - 4.1.1 - 4.1.1 - 4.1.1 + 5.0.0 + 5.0.0 + 5..0 + 5.0.0 - 4.4.1 - 4.4.1 + 5.0.0 + 5.0.0 4.3.0 diff --git a/build/Dependencies.System2.props b/build/Dependencies.System2.props index 2947c1b9c..af410c9f5 100644 --- a/build/Dependencies.System2.props +++ b/build/Dependencies.System2.props @@ -90,6 +90,7 @@ 4.5.0 4.5.0 + 4.7.1 4.6.0 4.5.0 4.9.0 @@ -103,56 +104,5 @@ 2.1.0 2.1.0 2.1.0 - - - 3.2.0 - 3.1.1 - 3.2.0 - 3.2.0 - 3.2.0 - - - 4.1.5 - 3.1.1 - 4.1.5 - - - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.1 - 4.3.2 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.1 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.2 - 4.3.0 diff --git a/build/Dependencies.System3.props b/build/Dependencies.System3.props new file mode 100644 index 000000000..bd64cc3a1 --- /dev/null +++ b/build/Dependencies.System3.props @@ -0,0 +1,103 @@ + + + + + 1.1.1 + 1.0.6-e190117-3 + 4.7.0 + 2.0.1 + 5.0.0 + 4.7.2 + 5.4.0.201 + 1.0.0 + + + 3.0.5 + 9.3.3 + + + 6.8.0 + 6.8.0 + 6.8.0 + 6.8.0 + 6.8.0 + 6.8.0 + 6.8.0 + 6.8.0 + 6.8.0 + 6.8.0 + 6.8.0 + + + 4.7.0 + 4.7.0 + 3.1.0 + 2.0.1 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.8.2 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.1 + 4.7.0 + 4.7.0 + 4.5.1 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + + + 1.7.1 + 1.8.1 + + 4.5.1 + 4.7.1 + 4.7.3 + 4.5.4 + 4.3.4 + 4.5.0 + + 4.7.1 + 4.7.0 + 4.7.0 + 4.7.0 + 4.3.0 + 4.7.0 + + 4.7.1 + + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + 4.7.0 + + 4.7.1 + 4.7.2 + 4.7.1 + 4.7.1 + 4.11.1 + 4.5.4 + 4.5.0 + + diff --git a/build/Dependencies.Testing.props b/build/Dependencies.Testing.props index 3df6561eb..4878734b8 100644 --- a/build/Dependencies.Testing.props +++ b/build/Dependencies.Testing.props @@ -2,23 +2,23 @@ - 16.8.3 - 16.8.3 - 16.8.3 + 16.9.4 + 16.9.4 + 16.9.4 0.12.1 0.12.1 2.0.1 - 3.0.0 - 28.3.1 + 4.0.0 + 33.0.2 4.19.4 5.10.3 5.10.3 - 4.15.2 - 4.2.1 - 4.2.10 - 4.0.0-beta0002 + 4.16.1 + 4.2.2 + 4.8.8 + 4.0.3 2.4.1 0.10.0 @@ -36,13 +36,13 @@ 2.6.4 2.2.0 - 3.12.0 + 3.13.2 3.12.0 3.17.0 - 0.11.2 + 0.11.3 - 3.11.0-dev-05430 - 3.11.0-dev-00847 + 3.13.2 + 4.0.0-beta.2 3.0.6 3.0.6 diff --git a/build/Dependencies.props b/build/Dependencies.props index 418901492..954da14fb 100644 --- a/build/Dependencies.props +++ b/build/Dependencies.props @@ -1,17 +1,17 @@ - 16.6.0 - 16.6.0 - 16.6.0 - 16.6.0 + 16.9.0 + 16.9.0 + 16.9.0 + 16.9.0 1.1.10 1.0.168 1.0.21 - 2.14.0 - 2.14.0 + 2.17.0 + 2.17.0 1.0.0 diff --git a/build/azure-pipeline.template.yaml b/build/azure-pipeline.template.yaml index 687caff55..0a8e66e74 100644 --- a/build/azure-pipeline.template.yaml +++ b/build/azure-pipeline.template.yaml @@ -17,10 +17,10 @@ jobs: vmImage: ${{ parameters.vmImage }} steps: - task: UseDotNet@2 - displayName: 'Use .NET Core SDK 3.1.402' + displayName: 'Use .NET Core SDK 5.0.203' inputs: packageType: sdk - version: 3.1.402 + version: 5.0.203 - task: Bash@3 displayName: Linux / OSX Build inputs: diff --git a/build/pr-netfx-validation.yaml b/build/pr-netfx-validation.yaml index 3483043dc..052899b6a 100644 --- a/build/pr-netfx-validation.yaml +++ b/build/pr-netfx-validation.yaml @@ -26,10 +26,10 @@ jobs: submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules persistCredentials: true - task: UseDotNet@2 - displayName: 'Use .NET Core SDK 3.1.402' + displayName: 'Use .NET Core SDK 5.0.203' inputs: packageType: sdk - version: 3.1.402 + version: 5.0.203 - task: BatchScript@1 displayName: Windows Build inputs: @@ -55,7 +55,7 @@ jobs: displayName: '.NET Framework Unit Tests (Windows)' vmImage: 'windows-2019' scriptFileName: build.cmd - scriptArgs: runTests incremental + scriptArgs: RunTestsNetFx471 incremental outputDirectory: 'TestResults' artifactName: 'netfx_tests_windows-$(Build.BuildId)' @@ -65,6 +65,6 @@ jobs: displayName: '.NET Framework 451 Unit Tests (Windows)' vmImage: 'vs2017-win2016' scriptFileName: build.cmd - scriptArgs: runTests451 incremental + scriptArgs: RunTestsNetFx451 incremental outputDirectory: 'TestResults' artifactName: 'netfx_451_tests_windows-$(Build.BuildId)' diff --git a/build/pr-validation.yaml b/build/pr-validation.yaml index 61dcfde5b..86a1e24c2 100644 --- a/build/pr-validation.yaml +++ b/build/pr-validation.yaml @@ -26,10 +26,10 @@ jobs: submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules persistCredentials: true - task: UseDotNet@2 - displayName: 'Use .NET Core SDK 3.1.402' + displayName: 'Use .NET Core SDK 5.0.203' inputs: packageType: sdk - version: 3.1.402 + version: 5.0.203 - task: BatchScript@1 displayName: Windows Build inputs: @@ -55,7 +55,7 @@ jobs: displayName: '.NET Core Unit Tests (Windows)' vmImage: 'windows-2019' scriptFileName: build.cmd - scriptArgs: runTestsNetCore incremental + scriptArgs: RunTests incremental outputDirectory: 'TestResults' artifactName: 'net_core_tests_windows-$(Build.BuildId)' @@ -65,7 +65,7 @@ jobs: displayName: '.NET Core Unit Tests (Ubuntu-16)' vmImage: 'ubuntu-16.04' scriptFileName: './build.sh' - scriptArgs: runTestsNetCore incremental + scriptArgs: RunTests incremental outputDirectory: 'TestResults' artifactName: 'net_core_tests_ubuntu_16-$(Build.BuildId)' @@ -75,7 +75,7 @@ jobs: displayName: '.NET Core Unit Tests (Ubuntu-18)' vmImage: 'ubuntu-18.04' scriptFileName: './build.sh' - scriptArgs: runTestsNetCore incremental + scriptArgs: RunTests incremental outputDirectory: 'TestResults' artifactName: 'net_core_tests_ubuntu_18-$(Build.BuildId)' @@ -85,7 +85,7 @@ jobs: displayName: '.NET Core Unit Tests (MacOS-10.14)' vmImage: 'macOS-10.14' scriptFileName: './build.sh' - scriptArgs: runTestsNetCore incremental + scriptArgs: RunTests incremental outputDirectory: 'TestResults' artifactName: 'net_core_tests_mac_1014-$(Build.BuildId)' @@ -95,6 +95,6 @@ jobs: displayName: '.NET Core Unit Tests (MacOS-10.15)' vmImage: 'macOS-10.15' scriptFileName: './build.sh' - scriptArgs: runTestsNetCore incremental + scriptArgs: RunTests incremental outputDirectory: 'TestResults' artifactName: 'net_core_tests_mac_1015-$(Build.BuildId)' diff --git a/buildNetstandard.fsx b/buildNetstandard.fsx index e91d68d6d..6962f8d35 100644 --- a/buildNetstandard.fsx +++ b/buildNetstandard.fsx @@ -48,6 +48,7 @@ let incrementalistReport = output @@ "incrementalist.txt" let testNetFrameworkVersion = "net471" let testNetCoreVersion = "netcoreapp3.1" let testNetCore21Version = "netcoreapp2.1" +let testNetVersion = "net5.0" Target "Clean" (fun _ -> ActivateFinalTarget "KillCreatedProcesses" @@ -63,10 +64,10 @@ Target "Clean" (fun _ -> //-------------------------------------------------------------------------------- -// Incrementalist targets +// Incrementalist targets //-------------------------------------------------------------------------------- // Pulls the set of all affected projects detected by Incrementalist from the cached file -let getAffectedProjectsTopology = +let getAffectedProjectsTopology = lazy( log (sprintf "Checking inside %s for changes" incrementalistReport) @@ -81,7 +82,7 @@ let getAffectedProjectsTopology = Some(d) ) -let getAffectedProjects = +let getAffectedProjects = lazy( let finalProjects = getAffectedProjectsTopology.Value match finalProjects with @@ -101,8 +102,8 @@ Target "ComputeIncrementalChanges" (fun _ -> match globalTool with | Some t -> t | None -> if isWindows then findToolInSubPath "incrementalist.exe" incrementalistDir - elif isMacOS then incrementalistDir @@ "incrementalist" - else incrementalistDir @@ "incrementalist" + elif isMacOS then incrementalistDir @@ "incrementalist" + else incrementalistDir @@ "incrementalist" let args = StringBuilder() @@ -114,12 +115,12 @@ Target "ComputeIncrementalChanges" (fun _ -> |> append incrementalistReport |> toText - let result = ExecProcess(fun info -> + let result = ExecProcess(fun info -> info.FileName <- incrementalistPath info.WorkingDirectory <- __SOURCE_DIRECTORY__ info.Arguments <- args) (System.TimeSpan.FromMinutes 5.0) (* Reasonably long-running task. *) - if result <> 0 then failwithf "Incrementalist failed. %s" args + if result <> 0 then failwithf "Incrementalist failed. %s" args else log "Skipping Incrementalist - not enabled for this build" ) @@ -144,9 +145,9 @@ let filterProjects selectedProject = Some selectedProject //-------------------------------------------------------------------------------- -// Build targets +// Build targets //-------------------------------------------------------------------------------- -let skipBuild = +let skipBuild = lazy( match getAffectedProjects.Value with | None when runIncrementally -> true @@ -161,12 +162,12 @@ let headProjects = | Some p -> p.Keys |> Seq.toArray ) -Target "Build" (fun _ -> +Target "Build" (fun _ -> if not skipBuild.Value then - let additionalArgs = if versionSuffix.Length > 0 then [sprintf "/p:VersionSuffix=%s" versionSuffix] else [] + let additionalArgs = if versionSuffix.Length > 0 then [sprintf "/p:VersionSuffix=%s" versionSuffix] else [] let buildProject proj = DotNetCli.Build - (fun p -> + (fun p -> { p with Project = proj Configuration = configuration @@ -178,16 +179,18 @@ Target "Build" (fun _ -> ) //-------------------------------------------------------------------------------- -// Tests targets +// Tests targets //-------------------------------------------------------------------------------- type Runtime = | NetCore + | Net | NetFramework let getTestAssembly runtime project = let assemblyPath = match runtime with | NetCore -> !! ("test" @@ "**" @@ "bin" @@ "Debug" @@ testNetCoreVersion @@ fileNameWithoutExt project + ".dll") | NetFramework -> !! ("test" @@ "**" @@ "bin" @@ "Debug" @@ "win-x64" @@ testNetFrameworkVersion @@ fileNameWithoutExt project + ".dll") + | Net -> !! ("src" @@ "**" @@ "bin" @@ "Release" @@ testNetVersion @@ fileNameWithoutExt project + ".dll") if Seq.isEmpty assemblyPath then None @@ -246,9 +249,7 @@ Target "RunTests21" (fun _ -> let projects = let rawProjects = match (isWindows) with | true -> !! "./test/*.Tests.Netstandard/*.Tests.csproj" - -- "./test/*.Tests.Netstandard/DotNetty.Suite.Tests.csproj" | _ -> !! "./test/*.Tests.Netstandard/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here - -- "./test/*.Tests.Netstandard/DotNetty.Suite.Tests.csproj" rawProjects |> Seq.choose filterProjects let runSingleProject project = @@ -270,7 +271,7 @@ Target "RunTests21" (fun _ -> FinalTarget "KillCreatedProcesses" (fun _ -> log "Shutting down dotnet build-server" - let result = ExecProcess(fun info -> + let result = ExecProcess(fun info -> info.FileName <- "dotnet" info.WorkingDirectory <- __SOURCE_DIRECTORY__ info.Arguments <- "build-server shutdown") (System.TimeSpan.FromMinutes 2.0) @@ -278,7 +279,7 @@ FinalTarget "KillCreatedProcesses" (fun _ -> ) //-------------------------------------------------------------------------------- -// Help +// Help //-------------------------------------------------------------------------------- Target "Help" <| fun _ -> @@ -292,7 +293,7 @@ Target "Help" <| fun _ -> " * All Builds, run tests, creates and optionally publish nuget packages" "" " Other Targets" - " * Help Display this help" + " * Help Display this help" ""] //-------------------------------------------------------------------------------- diff --git a/buildNetstandard.ps1 b/buildNetstandard.ps1 index adc22adcf..bcd54b991 100644 --- a/buildNetstandard.ps1 +++ b/buildNetstandard.ps1 @@ -30,13 +30,10 @@ Param( ) $FakeVersion = "4.63.0" -$DotNetChannel = "LTS"; -$DotNetVersion = "3.1.402"; -$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1"; -$NugetVersion = "5.7.0"; +$NugetVersion = "5.8.0"; $NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe" -$IncrementalistVersion = "0.2.2"; +$IncrementalistVersion = "0.4.0"; # Make sure tools folder exists $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent @@ -46,49 +43,6 @@ if (!(Test-Path $ToolPath)) { New-Item -Path $ToolPath -Type directory | out-null } -########################################################################### -# INSTALL .NET CORE CLI -########################################################################### - -Function Remove-PathVariable([string]$VariableToRemove) -{ - $path = [Environment]::GetEnvironmentVariable("PATH", "User") - if ($path -ne $null) - { - $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } - [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User") - } - - $path = [Environment]::GetEnvironmentVariable("PATH", "Process") - if ($path -ne $null) - { - $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } - [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process") - } -} - -# Get .NET Core CLI path if installed. -$FoundDotNetCliVersion = $null; -if (Get-Command dotnet -ErrorAction SilentlyContinue) { - $FoundDotNetCliVersion = dotnet --version; - $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 -} - -if($FoundDotNetCliVersion -ne $DotNetVersion) { - $InstallPath = Join-Path $PSScriptRoot ".dotnet" - if (!(Test-Path $InstallPath)) { - mkdir -Force $InstallPath | Out-Null; - } - (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1"); - & $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath -Architecture x64; - - Remove-PathVariable "$InstallPath" - $env:PATH = "$InstallPath;$env:PATH" - $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 -} - ########################################################################### # INSTALL NUGET ########################################################################### diff --git a/buildNetstandard.sh b/buildNetstandard.sh index e67641d67..498cc698b 100644 --- a/buildNetstandard.sh +++ b/buildNetstandard.sh @@ -9,15 +9,16 @@ TOOLS_DIR=$SCRIPT_DIR/tools INCREMENTALIST_DIR=$TOOLS_DIR/incrementalist INCREMENTALIST_EXE=$INCREMENTALIST_DIR/Incrementalist.Cmd.exe NUGET_EXE=$TOOLS_DIR/nuget.exe -NUGET_URL=https://dist.nuget.org/win-x86-commandline/v5.7.0/nuget.exe +NUGET_URL=https://dist.nuget.org/win-x86-commandline/v5.8.0/nuget.exe FAKE_VERSION=4.63.0 FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe DOTNET_EXE=$SCRIPT_DIR/.dotnet/dotnet -DOTNET_VERSION=3.1.402 +DOTNETCORE_VERSION=3.1.409 +DOTNET_VERSION=5.0.203 DOTNET_INSTALLER_URL=https://dot.net/v1/dotnet-install.sh DOTNET_CHANNEL=LTS PROTOBUF_VERSION=3.4.0 -INCREMENTALIST_VERSION=0.2.2 +INCREMENTALIST_VERSION=0.4.0 # Define default arguments. TARGET="Default" @@ -44,22 +45,6 @@ if [ ! -d "$TOOLS_DIR" ]; then mkdir "$TOOLS_DIR" fi -########################################################################### -# INSTALL .NET CORE CLI -########################################################################### - -echo "Installing .NET CLI..." -if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then - mkdir "$SCRIPT_DIR/.dotnet" -fi -curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" $DOTNET_INSTALLER_URL -bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --channel $DOTNET_CHANNEL --install-dir .dotnet --no-path -export PATH="$SCRIPT_DIR/.dotnet":$PATH -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -chmod -R 0755 ".dotnet" -"$SCRIPT_DIR/.dotnet/dotnet" --info - ########################################################################### # INSTALL NUGET ########################################################################### @@ -96,7 +81,7 @@ fi # INSTALL Incrementalist ########################################################################### if [ ! -f "$INCREMENTALIST_EXE" ]; then - "$SCRIPT_DIR/.dotnet/dotnet" tool install Incrementalist.Cmd --version $INCREMENTALIST_VERSION --tool-path "$INCREMENTALIST_DIR" + dotnet tool install Incrementalist.Cmd --version $INCREMENTALIST_VERSION --tool-path "$INCREMENTALIST_DIR" if [ $? -ne 0 ]; then echo "Incrementalist already installed." fi diff --git a/perf/DotNetty.Microbench/DotNetty.Microbench.csproj b/perf/DotNetty.Microbench/DotNetty.Microbench.csproj index 42837481c..8fde5a6fb 100644 --- a/perf/DotNetty.Microbench/DotNetty.Microbench.csproj +++ b/perf/DotNetty.Microbench/DotNetty.Microbench.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net48 + net5.0;net48 DotNetty.Microbench DotNetty.Microbench true diff --git a/perf/DotNetty.Microbench/Program.cs b/perf/DotNetty.Microbench/Program.cs index a7b6f121e..d8dba803c 100644 --- a/perf/DotNetty.Microbench/Program.cs +++ b/perf/DotNetty.Microbench/Program.cs @@ -14,7 +14,9 @@ static void Main(string[] args) { // if no args, we're probably using Ctrl+F5 in the IDE; enlargen thyself! try { +#pragma warning disable CA1416 // 验证平台兼容性 Console.WindowWidth = Console.LargestWindowWidth - 20; +#pragma warning restore CA1416 // 验证平台兼容性 } catch { } } diff --git a/src/DotNetty.Buffers/DotNetty.Buffers.Netstandard.csproj b/src/DotNetty.Buffers/DotNetty.Buffers.Netstandard.csproj index 70c0aee51..e3ef15126 100644 --- a/src/DotNetty.Buffers/DotNetty.Buffers.Netstandard.csproj +++ b/src/DotNetty.Buffers/DotNetty.Buffers.Netstandard.csproj @@ -2,7 +2,7 @@ - netstandard2.0;netstandard2.1 + netstandard2.1;netstandard2.0 DotNetty.Buffers SpanNetty.Buffers true diff --git a/src/DotNetty.Buffers/DotNetty.Buffers.csproj b/src/DotNetty.Buffers/DotNetty.Buffers.csproj index 69d2f0ec6..043649d35 100644 --- a/src/DotNetty.Buffers/DotNetty.Buffers.csproj +++ b/src/DotNetty.Buffers/DotNetty.Buffers.csproj @@ -2,7 +2,7 @@ - $(StandardTfms);netstandard2.1;netcoreapp2.1 + netcoreapp2.1;netstandard2.1;$(StandardTfms) DotNetty.Buffers SpanNetty.Buffers true diff --git a/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.Netstandard.csproj b/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.Netstandard.csproj index a0ab5ae1d..2bf91ff80 100644 --- a/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.Netstandard.csproj +++ b/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.Netstandard.csproj @@ -2,7 +2,7 @@ - netstandard2.0;netstandard2.1 + netstandard2.1;netstandard2.0 DotNetty.Codecs.Http SpanNetty.Codecs.Http true diff --git a/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.csproj b/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.csproj index a921a830f..a1e85d4e5 100644 --- a/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.csproj +++ b/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.csproj @@ -2,7 +2,7 @@ - $(StandardTfms);netstandard2.1 + netstandard2.1;$(StandardTfms) DotNetty.Codecs.Http SpanNetty.Codecs.Http true diff --git a/src/DotNetty.Codecs.Http2/DefaultHttp2Connection.cs b/src/DotNetty.Codecs.Http2/DefaultHttp2Connection.cs index 4a404f1fc..563a16213 100644 --- a/src/DotNetty.Codecs.Http2/DefaultHttp2Connection.cs +++ b/src/DotNetty.Codecs.Http2/DefaultHttp2Connection.cs @@ -97,7 +97,7 @@ public DefaultHttp2Connection(bool server, int maxReservedStreams) // Add the connection stream to the map. _streamMap.Add(_connectionStream.Id, _connectionStream); - _closeFuture = new TaskCompletionSource(); + _closeFuture = new DefaultPromise(); } /// diff --git a/src/DotNetty.Codecs.Http2/DotNetty.Codecs.Http2.Netstandard.csproj b/src/DotNetty.Codecs.Http2/DotNetty.Codecs.Http2.Netstandard.csproj index 6220dbf84..8b42433b1 100644 --- a/src/DotNetty.Codecs.Http2/DotNetty.Codecs.Http2.Netstandard.csproj +++ b/src/DotNetty.Codecs.Http2/DotNetty.Codecs.Http2.Netstandard.csproj @@ -2,7 +2,7 @@ - netstandard2.0;netstandard2.1 + netstandard2.1;netstandard2.0 DotNetty.Codecs.Http2 SpanNetty.Codecs.Http2 true diff --git a/src/DotNetty.Codecs.Http2/DotNetty.Codecs.Http2.csproj b/src/DotNetty.Codecs.Http2/DotNetty.Codecs.Http2.csproj index af171f396..798c2e3b6 100644 --- a/src/DotNetty.Codecs.Http2/DotNetty.Codecs.Http2.csproj +++ b/src/DotNetty.Codecs.Http2/DotNetty.Codecs.Http2.csproj @@ -2,7 +2,7 @@ - $(StandardTfms);netstandard2.1 + netstandard2.1;$(StandardTfms) DotNetty.Codecs.Http2 SpanNetty.Codecs.Http2 true diff --git a/src/DotNetty.Codecs/DotNetty.Codecs.Netstandard.csproj b/src/DotNetty.Codecs/DotNetty.Codecs.Netstandard.csproj index bad9660c8..927e5df96 100644 --- a/src/DotNetty.Codecs/DotNetty.Codecs.Netstandard.csproj +++ b/src/DotNetty.Codecs/DotNetty.Codecs.Netstandard.csproj @@ -2,7 +2,7 @@ - netstandard2.0;netstandard2.1 + netstandard2.1;netstandard2.0 DotNetty.Codecs SpanNetty.Codecs true diff --git a/src/DotNetty.Codecs/DotNetty.Codecs.csproj b/src/DotNetty.Codecs/DotNetty.Codecs.csproj index 7891c536c..ee39b1ad4 100644 --- a/src/DotNetty.Codecs/DotNetty.Codecs.csproj +++ b/src/DotNetty.Codecs/DotNetty.Codecs.csproj @@ -2,7 +2,7 @@ - $(StandardTfms);netstandard2.1 + netstandard2.1;$(StandardTfms) DotNetty.Codecs SpanNetty.Codecs true diff --git a/src/DotNetty.Common/Concurrency/AbstractEventExecutor.cs b/src/DotNetty.Common/Concurrency/AbstractEventExecutor.cs index be59460b2..463d52ba6 100644 --- a/src/DotNetty.Common/Concurrency/AbstractEventExecutor.cs +++ b/src/DotNetty.Common/Concurrency/AbstractEventExecutor.cs @@ -262,9 +262,9 @@ public virtual Task ScheduleWithFixedDelayAsync(Action action, o /// public abstract Task ShutdownGracefullyAsync(TimeSpan quietPeriod, TimeSpan timeout); - public IPromise NewPromise() => new TaskCompletionSource(); + public IPromise NewPromise() => new DefaultPromise(); - public IPromise NewPromise(object state) => new TaskCompletionSource(state); + public IPromise NewPromise(object state) => new DefaultPromise(state); /// protected void SetCurrentExecutor(IEventExecutor executor) => ExecutionEnvironment.SetCurrentExecutor(executor); diff --git a/src/DotNetty.Common/Concurrency/DefaultProgressivePromise.cs b/src/DotNetty.Common/Concurrency/DefaultProgressivePromise.cs index 20e14505e..d38886c2d 100644 --- a/src/DotNetty.Common/Concurrency/DefaultProgressivePromise.cs +++ b/src/DotNetty.Common/Concurrency/DefaultProgressivePromise.cs @@ -24,7 +24,7 @@ namespace DotNetty.Common.Concurrency { using System; - public class DefaultProgressivePromise : TaskCompletionSource, IProgressivePromise + public class DefaultProgressivePromise : DefaultPromise, IProgressivePromise { public DefaultProgressivePromise() : base() { } diff --git a/src/DotNetty.Common/Concurrency/TaskCompletionSource.cs b/src/DotNetty.Common/Concurrency/DefaultPromise.cs similarity index 89% rename from src/DotNetty.Common/Concurrency/TaskCompletionSource.cs rename to src/DotNetty.Common/Concurrency/DefaultPromise.cs index 39246455b..666776bcd 100644 --- a/src/DotNetty.Common/Concurrency/TaskCompletionSource.cs +++ b/src/DotNetty.Common/Concurrency/DefaultPromise.cs @@ -35,19 +35,32 @@ namespace DotNetty.Common.Concurrency { - public class TaskCompletionSource : IPromise + public class DefaultPromise : IPromise { +#if NET + private readonly TaskCompletionSource _tcs; +#else private readonly TaskCompletionSource _tcs; +#endif + private int v_uncancellable = SharedConstants.False; - public TaskCompletionSource() + public DefaultPromise() { +#if NET + _tcs = new TaskCompletionSource(); +#else _tcs = new TaskCompletionSource(); +#endif } - public TaskCompletionSource(object state) + public DefaultPromise(object state) { +#if NET + _tcs = new TaskCompletionSource(state); +#else _tcs = new TaskCompletionSource(state); +#endif } public Task Task @@ -68,12 +81,20 @@ public Task Task public virtual bool TryComplete() { +#if NET + return _tcs.TrySetResult(); +#else return _tcs.TrySetResult(0); +#endif } public virtual void Complete() { +#if NET + _tcs.SetResult(); +#else _tcs.SetResult(0); +#endif } public virtual void SetCanceled() { diff --git a/src/DotNetty.Common/Concurrency/SimplePromiseAggregator.cs b/src/DotNetty.Common/Concurrency/SimplePromiseAggregator.cs index 886e3c329..c4cea3c66 100644 --- a/src/DotNetty.Common/Concurrency/SimplePromiseAggregator.cs +++ b/src/DotNetty.Common/Concurrency/SimplePromiseAggregator.cs @@ -31,7 +31,7 @@ namespace DotNetty.Common.Concurrency /// Provides the ability to associate the outcome of multiple /// objects into a single object. /// - public sealed class SimplePromiseAggregator : TaskCompletionSource + public sealed class SimplePromiseAggregator : DefaultPromise { readonly IPromise promise; int expectedCount; diff --git a/src/DotNetty.Common/DotNetty.Common.Netstandard.csproj b/src/DotNetty.Common/DotNetty.Common.Netstandard.csproj index ba314c877..d44faa186 100644 --- a/src/DotNetty.Common/DotNetty.Common.Netstandard.csproj +++ b/src/DotNetty.Common/DotNetty.Common.Netstandard.csproj @@ -2,7 +2,7 @@ - netstandard2.0;netstandard2.1 + netstandard2.1;netstandard2.0 DotNetty.Common SpanNetty.Common true diff --git a/src/DotNetty.Common/DotNetty.Common.csproj b/src/DotNetty.Common/DotNetty.Common.csproj index a8ae13483..2db789b46 100644 --- a/src/DotNetty.Common/DotNetty.Common.csproj +++ b/src/DotNetty.Common/DotNetty.Common.csproj @@ -2,7 +2,7 @@ - $(StandardTfms);netstandard2.1;netcoreapp2.1;netcoreapp3.1 + net5.0;netcoreapp3.1;netcoreapp2.1;netstandard2.1;$(StandardTfms) DotNetty.Common SpanNetty.Common true @@ -15,9 +15,12 @@ socket;tcp;protocol;netty;dotnetty;network - + + + + @@ -35,7 +38,7 @@ - + diff --git a/src/DotNetty.Common/Utilities/HashedWheelTimer.cs b/src/DotNetty.Common/Utilities/HashedWheelTimer.cs index 3a4e33439..72f023d9a 100644 --- a/src/DotNetty.Common/Utilities/HashedWheelTimer.cs +++ b/src/DotNetty.Common/Utilities/HashedWheelTimer.cs @@ -282,12 +282,12 @@ sealed class Worker : IRunnable readonly HashedWheelTimer _owner; long _tick; - readonly TaskCompletionSource _closedPromise; + readonly DefaultPromise _closedPromise; public Worker(HashedWheelTimer owner) { _owner = owner; - _closedPromise = new TaskCompletionSource(); + _closedPromise = new DefaultPromise(); } public Task ClosedFuture => _closedPromise.Task; diff --git a/src/DotNetty.Common/Utilities/TaskEx.cs b/src/DotNetty.Common/Utilities/TaskEx.cs index f19ce67e1..710d8911d 100644 --- a/src/DotNetty.Common/Utilities/TaskEx.cs +++ b/src/DotNetty.Common/Utilities/TaskEx.cs @@ -87,7 +87,7 @@ public static Task FromCanceled(CancellationToken cancellation public static Task FromException(Exception exception) { #if NET451 - var tcs = new TaskCompletionSource(); + var tcs = new TaskCompletionSource(); tcs.TrySetException(exception); return tcs.Task; #else diff --git a/src/DotNetty.Handlers/DotNetty.Handlers.Netstandard.csproj b/src/DotNetty.Handlers/DotNetty.Handlers.Netstandard.csproj index 1af56bdf9..c6660a0af 100644 --- a/src/DotNetty.Handlers/DotNetty.Handlers.Netstandard.csproj +++ b/src/DotNetty.Handlers/DotNetty.Handlers.Netstandard.csproj @@ -2,7 +2,7 @@ - netstandard2.0;netstandard2.1 + netstandard2.1;netstandard2.0 DotNetty.Handlers SpanNetty.Handlers false diff --git a/src/DotNetty.Handlers/DotNetty.Handlers.csproj b/src/DotNetty.Handlers/DotNetty.Handlers.csproj index 1bfb6e7d3..2809757ad 100644 --- a/src/DotNetty.Handlers/DotNetty.Handlers.csproj +++ b/src/DotNetty.Handlers/DotNetty.Handlers.csproj @@ -2,7 +2,7 @@ - $(StandardTfms);netstandard2.1;netcoreapp2.1;netcoreapp3.1 + netcoreapp3.1;netcoreapp2.1;netstandard2.1;$(StandardTfms) DotNetty.Handlers SpanNetty.Handlers false diff --git a/src/DotNetty.Handlers/Tls/TlsHandler.cs b/src/DotNetty.Handlers/Tls/TlsHandler.cs index db037c3a0..e8a9a330c 100644 --- a/src/DotNetty.Handlers/Tls/TlsHandler.cs +++ b/src/DotNetty.Handlers/Tls/TlsHandler.cs @@ -58,7 +58,7 @@ public sealed partial class TlsHandler : ByteToMessageDecoder private readonly SslStream _sslStream; private readonly MediationStream _mediationStream; - private readonly TaskCompletionSource _closeFuture; + private readonly DefaultPromise _closeFuture; private BatchingPendingWriteQueue _pendingUnencryptedWrites; @@ -131,7 +131,7 @@ public TlsHandler(Func sslStreamFactory, TlsSettings settings _userCertSelector = _clientSettings.UserCertSelector; } #endif - _closeFuture = new TaskCompletionSource(); + _closeFuture = new DefaultPromise(); _mediationStream = new MediationStream(this); _sslStream = sslStreamFactory(_mediationStream); } @@ -417,7 +417,7 @@ private void HandleFailure(Exception cause, bool closeInbound = true, bool notif //private static readonly Action ScheduledForceCloseConnection0Action = ScheduledForceCloseConnection0; //private static void ScheduledForceCloseConnection0(object s) //{ - // var wrapped = (Tuple)s; + // var wrapped = (Tuple)s; // // May be done in the meantime as cancel(...) is only best effort. // if (!wrapped.Item2.IsCompleted) // { diff --git a/src/DotNetty.NetUV/DotNetty.NetUV.csproj b/src/DotNetty.NetUV/DotNetty.NetUV.csproj index 879fc0cd2..cab181ab2 100644 --- a/src/DotNetty.NetUV/DotNetty.NetUV.csproj +++ b/src/DotNetty.NetUV/DotNetty.NetUV.csproj @@ -2,7 +2,7 @@ - $(StandardTfms);netcoreapp3.1 + $(StandardTfms) DotNetty.NetUV SpanNetty.NetUV true diff --git a/src/DotNetty.Transport.Libuv/DotNetty.Transport.Libuv.csproj b/src/DotNetty.Transport.Libuv/DotNetty.Transport.Libuv.csproj index b89273709..f7ba82f61 100644 --- a/src/DotNetty.Transport.Libuv/DotNetty.Transport.Libuv.csproj +++ b/src/DotNetty.Transport.Libuv/DotNetty.Transport.Libuv.csproj @@ -2,7 +2,7 @@ - $(StandardTfms);netcoreapp3.1 + $(StandardTfms) DotNetty.Transport.Libuv SpanNetty.Transport.Libuv true diff --git a/src/DotNetty.Transport/Channels/AbstractChannel.cs b/src/DotNetty.Transport/Channels/AbstractChannel.cs index 427997303..60f579533 100644 --- a/src/DotNetty.Transport/Channels/AbstractChannel.cs +++ b/src/DotNetty.Transport/Channels/AbstractChannel.cs @@ -265,9 +265,9 @@ public IChannel Read() public Task WriteAndFlushAsync(object message, IPromise promise) => _pipeline.WriteAndFlushAsync(message, promise); - public IPromise NewPromise() => new TaskCompletionSource(); + public IPromise NewPromise() => new DefaultPromise(); - public IPromise NewPromise(object state) => new TaskCompletionSource(state); + public IPromise NewPromise(object state) => new DefaultPromise(state); public IPromise VoidPromise() => _pipeline.VoidPromise(); diff --git a/src/DotNetty.Transport/Channels/AbstractChannelHandlerContext.cs b/src/DotNetty.Transport/Channels/AbstractChannelHandlerContext.cs index 2c4a739ca..1ff468f58 100644 --- a/src/DotNetty.Transport/Channels/AbstractChannelHandlerContext.cs +++ b/src/DotNetty.Transport/Channels/AbstractChannelHandlerContext.cs @@ -952,9 +952,9 @@ private static void NotifyOutboundHandlerException(Exception cause, IPromise pro PromiseNotificationUtil.TryFailure(promise, cause, promise.IsVoid ? null : DefaultChannelPipeline.Logger); } - public IPromise NewPromise() => new TaskCompletionSource(); + public IPromise NewPromise() => new DefaultPromise(); - public IPromise NewPromise(object state) => new TaskCompletionSource(state); + public IPromise NewPromise(object state) => new DefaultPromise(state); public IPromise VoidPromise() => Channel.VoidPromise(); diff --git a/src/DotNetty.Transport/Channels/DefaultChannelPipeline.cs b/src/DotNetty.Transport/Channels/DefaultChannelPipeline.cs index c239a20a4..725336706 100644 --- a/src/DotNetty.Transport/Channels/DefaultChannelPipeline.cs +++ b/src/DotNetty.Transport/Channels/DefaultChannelPipeline.cs @@ -948,9 +948,9 @@ public IChannelPipeline Flush() public Task WriteAndFlushAsync(object msg, IPromise promise) => _tail.WriteAndFlushAsync(msg, promise); - public IPromise NewPromise() => new TaskCompletionSource(); + public IPromise NewPromise() => new DefaultPromise(); - public IPromise NewPromise(object state) => new TaskCompletionSource(state); + public IPromise NewPromise(object state) => new DefaultPromise(state); public IPromise VoidPromise() => _voidPromise; diff --git a/src/DotNetty.Transport/Channels/Local/LocalChannel.cs b/src/DotNetty.Transport/Channels/Local/LocalChannel.cs index 76c791425..f484d8fcb 100644 --- a/src/DotNetty.Transport/Channels/Local/LocalChannel.cs +++ b/src/DotNetty.Transport/Channels/Local/LocalChannel.cs @@ -72,7 +72,7 @@ static LocalChannel() private LocalChannel v_peer; private LocalAddress v_localAddress; private LocalAddress v_remoteAddress; - private TaskCompletionSource v_connectPromise; + private DefaultPromise v_connectPromise; private int v_readInProgress; private int v_writeInProgress; private Task v_finishReadFuture; @@ -210,7 +210,7 @@ protected override void DoClose() // Preserve order of event and force a read operation now before the close operation is processed. if (SharedConstants.False < (uint)Volatile.Read(ref v_writeInProgress) && peer is object) { FinishPeerRead(peer); } - TaskCompletionSource promise = Volatile.Read(ref v_connectPromise); + var promise = Volatile.Read(ref v_connectPromise); if (promise is object) { // Use tryFailure() instead of setFailure() to avoid the race against cancel(). @@ -480,7 +480,7 @@ public sealed class LocalUnsafe : AbstractUnsafe { public override Task ConnectAsync(EndPoint remoteAddress, EndPoint localAddress) { - var promise = new TaskCompletionSource(); + var promise = new DefaultPromise(); if (Volatile.Read(ref _channel.v_state) == State.Connected) { diff --git a/src/DotNetty.Transport/Channels/Pool/FixedChannelPool.cs b/src/DotNetty.Transport/Channels/Pool/FixedChannelPool.cs index 95f5a6828..c488ef9f4 100644 --- a/src/DotNetty.Transport/Channels/Pool/FixedChannelPool.cs +++ b/src/DotNetty.Transport/Channels/Pool/FixedChannelPool.cs @@ -64,7 +64,7 @@ public enum AcquireTimeoutAction New, /// - /// Fails the of the acquire call with a . + /// Fails the of the acquire call with a . /// Fail } diff --git a/src/DotNetty.Transport/Channels/VoidChannelPromise.cs b/src/DotNetty.Transport/Channels/VoidChannelPromise.cs index 8091eb445..a976dd2e2 100644 --- a/src/DotNetty.Transport/Channels/VoidChannelPromise.cs +++ b/src/DotNetty.Transport/Channels/VoidChannelPromise.cs @@ -119,7 +119,7 @@ public void SetCanceled() { } public IPromise Unvoid() { - var promise = new TaskCompletionSource(); + var promise = new DefaultPromise(); if (_fireException) { _ = promise.Task.ContinueWith(FireExceptionOnFailureAction, _channel, TaskContinuationOptions.ExecuteSynchronously); diff --git a/src/DotNetty.Transport/DotNetty.Transport.Netstandard.csproj b/src/DotNetty.Transport/DotNetty.Transport.Netstandard.csproj index 421ca1cec..ee69de91b 100644 --- a/src/DotNetty.Transport/DotNetty.Transport.Netstandard.csproj +++ b/src/DotNetty.Transport/DotNetty.Transport.Netstandard.csproj @@ -2,7 +2,7 @@ - netstandard2.0;netstandard2.1 + netstandard2.1;netstandard2.0 DotNetty.Transport SpanNetty.Transport false diff --git a/src/DotNetty.Transport/DotNetty.Transport.csproj b/src/DotNetty.Transport/DotNetty.Transport.csproj index e9ebc1ee6..53930c1ee 100644 --- a/src/DotNetty.Transport/DotNetty.Transport.csproj +++ b/src/DotNetty.Transport/DotNetty.Transport.csproj @@ -2,7 +2,7 @@ - $(StandardTfms);netstandard2.1;netcoreapp2.1;netcoreapp3.1 + netcoreapp3.1;netcoreapp2.1;netstandard2.1;$(StandardTfms) DotNetty.Transport SpanNetty.Transport false diff --git a/src/version.props b/src/version.props index 638f1e905..b1e7d8695 100644 --- a/src/version.props +++ b/src/version.props @@ -84,6 +84,11 @@ 1.0.0.6600 + + + 1.0.0.7000 + + 1.0.0.9000 diff --git a/test/Directory.Build.props b/test/Directory.Build.props index bf549c3cc..a9399db05 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -3,9 +3,9 @@ - netcoreapp3.1 + net5.0 $(DeveloperBuildTestTfms) - netcoreapp3.1;netcoreapp2.1 + net5.0;netcoreapp3.1;netcoreapp2.1 $(StandardTestTfms);net471;net452 diff --git a/test/DotNetty.Buffers.Tests/run.net5.cmd b/test/DotNetty.Buffers.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Buffers.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Codecs.Http.Tests/DotNetty.Codecs.Http.Tests.csproj b/test/DotNetty.Codecs.Http.Tests/DotNetty.Codecs.Http.Tests.csproj index 43fc45bd5..1dbbb61b6 100644 --- a/test/DotNetty.Codecs.Http.Tests/DotNetty.Codecs.Http.Tests.csproj +++ b/test/DotNetty.Codecs.Http.Tests/DotNetty.Codecs.Http.Tests.csproj @@ -39,10 +39,6 @@ - - - - diff --git a/test/DotNetty.Codecs.Http.Tests/HttpClientCodecTest.cs b/test/DotNetty.Codecs.Http.Tests/HttpClientCodecTest.cs index 247335859..028db13a1 100644 --- a/test/DotNetty.Codecs.Http.Tests/HttpClientCodecTest.cs +++ b/test/DotNetty.Codecs.Http.Tests/HttpClientCodecTest.cs @@ -114,7 +114,7 @@ public void ServerCloseSocketInputProvidesData() var serverGroup = new MultithreadEventLoopGroup(1); try { - var serverCompletion = new TaskCompletionSource(); + var serverCompletion = new DefaultPromise(); var serverHandler = new ServerHandler(); ServerBootstrap sb = new ServerBootstrap() @@ -177,7 +177,7 @@ public void ServerCloseSocketInputProvidesData() class ClientHandler : SimpleChannelInboundHandler { - readonly TaskCompletionSource completion = new TaskCompletionSource(); + readonly DefaultPromise completion = new(); public bool WaitForCompletion() { @@ -194,7 +194,7 @@ public override void ExceptionCaught(IChannelHandlerContext context, Exception e class ServerHandler : SimpleChannelInboundHandler { - readonly TaskCompletionSource completion = new TaskCompletionSource(); + readonly DefaultPromise completion = new(); public bool WaitForCompletion() { diff --git a/test/DotNetty.Codecs.Http.Tests/run.net5.cmd b/test/DotNetty.Codecs.Http.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Codecs.Http.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2ConnectionDecoderTest.cs b/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2ConnectionDecoderTest.cs index 7aca8742c..30b58f326 100644 --- a/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2ConnectionDecoderTest.cs +++ b/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2ConnectionDecoderTest.cs @@ -59,7 +59,7 @@ public DefaultHttp2ConnectionDecoderTest() this.encoder = new Mock(); this.lifecycleManager = new Mock(); - this.promise = new TaskCompletionSource(); + this.promise = new DefaultPromise(); var headersReceivedState = new AtomicInteger(); this.channel.Setup(x => x.IsActive).Returns(true); diff --git a/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2ConnectionEncoderTest.cs b/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2ConnectionEncoderTest.cs index c29e6dba9..b4216a4f6 100644 --- a/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2ConnectionEncoderTest.cs +++ b/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2ConnectionEncoderTest.cs @@ -1194,7 +1194,7 @@ private void GoAwaySent(int lastStreamId) private static IPromise NewPromise() { - return new TaskCompletionSource(); + return new DefaultPromise(); } private static IByteBuffer DummyData() diff --git a/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2FrameWriterTest.cs b/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2FrameWriterTest.cs index dd918e8b0..1af04949e 100644 --- a/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2FrameWriterTest.cs +++ b/test/DotNetty.Codecs.Http2.Tests/DefaultHttp2FrameWriterTest.cs @@ -41,7 +41,7 @@ public DefaultHttp2FrameWriterTest() _expectedOutbound = Unpooled.Empty; - _promise = new TaskCompletionSource(); + _promise = new DefaultPromise(); _channel = new Mock(); diff --git a/test/DotNetty.Codecs.Http2.Tests/Http2ConnectionHandlerTest.cs b/test/DotNetty.Codecs.Http2.Tests/Http2ConnectionHandlerTest.cs index c9138bc6c..980d532d4 100644 --- a/test/DotNetty.Codecs.Http2.Tests/Http2ConnectionHandlerTest.cs +++ b/test/DotNetty.Codecs.Http2.Tests/Http2ConnectionHandlerTest.cs @@ -64,8 +64,8 @@ public Http2ConnectionHandlerTest() var config = new DefaultChannelConfiguration(_channel.Object); _channel.Setup(x => x.Configuration).Returns(config); - _promise = new TaskCompletionSource(); - _voidPromise = new TaskCompletionSource(); + _promise = new DefaultPromise(); + _voidPromise = new DefaultPromise(); var fakeException = new Http2RuntimeException("Fake exception"); _future = TaskUtil.FromException(fakeException); @@ -748,7 +748,7 @@ public void CanSendGoAwayFramesWithDecreasingLastStreamIds() It.Is(v => v == STREAM_ID + 2), It.Is(v => v == errorCode), It.Is(v => v.Equals(data)))); - _promise = new TaskCompletionSource(); + _promise = new DefaultPromise(); _handler.GoAwayAsync(_ctx.Object, STREAM_ID, errorCode, data, _promise); _frameWriter.Verify( x => x.WriteGoAwayAsync( @@ -997,8 +997,8 @@ public void WriteMultipleRstFramesForSameStream() return p.Task; }); - var promise = new TaskCompletionSource(); - var promise2 = new TaskCompletionSource(); + var promise = new DefaultPromise(); + var promise2 = new DefaultPromise(); promise.Task.ContinueWith(t => { _handler.ResetStreamAsync(_ctx.Object, STREAM_ID, Http2Error.StreamClosed, promise2); diff --git a/test/DotNetty.Codecs.Http2.Tests/Http2ControlFrameLimitEncoderTest.cs b/test/DotNetty.Codecs.Http2.Tests/Http2ControlFrameLimitEncoderTest.cs index da0ef4a14..157e1a499 100644 --- a/test/DotNetty.Codecs.Http2.Tests/Http2ControlFrameLimitEncoderTest.cs +++ b/test/DotNetty.Codecs.Http2.Tests/Http2ControlFrameLimitEncoderTest.cs @@ -247,7 +247,7 @@ private void VerifyFlushAndClose(int invocations, bool failed) private IPromise NewPromise() { - return new TaskCompletionSource(); + return new DefaultPromise(); } } } diff --git a/test/DotNetty.Codecs.Http2.Tests/Http2FrameCodecTest.cs b/test/DotNetty.Codecs.Http2.Tests/Http2FrameCodecTest.cs index c23a8a058..ed64c2474 100644 --- a/test/DotNetty.Codecs.Http2.Tests/Http2FrameCodecTest.cs +++ b/test/DotNetty.Codecs.Http2.Tests/Http2FrameCodecTest.cs @@ -617,7 +617,7 @@ public async Task NewOutboundStream() Assert.NotNull(stream); Assert.False(Http2CodecUtil.IsStreamIdValid(stream.Id)); - var listenerExecuted = new TaskCompletionSource(); + var listenerExecuted = new DefaultPromise(); await _channel.WriteAndFlushAsync(new DefaultHttp2HeadersFrame(new DefaultHttp2Headers(), false) { Stream = stream }); Assert.True(Http2CodecUtil.IsStreamIdValid(stream.Id)); diff --git a/test/DotNetty.Codecs.Http2.Tests/Http2FrameRoundtripTest.cs b/test/DotNetty.Codecs.Http2.Tests/Http2FrameRoundtripTest.cs index 0102a521c..c11220b4d 100644 --- a/test/DotNetty.Codecs.Http2.Tests/Http2FrameRoundtripTest.cs +++ b/test/DotNetty.Codecs.Http2.Tests/Http2FrameRoundtripTest.cs @@ -44,7 +44,7 @@ public Http2FrameRoundtripTest() this.ctx.Setup(x => x.Allocator).Returns(this.alloc.Object); this.ctx.Setup(x => x.Executor).Returns(this.executor.Object); this.ctx.Setup(x => x.Channel).Returns(this.channel.Object); - this.ctx.Setup(x => x.NewPromise()).Returns(() => new TaskCompletionSource()); + this.ctx.Setup(x => x.NewPromise()).Returns(() => new DefaultPromise()); this.writer = new DefaultHttp2FrameWriter(new DefaultHttp2HeadersEncoder(NeverSensitiveDetector.Instance, Http2TestUtil.NewTestEncoder())); this.reader = new DefaultHttp2FrameReader(new DefaultHttp2HeadersDecoder(false, Http2TestUtil.NewTestDecoder())); diff --git a/test/DotNetty.Codecs.Http2.Tests/StreamBufferingEncoderTest.cs b/test/DotNetty.Codecs.Http2.Tests/StreamBufferingEncoderTest.cs index ff1819b3a..4cb534106 100644 --- a/test/DotNetty.Codecs.Http2.Tests/StreamBufferingEncoderTest.cs +++ b/test/DotNetty.Codecs.Http2.Tests/StreamBufferingEncoderTest.cs @@ -551,7 +551,7 @@ private static Task SuccessAnswer(params object[] args) private static IPromise NewPromise() { - return new TaskCompletionSource(); + return new DefaultPromise(); } private static IByteBuffer Data() diff --git a/test/DotNetty.Codecs.Http2.Tests/run.net5.cmd b/test/DotNetty.Codecs.Http2.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Codecs.Http2.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Codecs.Mqtt.Tests/run.net5.cmd b/test/DotNetty.Codecs.Mqtt.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Codecs.Mqtt.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Codecs.Protobuf.Tests/run.net5.cmd b/test/DotNetty.Codecs.Protobuf.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Codecs.Protobuf.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Codecs.Redis.Tests/run.net5.cmd b/test/DotNetty.Codecs.Redis.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Codecs.Redis.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Codecs.Tests/run.net5.cmd b/test/DotNetty.Codecs.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Codecs.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Common.Tests/Concurrency/SingleThreadEventExecutorTests.cs b/test/DotNetty.Common.Tests/Concurrency/SingleThreadEventExecutorTests.cs index 7a02d948a..9b546a4d7 100644 --- a/test/DotNetty.Common.Tests/Concurrency/SingleThreadEventExecutorTests.cs +++ b/test/DotNetty.Common.Tests/Concurrency/SingleThreadEventExecutorTests.cs @@ -33,7 +33,7 @@ public void TaskSchedulerIsPreserved() //Clear SynchronizationContext set by xunit SynchronizationContext.SetSynchronizationContext(null); - var completion = new TaskCompletionSource(); + var completion = new DefaultPromise(); executor.Execute(async () => { try @@ -99,7 +99,7 @@ public void FuzzyScheduling(int producerCount, bool perCpu, int taskPerProducer) public async Task ScheduledTaskFiresOnTime(bool scheduleFromExecutor) { var scheduler = new DefaultEventExecutor(); // SingleThreadEventExecutor(null, TimeSpan.FromMinutes(1)) - var promise = new TaskCompletionSource(); + var promise = new DefaultPromise(); Func scheduleFunc = () => scheduler.ScheduleAsync(() => promise.Complete(), TimeSpan.FromMilliseconds(100)); Task task = scheduleFromExecutor ? await scheduler.SubmitAsync(scheduleFunc) : scheduleFunc(); await Task.WhenAny(task, Task.Delay(TimeSpan.FromMilliseconds(300))); @@ -110,7 +110,7 @@ public async Task ScheduledTaskFiresOnTime(bool scheduleFromExecutor) public async Task ScheduledTaskFiresOnTimeWhileBusy() { var scheduler = new DefaultEventExecutor(); - var promise = new TaskCompletionSource(); + var promise = new DefaultPromise(); Action selfQueueAction = null; selfQueueAction = () => { diff --git a/test/DotNetty.Common.Tests/Utilities/AsciiStringCharacterTest.cs b/test/DotNetty.Common.Tests/Utilities/AsciiStringCharacterTest.cs index 062d44085..522b141ad 100644 --- a/test/DotNetty.Common.Tests/Utilities/AsciiStringCharacterTest.cs +++ b/test/DotNetty.Common.Tests/Utilities/AsciiStringCharacterTest.cs @@ -39,7 +39,9 @@ public void GetBytes() Encoding.ASCII, Encoding.BigEndianUnicode, Encoding.UTF32, +#pragma warning disable SYSLIB0001 // 类型或成员已过时 Encoding.UTF7, +#pragma warning restore SYSLIB0001 // 类型或成员已过时 Encoding.UTF8, Encoding.Unicode }; diff --git a/test/DotNetty.Common.Tests/run.net5.cmd b/test/DotNetty.Common.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Common.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.End2End.Tests/End2EndTests.cs b/test/DotNetty.End2End.Tests/End2EndTests.cs index e73b486ff..12eb062b3 100644 --- a/test/DotNetty.End2End.Tests/End2EndTests.cs +++ b/test/DotNetty.End2End.Tests/End2EndTests.cs @@ -49,7 +49,7 @@ public End2EndTests(ITestOutputHelper output) [Fact] public async Task EchoServerAndClient() { - var testPromise = new TaskCompletionSource(); + var testPromise = new DefaultPromise(); var tlsCertificate = TestResourceHelper.GetTestCertificate(); Func closeServerFunc = await this.StartServerAsync(true, ch => { @@ -115,7 +115,7 @@ public async Task EchoServerAndClient() [Fact] public async Task MqttServerAndClient() { - var testPromise = new TaskCompletionSource(); + var testPromise = new DefaultPromise(); var tlsCertificate = TestResourceHelper.GetTestCertificate(); var serverReadListener = new ReadListeningHandler(); @@ -289,7 +289,7 @@ await channel.WriteAndFlushManyAsync( /// Starts Echo server. /// /// function to trigger closure of the server. - async Task> StartServerAsync(bool tcpNoDelay, Action childHandlerSetupAction, TaskCompletionSource testPromise) + async Task> StartServerAsync(bool tcpNoDelay, Action childHandlerSetupAction, DefaultPromise testPromise) { var bossGroup = new MultithreadEventLoopGroup(1); var workerGroup = new MultithreadEventLoopGroup(); diff --git a/test/DotNetty.End2End.Tests/run.net5.cmd b/test/DotNetty.End2End.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.End2End.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Handlers.Tests/run.net5.cmd b/test/DotNetty.Handlers.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Handlers.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.NetUV.Tests/run.net5.cmd b/test/DotNetty.NetUV.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.NetUV.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/AbstractSocketReuseFdTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/AbstractSocketReuseFdTest.cs index deae3ef6a..5dfbfac03 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/AbstractSocketReuseFdTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/AbstractSocketReuseFdTest.cs @@ -31,8 +31,8 @@ public void TestReuseFd(ServerBootstrap sb, Bootstrap cb) AtomicReference globalException = new AtomicReference(); AtomicInteger serverRemaining = new AtomicInteger(numChannels); AtomicInteger clientRemaining = new AtomicInteger(numChannels); - IPromise serverDonePromise = new TaskCompletionSource(); - IPromise clientDonePromise = new TaskCompletionSource(); + IPromise serverDonePromise = new DefaultPromise(); + IPromise clientDonePromise = new DefaultPromise(); sb.ChildHandler(new ActionChannelInitializer(sch => { diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketCancelWriteTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketCancelWriteTest.cs index bbb678ace..5500b0e40 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketCancelWriteTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketCancelWriteTest.cs @@ -80,12 +80,12 @@ private async Task TestCancelWrite0(ServerBootstrap sb, Bootstrap cb) IChannel sc = await sb.BindAsync(); IChannel cc = await cb.ConnectAsync(sc.LocalAddress); - var promise = new TaskCompletionSource(); + var promise = new DefaultPromise(); Assert.True(promise.TrySetCanceled()); var f = cc.WriteAsync(a, promise); await cc.WriteAndFlushAsync(b); cc.WriteAsync(c).Ignore(); - promise = new TaskCompletionSource(); + promise = new DefaultPromise(); Assert.True(promise.TrySetCanceled()); var f2 = cc.WriteAsync(d, promise); await cc.WriteAndFlushAsync(e); diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketGatheringWriteTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketGatheringWriteTest.cs index b3777b6c8..44c129103 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketGatheringWriteTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketGatheringWriteTest.cs @@ -337,7 +337,7 @@ private async Task TestGatheringWrite0( sb.ChildOption(ChannelOption.AutoRead, autoRead); cb.Option(ChannelOption.AutoRead, autoRead); - IPromise serverDonePromise = new TaskCompletionSource(); + IPromise serverDonePromise = new DefaultPromise(); TestServerHandler sh = new TestServerHandler(autoRead, serverDonePromise, data.Length); TestHandler ch = new TestHandler(autoRead); @@ -372,9 +372,9 @@ private async Task TestGatheringWrite0( Assert.True(cf.Wait(60000)); await cf; } - catch (Exception t) + catch (Exception) { - throw t; + throw; } await serverDonePromise.Task; diff --git a/test/DotNetty.Suite.Tests/Transport/Socket/SocketStringEchoTest.cs b/test/DotNetty.Suite.Tests/Transport/Socket/SocketStringEchoTest.cs index cea9eabbe..5da9d407a 100644 --- a/test/DotNetty.Suite.Tests/Transport/Socket/SocketStringEchoTest.cs +++ b/test/DotNetty.Suite.Tests/Transport/Socket/SocketStringEchoTest.cs @@ -166,8 +166,8 @@ private static async Task TestStringEcho0(ServerBootstrap sb, Bootstrap cb, bool sb.ChildOption(ChannelOption.AutoRead, autoRead); cb.Option(ChannelOption.AutoRead, autoRead); - IPromise serverDonePromise = new TaskCompletionSource(); - IPromise clientDonePromise = new TaskCompletionSource(); + IPromise serverDonePromise = new DefaultPromise(); + IPromise clientDonePromise = new DefaultPromise(); StringEchoHandler sh = new StringEchoHandler(autoRead, serverDonePromise, output); StringEchoHandler ch = new StringEchoHandler(autoRead, clientDonePromise, output); diff --git a/test/DotNetty.Suite.Tests/run.net5.cmd b/test/DotNetty.Suite.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Suite.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Transport.Libuv.Tests/BufReleaseTests.cs b/test/DotNetty.Transport.Libuv.Tests/BufReleaseTests.cs index e104f9f27..fb98c2a24 100644 --- a/test/DotNetty.Transport.Libuv.Tests/BufReleaseTests.cs +++ b/test/DotNetty.Transport.Libuv.Tests/BufReleaseTests.cs @@ -76,7 +76,7 @@ void BufRelease0(ServerBootstrap sb, Bootstrap cb) sealed class BufWriterHandler : SimpleChannelInboundHandler { readonly Random random; - readonly TaskCompletionSource completion; + readonly DefaultPromise completion; IByteBuffer buf; Task writeTask; @@ -84,7 +84,7 @@ sealed class BufWriterHandler : SimpleChannelInboundHandler public BufWriterHandler() { this.random = new Random(); - this.completion = new TaskCompletionSource(); + this.completion = new DefaultPromise(); } public Task Added => this.completion.Task; diff --git a/test/DotNetty.Transport.Libuv.Tests/CompositeBufferGatheringWriteTests.cs b/test/DotNetty.Transport.Libuv.Tests/CompositeBufferGatheringWriteTests.cs index ab276ce4a..f21f7efc3 100644 --- a/test/DotNetty.Transport.Libuv.Tests/CompositeBufferGatheringWriteTests.cs +++ b/test/DotNetty.Transport.Libuv.Tests/CompositeBufferGatheringWriteTests.cs @@ -73,13 +73,13 @@ void SingleCompositeBufferWrite0(ServerBootstrap sb, Bootstrap cb) sealed class ClientHandler : ChannelHandlerAdapter { - readonly TaskCompletionSource completion; + readonly DefaultPromise completion; IByteBuffer aggregator; public ClientHandler() { - this.completion = new TaskCompletionSource(); + this.completion = new DefaultPromise(); } public override void HandlerAdded(IChannelHandlerContext ctx) diff --git a/test/DotNetty.Transport.Libuv.Tests/DetectPeerCloseWithoutReadTests.cs b/test/DotNetty.Transport.Libuv.Tests/DetectPeerCloseWithoutReadTests.cs index efed3d5c9..838c48cfa 100644 --- a/test/DotNetty.Transport.Libuv.Tests/DetectPeerCloseWithoutReadTests.cs +++ b/test/DotNetty.Transport.Libuv.Tests/DetectPeerCloseWithoutReadTests.cs @@ -158,12 +158,12 @@ public void ServerCloseWithoutClientReadIsDetected() sealed class WriteHandler : ChannelHandlerAdapter { readonly int expectedBytesRead; - readonly TaskCompletionSource completion; + readonly DefaultPromise completion; public WriteHandler(int expectedBytesRead) { this.expectedBytesRead = expectedBytesRead; - this.completion = new TaskCompletionSource(); + this.completion = new DefaultPromise(); } public Task Inactive => this.completion.Task; diff --git a/test/DotNetty.Transport.Libuv.Tests/DotNetty.Transport.Libuv.Tests.csproj b/test/DotNetty.Transport.Libuv.Tests/DotNetty.Transport.Libuv.Tests.csproj index d05f87a7f..717701caa 100644 --- a/test/DotNetty.Transport.Libuv.Tests/DotNetty.Transport.Libuv.Tests.csproj +++ b/test/DotNetty.Transport.Libuv.Tests/DotNetty.Transport.Libuv.Tests.csproj @@ -19,7 +19,6 @@ - diff --git a/test/DotNetty.Transport.Libuv.Tests/EchoTests.cs b/test/DotNetty.Transport.Libuv.Tests/EchoTests.cs index 77613e87e..dd82a839c 100644 --- a/test/DotNetty.Transport.Libuv.Tests/EchoTests.cs +++ b/test/DotNetty.Transport.Libuv.Tests/EchoTests.cs @@ -121,7 +121,7 @@ sealed class EchoHandler : SimpleChannelInboundHandler readonly bool autoRead; readonly byte[] expected; readonly ITestOutputHelper output; - readonly TaskCompletionSource completion; + readonly DefaultPromise completion; IChannel channel; int counter; @@ -131,7 +131,7 @@ public EchoHandler(bool autoRead, byte[] expected, ITestOutputHelper output) this.autoRead = autoRead; this.expected = expected; this.output = output; - this.completion = new TaskCompletionSource(); + this.completion = new DefaultPromise(); } public override void ChannelActive(IChannelHandlerContext ctx) diff --git a/test/DotNetty.Transport.Libuv.Tests/EventLoopTests.cs b/test/DotNetty.Transport.Libuv.Tests/EventLoopTests.cs index 3b0aad6b2..6c8f8e40e 100644 --- a/test/DotNetty.Transport.Libuv.Tests/EventLoopTests.cs +++ b/test/DotNetty.Transport.Libuv.Tests/EventLoopTests.cs @@ -26,13 +26,13 @@ public void Run() { } sealed class RunCounter : IRunnable { readonly int expected; - readonly TaskCompletionSource completionSource; + readonly DefaultPromise completionSource; int count; public RunCounter(int expected) { this.expected = expected; - this.completionSource = new TaskCompletionSource(); + this.completionSource = new DefaultPromise(); } public Task Completion => this.completionSource.Task; diff --git a/test/DotNetty.Transport.Libuv.Tests/ExceptionHandlingTests.cs b/test/DotNetty.Transport.Libuv.Tests/ExceptionHandlingTests.cs index 2ac71cf76..03f5912f0 100644 --- a/test/DotNetty.Transport.Libuv.Tests/ExceptionHandlingTests.cs +++ b/test/DotNetty.Transport.Libuv.Tests/ExceptionHandlingTests.cs @@ -92,12 +92,12 @@ public override void ChannelRead(IChannelHandlerContext ctx, object msg) sealed class ExceptionHandler : ChannelHandlerAdapter { - readonly TaskCompletionSource completionSource; + readonly DefaultPromise completionSource; int count; public ExceptionHandler() { - this.completionSource = new TaskCompletionSource(); + this.completionSource = new DefaultPromise(); } public Task Inactive => this.completionSource.Task; diff --git a/test/DotNetty.Transport.Libuv.Tests/ReadPendingTests.cs b/test/DotNetty.Transport.Libuv.Tests/ReadPendingTests.cs index 0696eda56..15bfb3553 100644 --- a/test/DotNetty.Transport.Libuv.Tests/ReadPendingTests.cs +++ b/test/DotNetty.Transport.Libuv.Tests/ReadPendingTests.cs @@ -88,7 +88,7 @@ void ReadPendingIsResetAfterEachRead0(ServerBootstrap sb, Bootstrap cb) sealed class ReadPendingInitializer : ChannelInitializer { internal readonly ReadPendingReadHandler ReadPendingHandler = new ReadPendingReadHandler(); - readonly TaskCompletionSource completionSource = new TaskCompletionSource(); + readonly DefaultPromise completionSource = new(); internal volatile IChannel Channel; public Task Initialize => this.completionSource.Task; diff --git a/test/DotNetty.Transport.Libuv.Tests/ResetTests.cs b/test/DotNetty.Transport.Libuv.Tests/ResetTests.cs index 301e7159b..989963579 100644 --- a/test/DotNetty.Transport.Libuv.Tests/ResetTests.cs +++ b/test/DotNetty.Transport.Libuv.Tests/ResetTests.cs @@ -70,12 +70,12 @@ void Run(ServerBootstrap sb, Bootstrap cb) sealed class ServerInitializer : ChannelInitializer { - readonly TaskCompletionSource completion; + readonly DefaultPromise completion; IChannel serverChannel; public ServerInitializer() { - this.completion = new TaskCompletionSource(); + this.completion = new DefaultPromise(); } public Task Initialized => this.completion.Task; @@ -109,12 +109,12 @@ public ClientInitializer() sealed class ClientHandler : ChannelHandlerAdapter { - readonly TaskCompletionSource completion; + readonly DefaultPromise completion; internal Exception Error; public ClientHandler() { - this.completion = new TaskCompletionSource(); + this.completion = new DefaultPromise(); } public Task Inactive => this.completion.Task; diff --git a/test/DotNetty.Transport.Libuv.Tests/run.net5.cmd b/test/DotNetty.Transport.Libuv.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Transport.Libuv.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file diff --git a/test/DotNetty.Transport.Tests/Channel/AbstractChannelTest.cs b/test/DotNetty.Transport.Tests/Channel/AbstractChannelTest.cs index 341bb7499..445ef929f 100644 --- a/test/DotNetty.Transport.Tests/Channel/AbstractChannelTest.cs +++ b/test/DotNetty.Transport.Tests/Channel/AbstractChannelTest.cs @@ -65,7 +65,7 @@ public void EnsureSubsequentRegistrationDoesNotFireActive() channel.Pipeline.AddLast(handler.Object); RegisterChannel(eventLoop.Object, channel); - channel.Unsafe.Deregister(new TaskCompletionSource()); + channel.Unsafe.Deregister(new DefaultPromise()); RegisterChannel(eventLoop.Object, channel); diff --git a/test/DotNetty.Transport.Tests/Channel/AbstractCoalescingBufferQueueTest.cs b/test/DotNetty.Transport.Tests/Channel/AbstractCoalescingBufferQueueTest.cs index ddbcbde53..f0d7d040b 100644 --- a/test/DotNetty.Transport.Tests/Channel/AbstractCoalescingBufferQueueTest.cs +++ b/test/DotNetty.Transport.Tests/Channel/AbstractCoalescingBufferQueueTest.cs @@ -30,7 +30,7 @@ private static void TestDecrementAll(bool write) AbstractCoalescingBufferQueue queue = new TestCoalescingBufferQueue(channel, 128); byte[] bytes = new byte[128]; - var promise = new TaskCompletionSource(); + var promise = new DefaultPromise(); promise.Task.ContinueWith(t => { queue.Add(Unpooled.WrappedBuffer(bytes)); diff --git a/test/DotNetty.Transport.Tests/Channel/CoalescingBufferQueueTest.cs b/test/DotNetty.Transport.Tests/Channel/CoalescingBufferQueueTest.cs index 31af8067b..03e4984e8 100644 --- a/test/DotNetty.Transport.Tests/Channel/CoalescingBufferQueueTest.cs +++ b/test/DotNetty.Transport.Tests/Channel/CoalescingBufferQueueTest.cs @@ -31,7 +31,7 @@ public CoalescingBufferQueueTest() this.mouseSuccess = false; this.channel = new EmbeddedChannel(); this.writeQueue = new CoalescingBufferQueue(channel, 16, true); - this.catPromise = new TaskCompletionSource(); + this.catPromise = new DefaultPromise(); // mouseListener = new ChannelFutureListener() { // @Override // public void operationComplete(ChannelFuture future) throws Exception { diff --git a/test/DotNetty.Transport.Tests/Channel/Local/LocalTransportThreadModelTest.cs b/test/DotNetty.Transport.Tests/Channel/Local/LocalTransportThreadModelTest.cs index 901820a73..b935ee62f 100644 --- a/test/DotNetty.Transport.Tests/Channel/Local/LocalTransportThreadModelTest.cs +++ b/test/DotNetty.Transport.Tests/Channel/Local/LocalTransportThreadModelTest.cs @@ -197,7 +197,7 @@ public async Task TestStagedExecution() Assert.Single(h2._removalThreadNames); Assert.Single(h3._removalThreadNames); } - catch (Exception e) + catch (Exception) { //System.out.println("H1I: " + h1.inboundThreadNames); //System.out.println("H2I: " + h2.inboundThreadNames); @@ -208,7 +208,7 @@ public async Task TestStagedExecution() //System.out.println("H1R: " + h1.removalThreadNames); //System.out.println("H2R: " + h2.removalThreadNames); //System.out.println("H3R: " + h3.removalThreadNames); - throw e; + throw; } finally { diff --git a/test/DotNetty.Transport.Tests/Channel/Pool/FixedChannelPoolMapDeadlockTest.cs b/test/DotNetty.Transport.Tests/Channel/Pool/FixedChannelPoolMapDeadlockTest.cs index beb3ed557..17c2ee1ad 100644 --- a/test/DotNetty.Transport.Tests/Channel/Pool/FixedChannelPoolMapDeadlockTest.cs +++ b/test/DotNetty.Transport.Tests/Channel/Pool/FixedChannelPoolMapDeadlockTest.cs @@ -84,10 +84,10 @@ public async Task TestDeadlockOnAcquire() if (!result || !futureB1.IsSuccess()) { throw new TimeoutException(); } Assert.Same(poolB1, futureB1.Result); } - catch (Exception e) + catch (Exception) { Shutdown(threadA1, threadA2, threadB1, threadB2); - throw e; + throw; } // Now release the other two threads which at this point lost the race and will try to clean up the acquired diff --git a/test/DotNetty.Transport.Tests/run.net5.cmd b/test/DotNetty.Transport.Tests/run.net5.cmd new file mode 100644 index 000000000..c4f8ec361 --- /dev/null +++ b/test/DotNetty.Transport.Tests/run.net5.cmd @@ -0,0 +1 @@ +dotnet test --framework net5.0 -- RunConfiguration.TargetPlatform=x64 \ No newline at end of file