From b663f01da33ff2e1449f425308b8a91876908b97 Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 07:37:56 +0100 Subject: [PATCH 01/12] Remove Net40 target --- build.cake | 66 +------------------ .../Polly.Net40Async.Specs.csproj | 47 ------------- .../Properties/AssemblyInfo.cs | 5 -- src/Polly.Net40Async.Specs/readme.txt | 3 - src/Polly.Net40Async/Polly.Net40Async.csproj | 35 ---------- .../Properties/AssemblyInfo.cs | 8 --- src/Polly.Net40Async/app.config | 15 ----- .../Properties/AssemblyInfo.cs | 2 +- src/Polly.sln | 19 ++---- 9 files changed, 6 insertions(+), 194 deletions(-) delete mode 100644 src/Polly.Net40Async.Specs/Polly.Net40Async.Specs.csproj delete mode 100644 src/Polly.Net40Async.Specs/Properties/AssemblyInfo.cs delete mode 100644 src/Polly.Net40Async.Specs/readme.txt delete mode 100644 src/Polly.Net40Async/Polly.Net40Async.csproj delete mode 100644 src/Polly.Net40Async/Properties/AssemblyInfo.cs delete mode 100644 src/Polly.Net40Async/app.config diff --git a/build.cake b/build.cake index 7c124a5df12..6ff9142c236 100644 --- a/build.cake +++ b/build.cake @@ -26,7 +26,6 @@ using System.Text.Json; /////////////////////////////////////////////////////////////////////////////// var projectName = "Polly"; -var net40AsyncProjectName = "Polly.Net40Async"; var keyName = "Polly.snk"; var solutions = GetFiles("./**/*.sln"); @@ -39,11 +38,8 @@ var testResultsDir = artifactsDir + Directory("test-results"); // NuGet var nuspecFilename = projectName + ".nuspec"; -var net40AsyncNuspecFilename = net40AsyncProjectName + ".nuspec"; var nuspecSrcFile = srcDir + File(nuspecFilename); var nuspecDestFile = buildDir + File(nuspecFilename); -var net40AsyncNuspecSrcFile = srcDir + File(net40AsyncNuspecFilename); -var net40AsyncNuspecDestFile = buildDir + Directory(net40AsyncProjectName) + File(net40AsyncNuspecFilename); var nupkgDestDir = artifactsDir + Directory("nuget-package"); var snkFile = srcDir + File(keyName); @@ -52,10 +48,6 @@ var projectToNugetFolderMap = new Dictionary() { { "NetStandard11", new [] {"netstandard1.1"} }, }; -var net40AsyncProjectToNugetFolderMap = new Dictionary() { - { "Net40Async" , new [] {"net40"} }, -}; - // Gitversion var gitVersionPath = ToolsExePath("GitVersion.exe"); Dictionary gitVersionOutput; @@ -213,23 +205,6 @@ Task("__CopyOutputToNugetFolder") CopyFile(nuspecSrcFile, nuspecDestFile); }); -Task("__CopyNet40AsyncOutputToNugetFolder") - .Does(() => -{ - foreach(var project in net40AsyncProjectToNugetFolderMap.Keys) { - var sourceDir = srcDir + Directory(projectName + "." + project) + Directory("bin") + Directory(configuration); - - foreach(var targetFolder in net40AsyncProjectToNugetFolderMap[project]) { - var destDir = buildDir + Directory(net40AsyncProjectName) + Directory("lib"); - - Information("Copying {0} -> {1}.", sourceDir, destDir); - CopyDirectory(sourceDir, destDir); - } - } - - CopyFile(net40AsyncNuspecSrcFile, net40AsyncNuspecDestFile); -}); - Task("__CreateNugetPackage") .Does(() => { @@ -248,24 +223,6 @@ Task("__CreateNugetPackage") NuGetPack(nuspecDestFile, nuGetPackSettings); }); -Task("__CreateNet40AsyncNugetPackage") - .Does(() => -{ - var nugetVersion = gitVersionOutput["NuGetVersion"].ToString(); - var packageName = net40AsyncProjectName; - - Information("Building {0}.{1}.nupkg", packageName, nugetVersion); - - var nuGetPackSettings = new NuGetPackSettings { - Id = packageName, - Title = packageName, - Version = nugetVersion, - OutputDirectory = nupkgDestDir - }; - - NuGetPack(net40AsyncNuspecDestFile, nuGetPackSettings); -}); - Task("__StronglySignAssemblies") .Does(() => { @@ -300,24 +257,6 @@ Task("__CreateSignedNugetPackage") NuGetPack(nuspecDestFile, nuGetPackSettings); }); -Task("__CreateSignedNet40AsyncNugetPackage") - .Does(() => -{ - var nugetVersion = gitVersionOutput["NuGetVersion"].ToString(); - var packageName = net40AsyncProjectName + "-Signed"; - - Information("Building {0}.{1}.nupkg", packageName, nugetVersion); - - var nuGetPackSettings = new NuGetPackSettings { - Id = packageName, - Title = packageName, - Version = nugetVersion, - OutputDirectory = nupkgDestDir - }; - - NuGetPack(net40AsyncNuspecDestFile, nuGetPackSettings); -}); - ////////////////////////////////////////////////////////////////////// // BUILD TASKS ////////////////////////////////////////////////////////////////////// @@ -332,12 +271,9 @@ Task("Build") .IsDependentOn("__RunTests") .IsDependentOn("__RunDotnetTests") .IsDependentOn("__CopyOutputToNugetFolder") - .IsDependentOn("__CopyNet40AsyncOutputToNugetFolder") .IsDependentOn("__CreateNugetPackage") - .IsDependentOn("__CreateNet40AsyncNugetPackage") .IsDependentOn("__StronglySignAssemblies") - .IsDependentOn("__CreateSignedNugetPackage") - .IsDependentOn("__CreateSignedNet40AsyncNugetPackage"); + .IsDependentOn("__CreateSignedNugetPackage"); /////////////////////////////////////////////////////////////////////////////// // PRIMARY TARGETS diff --git a/src/Polly.Net40Async.Specs/Polly.Net40Async.Specs.csproj b/src/Polly.Net40Async.Specs/Polly.Net40Async.Specs.csproj deleted file mode 100644 index 626d048d8bd..00000000000 --- a/src/Polly.Net40Async.Specs/Polly.Net40Async.Specs.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - net45 - false - - - full - DEBUG;TRACE;NET45 - - - pdbonly - true - TRACE;RELEASE;NET45 - - - - - - - - - - - - - - - - - - - - - - - - Properties\GlobalAssemblyInfo.cs - - - - - - - - - - \ No newline at end of file diff --git a/src/Polly.Net40Async.Specs/Properties/AssemblyInfo.cs b/src/Polly.Net40Async.Specs/Properties/AssemblyInfo.cs deleted file mode 100644 index d88b899ce3a..00000000000 --- a/src/Polly.Net40Async.Specs/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System.Reflection; -using Xunit; - -[assembly: AssemblyTitle("Polly.Net40Async.Specs")] -[assembly: CollectionBehavior(DisableTestParallelization = false)] \ No newline at end of file diff --git a/src/Polly.Net40Async.Specs/readme.txt b/src/Polly.Net40Async.Specs/readme.txt deleted file mode 100644 index 7e84b253634..00000000000 --- a/src/Polly.Net40Async.Specs/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -This project exists to test Polly.Net40Async.csproj. - -Polly.Net40Async.Specs.csproj is compiled against .NET4.5, and has to be, to use XUnit version 2.0, on which we depend. This is however a valid way of xunit-testing a .NET40 assembly. See https://github.com/xunit/xunit/issues/241#issuecomment-67725679 diff --git a/src/Polly.Net40Async/Polly.Net40Async.csproj b/src/Polly.Net40Async/Polly.Net40Async.csproj deleted file mode 100644 index 42ca565a8c5..00000000000 --- a/src/Polly.Net40Async/Polly.Net40Async.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - Polly - net40 - false - true - true - true - - - full - TRACE;DEBUG;NET40 - - - pdbonly - true - TRACE;RELEASE;NET40 - - - - - - - - - - - - - - Properties\GlobalAssemblyInfo.cs - - - - \ No newline at end of file diff --git a/src/Polly.Net40Async/Properties/AssemblyInfo.cs b/src/Polly.Net40Async/Properties/AssemblyInfo.cs deleted file mode 100644 index 99a05892795..00000000000 --- a/src/Polly.Net40Async/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyTitle("Polly")] -[assembly: CLSCompliant(false)] // Because Nito.AsycEx, on which Polly.Net40Async depends, is not CLSCompliant. - -[assembly: InternalsVisibleTo("Polly.Net40Async.Specs")] \ No newline at end of file diff --git a/src/Polly.Net40Async/app.config b/src/Polly.Net40Async/app.config deleted file mode 100644 index e03ea0a5f08..00000000000 --- a/src/Polly.Net40Async/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Polly.NetStandard11/Properties/AssemblyInfo.cs b/src/Polly.NetStandard11/Properties/AssemblyInfo.cs index 3b88cf4bf5f..550fd1c1006 100644 --- a/src/Polly.NetStandard11/Properties/AssemblyInfo.cs +++ b/src/Polly.NetStandard11/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly")] -[assembly: AssemblyVersion("5.9.0.0")] +[assembly: AssemblyVersion("5.9.1.0")] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("Polly.NetStandard11.Specs")] \ No newline at end of file diff --git a/src/Polly.sln b/src/Polly.sln index e0871edbbcc..085c5d857ea 100644 --- a/src/Polly.sln +++ b/src/Polly.sln @@ -18,13 +18,9 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Polly.SharedSpecs", "Polly. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Net45.Specs", "Polly.Net45.Specs\Polly.Net45.Specs.csproj", "{5F2BD87D-A7ED-433D-B7E3-F3072D07C1DC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Net40Async", "Polly.Net40Async\Polly.Net40Async.csproj", "{D6A676C2-982D-42D1-AD21-FA53582A1C31}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Net40Async.Specs", "Polly.Net40Async.Specs\Polly.Net40Async.Specs.csproj", "{65062661-9E19-4FC6-859C-8B7811553E13}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.NetStandard11", "Polly.NetStandard11\Polly.NetStandard11.csproj", "{5017174E-DAC5-4408-AB15-1F902F40C612}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Polly.NetStandard11.Specs", "Polly.NetStandard11.Specs\Polly.NetStandard11.Specs.csproj", "{615C92EC-5921-40F4-A690-C66B1587C08E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.NetStandard11.Specs", "Polly.NetStandard11.Specs\Polly.NetStandard11.Specs.csproj", "{615C92EC-5921-40F4-A690-C66B1587C08E}" EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution @@ -32,9 +28,7 @@ Global Polly.Shared\Polly.Shared.projitems*{29265540-f724-4324-9321-643a0fcb133f}*SharedItemsImports = 4 Polly.Shared\Polly.Shared.projitems*{5017174e-dac5-4408-ab15-1f902f40c612}*SharedItemsImports = 4 Polly.SharedSpecs\Polly.SharedSpecs.projitems*{5f2bd87d-a7ed-433d-b7e3-f3072d07c1dc}*SharedItemsImports = 4 - Polly.SharedSpecs\Polly.SharedSpecs.projitems*{65062661-9e19-4fc6-859c-8b7811553e13}*SharedItemsImports = 4 Polly.SharedSpecs\Polly.SharedSpecs.projitems*{8d537c37-a4a2-4be1-84bc-34f1afb51ca8}*SharedItemsImports = 13 - Polly.Shared\Polly.Shared.projitems*{d6a676c2-982d-42d1-ad21-fa53582a1c31}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -49,14 +43,6 @@ Global {5F2BD87D-A7ED-433D-B7E3-F3072D07C1DC}.Debug|Any CPU.Build.0 = Debug|Any CPU {5F2BD87D-A7ED-433D-B7E3-F3072D07C1DC}.Release|Any CPU.ActiveCfg = Release|Any CPU {5F2BD87D-A7ED-433D-B7E3-F3072D07C1DC}.Release|Any CPU.Build.0 = Release|Any CPU - {D6A676C2-982D-42D1-AD21-FA53582A1C31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D6A676C2-982D-42D1-AD21-FA53582A1C31}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D6A676C2-982D-42D1-AD21-FA53582A1C31}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D6A676C2-982D-42D1-AD21-FA53582A1C31}.Release|Any CPU.Build.0 = Release|Any CPU - {65062661-9E19-4FC6-859C-8B7811553E13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65062661-9E19-4FC6-859C-8B7811553E13}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65062661-9E19-4FC6-859C-8B7811553E13}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65062661-9E19-4FC6-859C-8B7811553E13}.Release|Any CPU.Build.0 = Release|Any CPU {5017174E-DAC5-4408-AB15-1F902F40C612}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5017174E-DAC5-4408-AB15-1F902F40C612}.Debug|Any CPU.Build.0 = Debug|Any CPU {5017174E-DAC5-4408-AB15-1F902F40C612}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -69,4 +55,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2E5D54CD-770A-4345-B585-1848FC2EA6F4} + EndGlobalSection EndGlobal From 5dfcf21c6411f3acbf4beecd8234756d32770f8d Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 07:47:40 +0100 Subject: [PATCH 02/12] Remove Net45 target Support for .NET Framework will henceforth be via NetStandard targets --- build.cake | 11 ----- .../Polly.Net45.Specs.csproj | 44 ------------------- .../Properties/AssemblyInfo.cs | 5 --- src/Polly.Net45/Polly.Net45.csproj | 28 ------------ src/Polly.Net45/Properties/AssemblyInfo.cs | 8 ---- src/Polly.sln | 14 ------ 6 files changed, 110 deletions(-) delete mode 100644 src/Polly.Net45.Specs/Polly.Net45.Specs.csproj delete mode 100644 src/Polly.Net45.Specs/Properties/AssemblyInfo.cs delete mode 100644 src/Polly.Net45/Polly.Net45.csproj delete mode 100644 src/Polly.Net45/Properties/AssemblyInfo.cs diff --git a/build.cake b/build.cake index 6ff9142c236..9259a0ef7ed 100644 --- a/build.cake +++ b/build.cake @@ -44,7 +44,6 @@ var nupkgDestDir = artifactsDir + Directory("nuget-package"); var snkFile = srcDir + File(keyName); var projectToNugetFolderMap = new Dictionary() { - { "Net45" , new [] {"net45"} }, { "NetStandard11", new [] {"netstandard1.1"} }, }; @@ -172,15 +171,6 @@ Task("__BuildSolutions") Task("__RunTests") .Does(() => -{ - XUnit2("./src/**/bin/" + configuration + "/**/*.Net4*.Specs.dll", new XUnit2Settings { - OutputDirectory = testResultsDir, - XmlReportV1 = true - }); -}); - -Task("__RunDotnetTests") - .Does(() => { DotNetCoreTest("./src/Polly.NetStandard11.Specs/Polly.NetStandard11.Specs.csproj", new DotNetCoreTestSettings { Configuration = configuration, @@ -269,7 +259,6 @@ Task("Build") .IsDependentOn("__UpdateAppVeyorBuildNumber") .IsDependentOn("__BuildSolutions") .IsDependentOn("__RunTests") - .IsDependentOn("__RunDotnetTests") .IsDependentOn("__CopyOutputToNugetFolder") .IsDependentOn("__CreateNugetPackage") .IsDependentOn("__StronglySignAssemblies") diff --git a/src/Polly.Net45.Specs/Polly.Net45.Specs.csproj b/src/Polly.Net45.Specs/Polly.Net45.Specs.csproj deleted file mode 100644 index 52745ff6960..00000000000 --- a/src/Polly.Net45.Specs/Polly.Net45.Specs.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - false - net45 - Library - - - full - TRACE;DEBUG;NET45 - - - pdbonly - true - TRACE;RELEASE;NET45 - - - - - - - - - - - - - - - - - - - - Properties\GlobalAssemblyInfo.cs - - - - - - - - - - \ No newline at end of file diff --git a/src/Polly.Net45.Specs/Properties/AssemblyInfo.cs b/src/Polly.Net45.Specs/Properties/AssemblyInfo.cs deleted file mode 100644 index c35c2d67142..00000000000 --- a/src/Polly.Net45.Specs/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System.Reflection; -using Xunit; - -[assembly: AssemblyTitle("Polly.Net45.Specs")] -[assembly: CollectionBehavior(DisableTestParallelization = false)] \ No newline at end of file diff --git a/src/Polly.Net45/Polly.Net45.csproj b/src/Polly.Net45/Polly.Net45.csproj deleted file mode 100644 index f09c8a0b4a8..00000000000 --- a/src/Polly.Net45/Polly.Net45.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - Polly - - false - true - Polly - false - net45 - true - - - full - TRACE;DEBUG;NET45 - - - pdbonly - TRACE;RELEASE;NET45 - - - - Properties\GlobalAssemblyInfo.cs - - - - - - \ No newline at end of file diff --git a/src/Polly.Net45/Properties/AssemblyInfo.cs b/src/Polly.Net45/Properties/AssemblyInfo.cs deleted file mode 100644 index a0b91bffb23..00000000000 --- a/src/Polly.Net45/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyTitle("Polly")] -[assembly: CLSCompliant(true)] - -[assembly: InternalsVisibleTo("Polly.Net45.Specs")] \ No newline at end of file diff --git a/src/Polly.sln b/src/Polly.sln index 085c5d857ea..66a5485f9e0 100644 --- a/src/Polly.sln +++ b/src/Polly.sln @@ -12,12 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Polly.Shared", "Polly.Shared\Polly.Shared.shproj", "{23FA87F9-C77D-4C67-A0B0-2901DE51B3FF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Net45", "Polly.Net45\Polly.Net45.csproj", "{29265540-F724-4324-9321-643A0FCB133F}" -EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Polly.SharedSpecs", "Polly.SharedSpecs\Polly.SharedSpecs.shproj", "{8D537C37-A4A2-4BE1-84BC-34F1AFB51CA8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Net45.Specs", "Polly.Net45.Specs\Polly.Net45.Specs.csproj", "{5F2BD87D-A7ED-433D-B7E3-F3072D07C1DC}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.NetStandard11", "Polly.NetStandard11\Polly.NetStandard11.csproj", "{5017174E-DAC5-4408-AB15-1F902F40C612}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.NetStandard11.Specs", "Polly.NetStandard11.Specs\Polly.NetStandard11.Specs.csproj", "{615C92EC-5921-40F4-A690-C66B1587C08E}" @@ -25,9 +21,7 @@ EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Polly.Shared\Polly.Shared.projitems*{23fa87f9-c77d-4c67-a0b0-2901de51b3ff}*SharedItemsImports = 13 - Polly.Shared\Polly.Shared.projitems*{29265540-f724-4324-9321-643a0fcb133f}*SharedItemsImports = 4 Polly.Shared\Polly.Shared.projitems*{5017174e-dac5-4408-ab15-1f902f40c612}*SharedItemsImports = 4 - Polly.SharedSpecs\Polly.SharedSpecs.projitems*{5f2bd87d-a7ed-433d-b7e3-f3072d07c1dc}*SharedItemsImports = 4 Polly.SharedSpecs\Polly.SharedSpecs.projitems*{8d537c37-a4a2-4be1-84bc-34f1afb51ca8}*SharedItemsImports = 13 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -35,14 +29,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {29265540-F724-4324-9321-643A0FCB133F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {29265540-F724-4324-9321-643A0FCB133F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {29265540-F724-4324-9321-643A0FCB133F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {29265540-F724-4324-9321-643A0FCB133F}.Release|Any CPU.Build.0 = Release|Any CPU - {5F2BD87D-A7ED-433D-B7E3-F3072D07C1DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F2BD87D-A7ED-433D-B7E3-F3072D07C1DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F2BD87D-A7ED-433D-B7E3-F3072D07C1DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F2BD87D-A7ED-433D-B7E3-F3072D07C1DC}.Release|Any CPU.Build.0 = Release|Any CPU {5017174E-DAC5-4408-AB15-1F902F40C612}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5017174E-DAC5-4408-AB15-1F902F40C612}.Debug|Any CPU.Build.0 = Debug|Any CPU {5017174E-DAC5-4408-AB15-1F902F40C612}.Release|Any CPU.ActiveCfg = Release|Any CPU From 29adddebcca5149e6bd6669beae40c090b9d8376 Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 08:11:09 +0100 Subject: [PATCH 03/12] Create only a Strong-named package Create only a package with a strong-named DLL. Name that package without -Signed. --- build.cake | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/build.cake b/build.cake index 9259a0ef7ed..5dcde6f18ec 100644 --- a/build.cake +++ b/build.cake @@ -195,24 +195,6 @@ Task("__CopyOutputToNugetFolder") CopyFile(nuspecSrcFile, nuspecDestFile); }); -Task("__CreateNugetPackage") - .Does(() => -{ - var nugetVersion = gitVersionOutput["NuGetVersion"].ToString(); - var packageName = projectName; - - Information("Building {0}.{1}.nupkg", packageName, nugetVersion); - - var nuGetPackSettings = new NuGetPackSettings { - Id = packageName, - Title = packageName, - Version = nugetVersion, - OutputDirectory = nupkgDestDir - }; - - NuGetPack(nuspecDestFile, nuGetPackSettings); -}); - Task("__StronglySignAssemblies") .Does(() => { @@ -233,7 +215,7 @@ Task("__CreateSignedNugetPackage") .Does(() => { var nugetVersion = gitVersionOutput["NuGetVersion"].ToString(); - var packageName = projectName + "-Signed"; + var packageName = projectName; Information("Building {0}.{1}.nupkg", packageName, nugetVersion); @@ -260,7 +242,6 @@ Task("Build") .IsDependentOn("__BuildSolutions") .IsDependentOn("__RunTests") .IsDependentOn("__CopyOutputToNugetFolder") - .IsDependentOn("__CreateNugetPackage") .IsDependentOn("__StronglySignAssemblies") .IsDependentOn("__CreateSignedNugetPackage"); From 72df90d61112daf931beddbeabb8850ca059567a Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 13:14:28 +0100 Subject: [PATCH 04/12] Adopt new versioning strategy Adopt new package and DLL versioning strategy, See #442. Nuget packages will be full semver-numbered. AssemblyFileVersion and AssemblyInformationVersion attributes will be full semver-numbered. AssemblyVersion attribute will by Major.0.0.0 numbered. --- build.cake | 64 +++++++++++++++---- .../Properties/AssemblyInfo.cs | 4 +- 2 files changed, 53 insertions(+), 15 deletions(-) diff --git a/build.cake b/build.cake index 5dcde6f18ec..140260594d6 100644 --- a/build.cake +++ b/build.cake @@ -51,6 +51,12 @@ var projectToNugetFolderMap = new Dictionary() { var gitVersionPath = ToolsExePath("GitVersion.exe"); Dictionary gitVersionOutput; +// Versioning +string nugetVersion; +string appveyorBuildNumber; +string assemblyVersion; +string assemblySemver; + // StrongNameSigner var strongNameSignerPath = ToolsExePath("StrongNameSigner.Console.exe"); @@ -125,31 +131,62 @@ Task("__UpdateAssemblyVersionInformation") gitVersionOutput = new JsonParser().Parse>(output); Information("Updated GlobalAssemblyInfo"); - Information("AssemblyVersion -> {0}", gitVersionOutput["AssemblySemVer"]); - Information("AssemblyFileVersion -> {0}", gitVersionOutput["MajorMinorPatch"]); - Information("AssemblyInformationalVersion -> {0}", gitVersionOutput["InformationalVersion"]); + + Information(""); + Information("Obtained raw version info for package versioning:"); + Information("NuGetVersion -> {0}", gitVersionOutput["NuGetVersion"]); + Information("FullSemVer -> {0}", gitVersionOutput["FullSemVer"]); + Information("AssemblySemVer -> {0}", gitVersionOutput["AssemblySemVer"]); + + appveyorBuildNumber = gitVersionOutput["FullSemVer"].ToString(); + nugetVersion = gitVersionOutput["NuGetVersion"].ToString(); + assemblyVersion = gitVersionOutput["Major"].ToString() + ".0.0.0"; + assemblySemver = gitVersionOutput["AssemblySemVer"].ToString(); + + Information(""); + Information("Mapping versioning information to:"); + Information("Appveyor build number -> {0}", appveyorBuildNumber); + Information("Nuget package version -> {0}", nugetVersion); + Information("AssemblyVersion -> {0}", assemblyVersion); + Information("AssemblyFileVersion -> {0}", assemblySemver); + Information("AssemblyInformationalVersion -> {0}", assemblySemver); }); Task("__UpdateDotNetStandardAssemblyVersionNumber") .Does(() => { - // NOTE: TEMPORARY fix only, while GitVersionTask does not support .Net Standard assemblies. See https://github.com/App-vNext/Polly/issues/176. - // This build Task can be removed when GitVersionTask supports .Net Standard assemblies. - var assemblySemVer = gitVersionOutput["AssemblySemVer"].ToString(); - Information("Updating NetStandard1.1 AssemblyVersion to {0}", assemblySemVer); - var replacedFiles = ReplaceRegexInFiles("./src/Polly.NetStandard11/Properties/AssemblyInfo.cs", "AssemblyVersion[(]\".*\"[)]", "AssemblyVersion(\"" + assemblySemVer +"\")"); - if (!replacedFiles.Any()) - { - Information("NetStandard1.1 AssemblyVersion could not be updated."); + Information("Updating Assembly Version Information"); + + var attributeToValueMap = new Dictionary() { + { "AssemblyVersion", assemblyVersion }, + { "AssemblyFileVersion", assemblySemver }, + { "AssemblyInformationalVersion", assemblySemver }, + }; + + var assemblyInfosToUpdate = GetFiles("./src/**/Properties/AssemblyInfo.cs") + .Select(f => f.FullPath) + .Where(f => !f.Contains("Specs")); + + foreach(var attributeMap in attributeToValueMap) { + var attribute = attributeMap.Key; + var value = attributeMap.Value; + + foreach(var assemblyInfo in assemblyInfosToUpdate) { + var replacedFiles = ReplaceRegexInFiles(assemblyInfo, attribute + "[(]\".*\"[)]", attribute + "(\"" + value +"\")"); + if (!replacedFiles.Any()) + { + throw new Exception($"{attribute} attribute could not be updated in {assemblyInfo}."); + } + } } + }); Task("__UpdateAppVeyorBuildNumber") .WithCriteria(() => AppVeyor.IsRunningOnAppVeyor) .Does(() => { - var fullSemVer = gitVersionOutput["FullSemVer"].ToString(); - AppVeyor.UpdateBuildVersion(fullSemVer); + AppVeyor.UpdateBuildVersion(appveyorBuildNumber); }); Task("__BuildSolutions") @@ -214,7 +251,6 @@ Task("__StronglySignAssemblies") Task("__CreateSignedNugetPackage") .Does(() => { - var nugetVersion = gitVersionOutput["NuGetVersion"].ToString(); var packageName = projectName; Information("Building {0}.{1}.nupkg", packageName, nugetVersion); diff --git a/src/Polly.NetStandard11/Properties/AssemblyInfo.cs b/src/Polly.NetStandard11/Properties/AssemblyInfo.cs index 550fd1c1006..c2e61c00b3f 100644 --- a/src/Polly.NetStandard11/Properties/AssemblyInfo.cs +++ b/src/Polly.NetStandard11/Properties/AssemblyInfo.cs @@ -3,7 +3,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly")] -[assembly: AssemblyVersion("5.9.1.0")] +[assembly: AssemblyInformationalVersion("5.9.1.0")] +[assembly: AssemblyFileVersion("5.9.1.0")] +[assembly: AssemblyVersion("5.0.0.0")] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("Polly.NetStandard11.Specs")] \ No newline at end of file From f4404005b5c1e4965b74b3fe01a6b4ec0642f97a Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 13:31:46 +0100 Subject: [PATCH 05/12] Remove deprecated overloads and properties --- src/Polly.Shared/Context.cs | 14 - src/Polly.Shared/Fallback/FallbackSyntax.cs | 74 +- .../Fallback/FallbackSyntaxAsync.cs | 40 +- .../Policy.Async.ExecuteOverloads.cs | 641 +----------------- .../Policy.Async.TResult.ExecuteOverloads.cs | 319 +-------- src/Polly.Shared/Policy.ExecuteOverloads.cs | 234 ------- .../Policy.TResult.ExecuteOverloads.cs | 122 +--- .../Fallback/FallbackTResultAsyncSpecs.cs | 2 +- .../ContextualPolicyTResultExtensionsAsync.cs | 2 +- 9 files changed, 12 insertions(+), 1436 deletions(-) diff --git a/src/Polly.Shared/Context.cs b/src/Polly.Shared/Context.cs index c114340f2e7..03393914453 100644 --- a/src/Polly.Shared/Context.cs +++ b/src/Polly.Shared/Context.cs @@ -39,13 +39,6 @@ public Context() /// public String PolicyKey { get; internal set; } - /// - /// A key unique to the call site of the current execution. - /// The value is set by using the constructor taking an operationKey parameter. - /// - [Obsolete("This property is being renamed OperationKey, from Polly v6.")] - public String ExecutionKey => OperationKey; - /// /// A key unique to the call site of the current execution. /// instances are commonly reused across multiple call sites. Set an OperationKey so that logging and metrics can distinguish usages of policy instances at different call sites. @@ -53,13 +46,6 @@ public Context() /// public String OperationKey { get; } - /// - /// A Guid guaranteed to be unique to each execution. - /// Acts as a correlation id so that events specific to a single execution can be identified in logging and telemetry. - /// - [Obsolete("This property is being renamed CorrelationId, from Polly v6.")] - public Guid ExecutionGuid => CorrelationId; - /// /// A Guid guaranteed to be unique to each execution. /// Acts as a correlation id so that events specific to a single execution can be identified in logging and telemetry. diff --git a/src/Polly.Shared/Fallback/FallbackSyntax.cs b/src/Polly.Shared/Fallback/FallbackSyntax.cs index 82943dbee91..9e15f3ea905 100644 --- a/src/Polly.Shared/Fallback/FallbackSyntax.cs +++ b/src/Polly.Shared/Fallback/FallbackSyntax.cs @@ -75,24 +75,6 @@ public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action fallbackAction(ct), (exception, ctx) => onFallback(exception)); } - /// - /// Builds a which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, first calls with details of the handled exception and the execution context; then calls . - /// - /// The policy builder. - /// The fallback action. - /// The action to call before invoking the fallback delegate. - /// fallbackAction - /// onFallback - /// The policy instance. - [Obsolete("This overload is deprecated and will be removed in a future release. Prefer the overload in which both fallbackAction and onFallback take a Context input parameter.")] - public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action fallbackAction, Action onFallback) - { - if (fallbackAction == null) throw new ArgumentNullException(nameof(fallbackAction)); - if (onFallback == null) throw new ArgumentNullException(nameof(onFallback)); - - return policyBuilder.Fallback((outcome, ctx, ct) => fallbackAction(), onFallback); - } - /// /// Builds a which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, first calls with details of the handled exception and the execution context; then calls . /// @@ -109,25 +91,7 @@ public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action fallbackAction(ctx), onFallback); } - - /// - /// Builds a which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, first calls with details of the handled exception and the execution context; then calls . - /// - /// The policy builder. - /// The fallback action. - /// The action to call before invoking the fallback delegate. - /// fallbackAction - /// onFallback - /// The policy instance. - [Obsolete("This overload is deprecated and will be removed in a future release. Prefer the overload in which both fallbackAction and onFallback take a Context input parameter.")] - public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Action fallbackAction, Action onFallback) - { - if (fallbackAction == null) throw new ArgumentNullException(nameof(fallbackAction)); - if (onFallback == null) throw new ArgumentNullException(nameof(onFallback)); - - return policyBuilder.Fallback((outcome, ctx, ct) => fallbackAction(ct), onFallback); - } - + /// /// Builds a which provides a fallback action if the main execution fails. Executes the main delegate, but if this throws a handled exception, first calls with details of the handled exception and the execution context; then calls . /// @@ -283,24 +247,6 @@ public static FallbackPolicy Fallback(this PolicyBuilder fallbackValue, onFallback); } - /// - /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result and the execution context; then calls and returns its result. - /// - /// The policy builder. - /// The fallback action. - /// The action to call before invoking the fallback delegate. - /// fallbackAction - /// onFallback - /// The policy instance. - [Obsolete("This overload is deprecated and will be removed in a future release. Prefer the overload in which both fallbackAction and onFallback take a Context input parameter.")] - public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Func fallbackAction, Action, Context> onFallback) - { - if (fallbackAction == null) throw new ArgumentNullException(nameof(fallbackAction)); - if (onFallback == null) throw new ArgumentNullException(nameof(onFallback)); - - return policyBuilder.Fallback((outcome, ctx, ct) => fallbackAction(), onFallback); - } - /// /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result and the execution context; then calls and returns its result. /// @@ -318,24 +264,6 @@ public static FallbackPolicy Fallback(this PolicyBuilder fallbackAction(ctx), onFallback); } - /// - /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result and the execution context; then calls and returns its result. - /// - /// The policy builder. - /// The fallback action. - /// The action to call before invoking the fallback delegate. - /// fallbackAction - /// onFallback - /// The policy instance. - [Obsolete("This overload is deprecated and will be removed in a future release. Prefer the overload in which both fallbackAction and onFallback take a Context input parameter.")] - public static FallbackPolicy Fallback(this PolicyBuilder policyBuilder, Func fallbackAction, Action, Context> onFallback) - { - if (fallbackAction == null) throw new ArgumentNullException(nameof(fallbackAction)); - if (onFallback == null) throw new ArgumentNullException(nameof(onFallback)); - - return policyBuilder.Fallback((outcome, ctx, ct) => fallbackAction(ct), onFallback); - } - /// /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls with details of the handled exception or result and the execution context; then calls and returns its result. /// diff --git a/src/Polly.Shared/Fallback/FallbackSyntaxAsync.cs b/src/Polly.Shared/Fallback/FallbackSyntaxAsync.cs index 1de7ee06f03..9663fd59bec 100644 --- a/src/Polly.Shared/Fallback/FallbackSyntaxAsync.cs +++ b/src/Polly.Shared/Fallback/FallbackSyntaxAsync.cs @@ -48,25 +48,7 @@ public static FallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Fun (outcome, context) => onFallbackAsync(outcome) ); } - - /// - /// Builds a which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, first asynchronously calls with details of the handled exception and execution context; then asynchronously calls . - /// - /// The policy builder. - /// The fallback delegate. - /// The action to call asynchronously before invoking the fallback delegate. - /// fallbackAction - /// onFallbackAsync - /// The policy instance. - [Obsolete("This overload is deprecated and will be removed in a future release. Prefer the overload in which both fallbackAction and onFallbackAsync take a Context input parameter.")] - public static FallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func fallbackAction, Func onFallbackAsync) - { - if (fallbackAction == null) throw new ArgumentNullException(nameof(fallbackAction)); - if (onFallbackAsync == null) throw new ArgumentNullException(nameof(onFallbackAsync)); - - return policyBuilder.FallbackAsync((outcome, ctx, ct) => fallbackAction(ct), onFallbackAsync); - } - + /// /// Builds a which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, first asynchronously calls with details of the handled exception and execution context; then asynchronously calls . /// @@ -205,25 +187,7 @@ public static FallbackPolicy FallbackAsync(this PolicyBuilder< onFallbackAsync ); } - - /// - /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception or raises a handled result, first asynchronously calls with details of the handled exception or result and the execution context; then asynchronously calls and returns its result. - /// - /// The policy builder. - /// The fallback delegate. - /// The action to call asynchronously before invoking the fallback delegate. - /// fallbackAction - /// onFallbackAsync - /// The policy instance. - [Obsolete("This overload is deprecated and will be removed in a future release. Prefer the overload in which both fallbackAction and onFallbackAsync take a Context input parameter.")] - public static FallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func> fallbackAction, Func, Context, Task> onFallbackAsync) - { - if (fallbackAction == null) throw new ArgumentNullException(nameof(fallbackAction)); - if (onFallbackAsync == null) throw new ArgumentNullException(nameof(onFallbackAsync)); - - return policyBuilder.FallbackAsync((outcome, ctx, ct) => fallbackAction(ct), onFallbackAsync); - } - + /// /// Builds a which provides a fallback value if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception or raises a handled result, first asynchronously calls with details of the handled exception or result and the execution context; then asynchronously calls and returns its result. /// diff --git a/src/Polly.Shared/Policy.Async.ExecuteOverloads.cs b/src/Polly.Shared/Policy.Async.ExecuteOverloads.cs index 66c73e1f17b..32f04cdd891 100644 --- a/src/Polly.Shared/Policy.Async.ExecuteOverloads.cs +++ b/src/Polly.Shared/Policy.Async.ExecuteOverloads.cs @@ -21,30 +21,6 @@ public Task ExecuteAsync(Func action) return ExecuteAsync((ctx, ct) => action(), new Context(), DefaultCancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, IDictionary contextData) - { - return ExecuteAsync((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, Context context) - { - return ExecuteAsync((ctx, ct) => action(), context, DefaultCancellationToken, DefaultContinueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy. /// @@ -67,70 +43,6 @@ public Task ExecuteAsync(Func action, Context context) return ExecuteAsync((ctx, ct) => action(ctx), context, DefaultCancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Whether to continue on a captured synchronization context. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(), new Context(), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, Context context, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(), context, DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ctx), new Context(contextData), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, Context context, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ctx), context, DefaultCancellationToken, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy. /// @@ -142,32 +54,6 @@ public Task ExecuteAsync(Func action, CancellationToken return ExecuteAsync((ctx, ct) => action(ct), new Context(), cancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, IDictionary contextData, CancellationToken cancellationToken) - { - return ExecuteAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, Context context, CancellationToken cancellationToken) - { - return ExecuteAsync((ctx, ct) => action(ct), context, cancellationToken, DefaultContinueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy. /// @@ -204,37 +90,7 @@ public Task ExecuteAsync(Func action, CancellationToken { return ExecuteAsync((ctx, ct) => action(ct), new Context(), cancellationToken, continueOnCapturedContext); } - - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// Whether to continue on a captured synchronization context. - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, IDictionary contextData, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ct), context, cancellationToken, continueOnCapturedContext); - } - + /// /// Executes the specified asynchronous action within the policy. /// @@ -280,33 +136,6 @@ public Task ExecuteAsync(Func> action) return ExecuteAsync((ctx, ct) => action(), new Context(), DefaultCancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData) - { - return ExecuteAsync((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context) - { - return ExecuteAsync((ctx, ct) => action(), context, DefaultCancellationToken, DefaultContinueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -332,78 +161,6 @@ public Task ExecuteAsync(Func> action, return ExecuteAsync((ctx, ct) => action(ctx), context, DefaultCancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(), new Context(), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(), context, DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ctx), new Context(contextData), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ctx), context, DefaultCancellationToken, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -417,35 +174,6 @@ public Task ExecuteAsync(Func return ExecuteAsync((ctx, ct) => action(ct), new Context(), cancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData, CancellationToken cancellationToken) - { - return ExecuteAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context, CancellationToken cancellationToken) - { - return ExecuteAsync((ctx, ct) => action(ct), context, cancellationToken, DefaultContinueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -488,39 +216,6 @@ public Task ExecuteAsync(Func return ExecuteAsync((ctx, ct) => action(ct), new Context(), cancellationToken, continueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries. - /// The value returned by the action - /// Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ct), context, cancellationToken, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -571,34 +266,7 @@ public Task ExecuteAndCaptureAsync(Func action) { return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(), DefaultCancellationToken, DefaultContinueOnCapturedContext); } - - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, IDictionary contextData) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, Context context) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), context, DefaultCancellationToken, DefaultContinueOnCapturedContext); - } - + /// /// Executes the specified asynchronous action within the policy and returns the captured result. /// @@ -624,77 +292,6 @@ public Task ExecuteAndCaptureAsync(Func action, Con return ExecuteAndCaptureAsync((ctx, ct) => action(ctx), context, DefaultCancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Whether to continue on a captured synchronization context. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, Context context, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), context, DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ctx), new Context(contextData), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, Context context, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ctx), context, DefaultCancellationToken, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the captured result. /// @@ -706,34 +303,6 @@ public Task ExecuteAndCaptureAsync(Func a return ExecuteAndCaptureAsync((ctx, ct) => action(ct), new Context(), cancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, IDictionary contextData, CancellationToken cancellationToken) - { - return ExecuteAndCaptureAsync(action, new Context(contextData), cancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, Context context, CancellationToken cancellationToken) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), context, cancellationToken, DefaultContinueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the captured result. /// @@ -772,38 +341,7 @@ public Task ExecuteAndCaptureAsync(Func a { return ExecuteAndCaptureAsync((ctx, ct) => action(ct), new Context(), cancellationToken, continueOnCapturedContext); } - - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// Whether to continue on a captured synchronization context. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, IDictionary contextData, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAndCaptureAsync(Func action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), context, cancellationToken, continueOnCapturedContext); - } - + /// /// Executes the specified asynchronous action within the policy and returns the captured result. /// @@ -860,36 +398,6 @@ public Task> ExecuteAndCaptureAsync(Func action(), new Context(), DefaultCancellationToken, DefaultContinueOnCapturedContext); } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), context, DefaultCancellationToken, DefaultContinueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -917,82 +425,6 @@ public Task> ExecuteAndCaptureAsync(Func action(ctx), context, DefaultCancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Whether to continue on a captured synchronization context. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), context, DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ctx), new Context(contextData), DefaultCancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ctx), context, DefaultCancellationToken, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -1005,38 +437,7 @@ public Task> ExecuteAndCaptureAsync(Func action(ct), new Context(), cancellationToken, DefaultContinueOnCapturedContext); } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData, CancellationToken cancellationToken) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context, CancellationToken cancellationToken) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), context, cancellationToken, DefaultContinueOnCapturedContext); - } - + /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -1081,40 +482,6 @@ public Task> ExecuteAndCaptureAsync(Func action(ct), new Context(), cancellationToken, continueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// The captured result - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// Whether to continue on a captured synchronization context. - /// The captured result - /// Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), context, cancellationToken, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// diff --git a/src/Polly.Shared/Policy.Async.TResult.ExecuteOverloads.cs b/src/Polly.Shared/Policy.Async.TResult.ExecuteOverloads.cs index 9aa8aeed427..3b50b32be34 100644 --- a/src/Polly.Shared/Policy.Async.TResult.ExecuteOverloads.cs +++ b/src/Polly.Shared/Policy.Async.TResult.ExecuteOverloads.cs @@ -23,46 +23,7 @@ public Task ExecuteAsync(Func> action) { return ExecuteAsync((ctx, ct) => action(), new Context(), CancellationToken.None, DefaultContinueOnCapturedContext); } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(), new Context(), CancellationToken.None, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData) - { - return ExecuteAsync((ctx, ct) => action(), new Context(contextData), CancellationToken.None, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context) - { - return ExecuteAsync((ctx, ct) => action(), context, CancellationToken.None, DefaultContinueOnCapturedContext); - } - + /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -87,62 +48,6 @@ public Task ExecuteAsync(Func> action, Context c return ExecuteAsync((ctx, ct) => action(ctx), context, CancellationToken.None, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(), new Context(contextData), CancellationToken.None, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(), context, CancellationToken.None, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ctx), new Context(contextData), CancellationToken.None, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ctx), context, CancellationToken.None, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -169,34 +74,6 @@ public Task ExecuteAsync(Func> action, return ExecuteAsync((ctx, ct) => action(ct), new Context(), cancellationToken, continueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData, CancellationToken cancellationToken) - { - return ExecuteAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context, CancellationToken cancellationToken) - { - return ExecuteAsync((ctx, ct) => action(ct), context, cancellationToken, DefaultContinueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -223,38 +100,6 @@ public Task ExecuteAsync(Func return ExecuteAsync(action, context, cancellationToken, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// Whether to continue on a captured synchronization context. - /// The value returned by the action - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, IDictionary contextData, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries. - /// The value returned by the action - /// Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task ExecuteAsync(Func> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAsync((ctx, ct) => action(ct), context, cancellationToken, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -302,46 +147,7 @@ public Task> ExecuteAndCaptureAsync(Func> ac { return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(), CancellationToken.None, DefaultContinueOnCapturedContext); } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Whether to continue on a captured synchronization context. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(), CancellationToken.None, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// contextData - /// The captured result - [DebuggerStepThrough] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(contextData), CancellationToken.None, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), context, CancellationToken.None, DefaultContinueOnCapturedContext); - } - + /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -367,66 +173,6 @@ public Task> ExecuteAndCaptureAsync(Func action(ctx), context, CancellationToken.None, DefaultContinueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), new Context(contextData), CancellationToken.None, continueOnCapturedContext); - } - - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(), context, CancellationToken.None, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ctx), new Context(contextData), CancellationToken.None, continueOnCapturedContext); - } - - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ctx), context, CancellationToken.None, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -453,35 +199,6 @@ public Task> ExecuteAndCaptureAsync(Func action(ct), new Context(), cancellationToken, continueOnCapturedContext); } - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData, CancellationToken cancellationToken) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, DefaultContinueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context, CancellationToken cancellationToken) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), context, cancellationToken, DefaultContinueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// @@ -509,38 +226,6 @@ public Task> ExecuteAndCaptureAsync(Func - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// The captured result - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, IDictionary contextData, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), new Context(contextData), cancellationToken, continueOnCapturedContext); - } - - /// - /// Executes the specified asynchronous action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// Whether to continue on a captured synchronization context. - /// A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries. - /// The captured result - /// Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public Task> ExecuteAndCaptureAsync(Func> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext) - { - return ExecuteAndCaptureAsync((ctx, ct) => action(ct), context, cancellationToken, continueOnCapturedContext); - } - /// /// Executes the specified asynchronous action within the policy and returns the result. /// diff --git a/src/Polly.Shared/Policy.ExecuteOverloads.cs b/src/Polly.Shared/Policy.ExecuteOverloads.cs index 47a7b524a28..b3422564ce5 100644 --- a/src/Polly.Shared/Policy.ExecuteOverloads.cs +++ b/src/Polly.Shared/Policy.ExecuteOverloads.cs @@ -20,30 +20,6 @@ public void Execute(Action action) Execute((ctx, ct) => action(), new Context(), DefaultCancellationToken); } - /// - /// Executes the specified action within the policy. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public void Execute(Action action, IDictionary contextData) - { - Execute((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken); - } - - /// - /// Executes the specified action within the policy. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public void Execute(Action action, Context context) - { - Execute((ctx, ct) => action(), context, DefaultCancellationToken); - } - /// /// Executes the specified action within the policy. /// @@ -77,33 +53,6 @@ public void Execute(Action action, CancellationToken cancella Execute((ctx, ct) => action(ct), new Context(), cancellationToken); } - /// - /// Executes the specified action within the policy. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// The cancellation token. - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public void Execute(Action action, IDictionary contextData, CancellationToken cancellationToken) - { - Execute((ctx, ct) => action(ct), new Context(contextData), cancellationToken); - } - - /// - /// Executes the specified action within the policy. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The cancellation token. - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public void Execute(Action action, Context context, CancellationToken cancellationToken) - { - Execute((ctx, ct) => action(ct), context, cancellationToken); - } - /// /// Executes the specified action within the policy. /// @@ -147,42 +96,6 @@ public TResult Execute(Func action) return Execute((ctx, ct) => action(), new Context(), DefaultCancellationToken); } - /// - /// Executes the specified action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// contextData - /// - /// The value returned by the action - /// - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public TResult Execute(Func action, IDictionary contextData) - { - return Execute((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken); - } - - /// - /// Executes the specified action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// contextData - /// - /// The value returned by the action - /// - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public TResult Execute(Func action, Context context) - { - return Execute((ctx, ct) => action(), context, DefaultCancellationToken); - } - /// /// Executes the specified action within the policy and returns the result. /// @@ -230,37 +143,6 @@ public TResult Execute(Func action, Cancell return Execute((ctx, ct) => action(ct), new Context(), cancellationToken); } - /// - /// Executes the specified action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// The cancellation token. - /// The value returned by the action - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public TResult Execute(Func action, IDictionary contextData, CancellationToken cancellationToken) - { - return Execute((ctx, ct) => action(ct), new Context(contextData), cancellationToken); - } - - /// - /// Executes the specified action within the policy and returns the result. - /// - /// The type of the result. - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The cancellation token. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public TResult Execute(Func action, Context context, CancellationToken cancellationToken) - { - return Execute((ctx, ct) => action(ct), context, cancellationToken); - } - /// /// Executes the specified action within the policy and returns the result. /// @@ -311,33 +193,6 @@ public PolicyResult ExecuteAndCapture(Action action) return ExecuteAndCapture((ctx, ct) => action(), new Context(), DefaultCancellationToken); } - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Action action, IDictionary contextData) - { - return ExecuteAndCapture((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken); - } - - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Action action, Context context) - { - return ExecuteAndCapture((ctx, ct) => action(), context, DefaultCancellationToken); - } - /// /// Executes the specified action within the policy and returns the captured result. /// @@ -375,35 +230,6 @@ public PolicyResult ExecuteAndCapture(Action action, Cancella return ExecuteAndCapture((ctx, ct) => action(ct), new Context(), cancellationToken); } - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// The cancellation token. - /// The captured result - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Action action, IDictionary contextData, CancellationToken cancellationToken) - { - return ExecuteAndCapture((ctx, ct) => action(ct), new Context(contextData), cancellationToken); - } - - /// - /// Executes the specified action within the policy and returns the captured result - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The cancellation token. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Action action, Context context, CancellationToken cancellationToken) - { - return ExecuteAndCapture((ctx, ct) => action(ct), context, cancellationToken); - } - /// /// Executes the specified action within the policy and returns the captured result. /// @@ -456,35 +282,6 @@ public PolicyResult ExecuteAndCapture(Func action) return ExecuteAndCapture((ctx, ct) => action(), new Context(), DefaultCancellationToken); } - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Func action, IDictionary contextData) - { - return ExecuteAndCapture((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken); - } - - - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Func action, Context context) - { - return ExecuteAndCapture((ctx, ct) => action(), context, DefaultCancellationToken); - } - /// /// Executes the specified action within the policy and returns the captured result. /// @@ -524,37 +321,6 @@ public PolicyResult ExecuteAndCapture(Func action(ct), new Context(), cancellationToken); } - - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The type of the result. - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// The cancellation token. - /// The captured result - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Func action, IDictionary contextData, CancellationToken cancellationToken) - { - return ExecuteAndCapture((ctx, ct) => action(ct), new Context(contextData), cancellationToken); - } - - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The cancellation token. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Func action, Context context, CancellationToken cancellationToken) - { - return ExecuteAndCapture((ctx, ct) => action(ct), context, cancellationToken); - } - /// /// Executes the specified action within the policy and returns the captured result. /// diff --git a/src/Polly.Shared/Policy.TResult.ExecuteOverloads.cs b/src/Polly.Shared/Policy.TResult.ExecuteOverloads.cs index ae1d8600bfd..b97541907a9 100644 --- a/src/Polly.Shared/Policy.TResult.ExecuteOverloads.cs +++ b/src/Polly.Shared/Policy.TResult.ExecuteOverloads.cs @@ -23,40 +23,6 @@ public TResult Execute(Func action) return Execute((ctx, ct) => action(), new Context(), DefaultCancellationToken); } - /// - /// Executes the specified action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// contextData - /// - /// The value returned by the action - /// - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public TResult Execute(Func action, IDictionary contextData) - { - return Execute((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken); - } - - /// - /// Executes the specified action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// context - /// - /// The value returned by the action - /// - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public TResult Execute(Func action, Context context) - { - return Execute((ctx, ct) => action(), context, DefaultCancellationToken); - } - /// /// Executes the specified action within the policy and returns the result. /// @@ -100,36 +66,7 @@ public TResult Execute(Func action, CancellationToke { return Execute((ctx, ct) => action(ct), new Context(), cancellationToken); } - - /// - /// Executes the specified action within the policy and returns the result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// The cancellation token. - /// The value returned by the action - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public TResult Execute(Func action, IDictionary contextData, CancellationToken cancellationToken) - { - return Execute((ctx, ct) => action(ct), new Context(contextData), cancellationToken); - } - - /// - /// Executes the specified action within the policy and returns the result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The cancellation token. - /// The value returned by the action - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public TResult Execute(Func action, Context context, CancellationToken cancellationToken) - { - return Execute((ctx, ct) => action(ct), context, cancellationToken); - } - + /// /// Executes the specified action within the policy and returns the result. /// @@ -175,34 +112,6 @@ public PolicyResult ExecuteAndCapture(Func action) return ExecuteAndCapture((ctx, ct) => action(), new Context(), DefaultCancellationToken); } - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Func action, IDictionary contextData) - { - return ExecuteAndCapture((ctx, ct) => action(), new Context(contextData), DefaultCancellationToken); - } - - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// contextData - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Func action, Context context) - { - return ExecuteAndCapture((ctx, ct) => action(), context, DefaultCancellationToken); - } - /// /// Executes the specified action within the policy and returns the captured result. /// @@ -241,35 +150,6 @@ public PolicyResult ExecuteAndCapture(Func return ExecuteAndCapture((ctx, ct) => action(ct), new Context(), cancellationToken); } - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Arbitrary data that is passed to the exception policy. - /// The cancellation token. - /// The captured result - /// contextData - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Func action, IDictionary contextData, CancellationToken cancellationToken) - { - return ExecuteAndCapture((ctx, ct) => action(ct), new Context(contextData), cancellationToken); - } - - /// - /// Executes the specified action within the policy and returns the captured result. - /// - /// The action to perform. - /// Context data that is passed to the exception policy. - /// The cancellation token. - /// The captured result - [DebuggerStepThrough] - [Obsolete("This overload is deprecated and scheduled for removal in Polly v6.")] - public PolicyResult ExecuteAndCapture(Func action, Context context, CancellationToken cancellationToken) - { - return ExecuteAndCapture((ctx, ct) => action(ct), context, cancellationToken); - } - /// /// Executes the specified action within the policy and returns the captured result. /// diff --git a/src/Polly.SharedSpecs/Fallback/FallbackTResultAsyncSpecs.cs b/src/Polly.SharedSpecs/Fallback/FallbackTResultAsyncSpecs.cs index 4e6ce50eff7..3be79356b05 100644 --- a/src/Polly.SharedSpecs/Fallback/FallbackTResultAsyncSpecs.cs +++ b/src/Polly.SharedSpecs/Fallback/FallbackTResultAsyncSpecs.cs @@ -378,7 +378,7 @@ public async Task Should_call_onFallback_with_the_passed_context_when_execute_an .HandleResult(ResultPrimitive.Fault) .FallbackAsync(fallbackAction, onFallbackAsync); - (await fallbackPolicy.ExecuteAndCaptureAsync(() => { return Task.FromResult(ResultPrimitive.Fault); }, + (await fallbackPolicy.ExecuteAndCaptureAsync(ctx => { return Task.FromResult(ResultPrimitive.Fault); }, new { key1 = "value1", key2 = "value2" }.AsDictionary()).ConfigureAwait(false)) .Result.Should().Be(ResultPrimitive.Substitute); diff --git a/src/Polly.SharedSpecs/Helpers/ContextualPolicyTResultExtensionsAsync.cs b/src/Polly.SharedSpecs/Helpers/ContextualPolicyTResultExtensionsAsync.cs index 3611d7d36d9..1f6b0282c99 100644 --- a/src/Polly.SharedSpecs/Helpers/ContextualPolicyTResultExtensionsAsync.cs +++ b/src/Polly.SharedSpecs/Helpers/ContextualPolicyTResultExtensionsAsync.cs @@ -41,7 +41,7 @@ public static Task> RaiseResultSequenceOnExecuteAndCapture { var enumerator = resultsToRaise.GetEnumerator(); - return policy.ExecuteAndCaptureAsync(() => + return policy.ExecuteAndCaptureAsync(ctx => { if (!enumerator.MoveNext()) { From e42204eac8714bf23d26e688021a7a56455f4f34 Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 13:46:59 +0100 Subject: [PATCH 06/12] Add v6.0.0-v6alpha doco --- CHANGELOG.md | 6 ++++++ GitVersionConfig.yaml | 2 +- README.md | 7 ++++++- src/Polly.NetStandard11/Properties/AssemblyInfo.cs | 6 +++--- src/Polly.nuspec | 7 ++++++- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9b76177854..c3e68335294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 6.0.0-v6alpha +- Publish as strong-named package only (discontinue non-strong-named versions) +- Provide .NET4.5 support via .NetStandard 1.1 tfm +- Discontinue .NET4.0 support +- Remove methods marked as deprecated in v5.9.0 + ## 5.9.0 - Allow Timeout.InfiniteTimeSpan (no timeout) for TimeoutPolicy. - Add .AsPolicy<TResult> and .AsAsyncPolicy<TResult> methods for converting non-generic policies to generic policies. diff --git a/GitVersionConfig.yaml b/GitVersionConfig.yaml index a98198e3a33..e164313d5bb 100644 --- a/GitVersionConfig.yaml +++ b/GitVersionConfig.yaml @@ -1 +1 @@ -next-version: 5.9.0 \ No newline at end of file +next-version: 6.0.0 \ No newline at end of file diff --git a/README.md b/README.md index be7cffd50fd..a52dcfe413f 100644 --- a/README.md +++ b/README.md @@ -916,10 +916,15 @@ This allows collections of similar kinds of policy to be treated as one - for ex For more detail see: [Polly and interfaces](https://github.com/App-vNext/Polly/wiki/Polly-and-interfaces) on wiki. +# .NET4.5 support + +From Polly v6.0.0, .NET4.5 support is provided [via the .Net Standard 1.1 target](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support). + +Polly versions up to [v5.9.0](https://www.nuget.org/packages/Polly/5.9.0) have direct target support for .NET 4.5. # .NET4.0 support -The .NET4.0 package uses `Microsoft.Bcl.Async` to add async support. To minimise dependencies on the main Polly nuget package, the .NET4.0 version is available as separate Nuget packages `Polly.Net40Async` and `Polly.Net40Async-signed`. +The last version of Polly to support .NET4.0 is [v5.9.0](https://www.nuget.org/packages/Polly.Net40Async/5.9.0). The .NET4.0 package uses `Microsoft.Bcl.Async` to add async support. To minimise dependencies on the main Polly nuget package, the .NET4.0 version is available as separate Nuget packages `Polly.Net40Async` and `Polly.Net40Async-signed`. # .NET3.5 support diff --git a/src/Polly.NetStandard11/Properties/AssemblyInfo.cs b/src/Polly.NetStandard11/Properties/AssemblyInfo.cs index c2e61c00b3f..30fb9872933 100644 --- a/src/Polly.NetStandard11/Properties/AssemblyInfo.cs +++ b/src/Polly.NetStandard11/Properties/AssemblyInfo.cs @@ -3,9 +3,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly")] -[assembly: AssemblyInformationalVersion("5.9.1.0")] -[assembly: AssemblyFileVersion("5.9.1.0")] -[assembly: AssemblyVersion("5.0.0.0")] +[assembly: AssemblyInformationalVersion("6.0.0.0")] +[assembly: AssemblyFileVersion("6.0.0.0")] +[assembly: AssemblyVersion("6.0.0.0")] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("Polly.NetStandard11.Specs")] \ No newline at end of file diff --git a/src/Polly.nuspec b/src/Polly.nuspec index 4d2ddfbd967..c230adcea09 100644 --- a/src/Polly.nuspec +++ b/src/Polly.nuspec @@ -13,7 +13,12 @@ Exception Handling Resilience Transient Fault Policy Circuit Breaker CircuitBreaker Retry Wait Cache Cache-aside Bulkhead Fallback Timeout Throttle Parallelization Copyright © 2018, App vNext - v5.0 is a major release with significant new resilience policies: Timeout; Bulkhead Isolation; Fallback; Cache; and PolicyWrap. See release notes back to v5.0.0 for full details. + 6.0.0-v6alpha + --------------------- + - Publish as strong-named package only (discontinue non-strong-named versions) + - Provide .NET4.5 support via .NetStandard 1.1 tfm + - Discontinue .NET4.0 support + - Remove methods marked as deprecated in v5.9.0 5.9.0 --------------------- From 7ae5e8122ebe40299798dbd691135b616c789489 Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 17:01:12 +0100 Subject: [PATCH 07/12] Remove Net4.0 nuspec --- src/Polly.Net40Async.nuspec | 156 ------------------------------------ 1 file changed, 156 deletions(-) delete mode 100644 src/Polly.Net40Async.nuspec diff --git a/src/Polly.Net40Async.nuspec b/src/Polly.Net40Async.nuspec deleted file mode 100644 index 80a48603dd5..00000000000 --- a/src/Polly.Net40Async.nuspec +++ /dev/null @@ -1,156 +0,0 @@ - - - - App vNext - Michael Wolfenden, App vNext - - Polly.Net40Async is a version of the Polly library for .NET 4.0 with async support via Microsoft.Bcl.Async. Polly allows developers to express resilience policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. - - en-US - https://raw.github.com/App-vNext/Polly/master/LICENSE.txt - https://raw.github.com/App-vNext/Polly/master/Polly.png - https://github.com/App-vNext/Polly - Exception Handling Resilience Transient Fault Policy Circuit Breaker CircuitBreaker Retry Wait Cache Cache-aside Bulkhead Fallback Timeout Throttle Parallelization - Copyright © 2018, App vNext - - v5.0 is a major release with significant new resilience policies: Timeout; Bulkhead Isolation; Fallback; Cache; and PolicyWrap. See release notes back to v5.0.0 for full details. - - 5.9.0 - --------------------- - - Allow Timeout.InfiniteTimeSpan (no timeout) for TimeoutPolicy. - - Add .AsPolicy<TResult> and .AsAsyncPolicy<TResult> methods for converting non-generic policies to generic policies. - - Per Semver, indicates deprecation of overloads and properties intended to be removed or renamed in Polly v6. - - 5.8.0 - --------------------- - - Add a new onBreak overload that provides the prior state on a transition to an open state - - Bug fix: RelativeTtl in CachePolicy now always returns a ttl relative to time item is cached - - 5.7.0 - --------------------- - - Minor cache fixes - - Add ability to calculate cache Ttl based on item to cache - - Allow user-created custom policies - - 5.6.1 - --------------------- - - Extend PolicyWrap syntax with interfaces - - 5.6.0 - --------------------- - - Add ability to handle inner exceptions natively: .HandleInner<TEx>() - - Allow WaitAndRetry policies to calculate wait based on the handled fault - - Add the ability to access the policies within an IPolicyWrap - - Allow PolicyWrap to take interfaces as parameters - - Bug fix: set context keys for generic execute method with PolicyWrap - - Bug fix: generic TResult method with non-generic fallback policy - - Performance improvements - - 5.5.0 - --------------------- - - Bug fix: non-generic CachePolicy with PolicyWrap - - Add Cache interfaces - - 5.4.0 - --------------------- - - Add CachePolicy: cache-aside pattern, with interfaces for pluggable cache providers and serializers. - - Bug fix: Sync TimeoutPolicy in pessimistic mode no longer interposes AggregateException. - - Provide public factory methods for PolicyResult, to support testing. - - Fallback delegates can now take handled fault as input parameter. - - 5.3.1 - --------------------- - - Make ISyncPolicy<TResult> public - - (Upgrade solution to msbuild15) - - 5.3.0 - --------------------- - - Fix ExecuteAndCapture() usage with PolicyWrap - - Allow Fallback delegates to take execution Context - - Provide IReadOnlyPolicyRegistry interface - - 5.2.0 - --------------------- - - Add PolicyRegistry for storing and retrieving policies. - - Add interfaces by policy type and execution type. - - Change .NetStandard minimum support to NetStandard1.1. - - 5.1.0 - --------------------- - - Allow different parts of a policy execution to exchange data via a mutable Context travelling with each execution. - - 5.0.6 - --------------------- - - (.NETStandard1.0 changes only.) - - 5.0.5 - --------------------- - - Bug fix: Prevent request stampede during half-open state of CircuitBreaker and AdvancedCircuitBreaker. Enforce only one new trial call per break duration, during half-open state. - - Bug fix: Prevent duplicate raising of the onBreak delegate, if executions started when a circuit was closed, return faults when a circuit has already opened. - - Optimisation: Optimise hotpaths for Circuit-Breaker, Retry and Fallback policies. - - Add NoOpPolicy: NoOpPolicy executes delegates without intervention; for eg stubbing out Polly in unit testing. - - 5.0.4 pre - --------------------- - - Fix Microsoft.Bcl and Nito.AsyncEx dependencies for Polly.Net40Async. - - 5.0.3 RTM - --------------------- - - Refine implementation of cancellable synchronous WaitAndRetry - - Minor breaking change: Where a user delegate does not observe cancellation, Polly will now honour the delegate's outcome rather than throw for the unobserved cancellation (issue 188). - - 5.0.2 alpha - --------------------- - - Add full specs support for .NET40. - - Fix issue 179: Make Net4.0 async implementation for Bulkhead truly async. - - 5.0.1 alpha - --------------------- - - (Add a .NETStandard1.0 target.) - - 5.0.0 alpha - --------------------- - A major release, adding significant new resilience policies: - - Timeout policy: allows timing out any execution - - Bulkhead isolation policy: limits the resources consumable by governed actions, such that a faulting channel cannot cause cascading failures. - - Fallback policy: provides for a fallback execution or value, in case of overall failure - - PolicyWrap: allows flexibly combining Policy instances of any type, to form an overall resilience strategy. - - Other changes include: - - Add PolicyKeys and context to all policy executions, for logging and to support later introduction of policy events and metrics. - - Add CancellationToken support to synchronous executions. - - Add some missing ExecuteAndCapture/Async overloads. - - Remove invalid ExecuteAsync overloads taking (but not making use of) a CancellationToken - - Provide .NET4.0 support uniquely through Polly.NET40Async package - - Retire ContextualPolicy (not part of documented API; support now in Policy base class) - - Discontinue .NET3.5 support - - 4.3.0 - --------------------- - - Added ability for policies to handle return results. Optimised circuit-breaker hot path. Fixed circuit-breaker threshold bug. - - 4.2.4 - --------------------- - - Added overloads to WaitAndRetry and WaitAndRetryAsync methods that accept an onRetry delegate which includes the attempt count. - - 4.2.3 - --------------------- - - Cleaned up new Polly.Net40Async NuGet package, removing Polly.dll and unused framework folders. - - 4.2.2 - --------------------- - - Add new Polly.Net40Async project supporting async for .NET40 via Microsoft.Bcl.Async. This is available as separate Nuget packages Polly.Net40Async and Polly.Net40Async-signed. - - - - - - - - - - - - - - From 96333e42259e59c2fa0aecbb32a4ed3d9ad29696 Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 17:02:00 +0100 Subject: [PATCH 08/12] Remove .NET4.5 from nuspec Remove .NET4.5 mentions and target from nuspec --- src/Polly.nuspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Polly.nuspec b/src/Polly.nuspec index c230adcea09..b30046caa21 100644 --- a/src/Polly.nuspec +++ b/src/Polly.nuspec @@ -4,7 +4,7 @@ App vNext Michael Wolfenden, App vNext - Polly is a .NET 4.5 / .NET Standard 1.1 library that allows developers to express resilience and transient fault handling policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation and Fallback in a fluent and thread-safe manner. + Polly is a .NET Standard 1.1 library that allows developers to express resilience and transient fault handling policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation and Fallback in a fluent and thread-safe manner. en-US https://raw.github.com/App-vNext/Polly/master/LICENSE.txt @@ -231,7 +231,6 @@ - Allow arbitrary data to be passed to policy execution - From 4e9842fc1c02f23ee2ad81e23e3ffd50d9b59d48 Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 17:02:33 +0100 Subject: [PATCH 09/12] Update Readme Update Readme to remove .NET4.0 and .NET4.5 references --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a52dcfe413f..8c35ab08ce6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. -Polly targets .NET 4.0, .NET 4.5 and .NET Standard 1.1 ([coverage](https://github.com/dotnet/standard/blob/master/docs/versions.md): .NET Core, Mono, Xamarin.iOS, Xamarin.Android, UWP, WP8.1+). +Polly targets .NET Standard 1.1 ([coverage](https://github.com/dotnet/standard/blob/master/docs/versions.md): .NET Framework 4.5+, .NET Core, Mono, Xamarin.iOS, Xamarin.Android, UWP, WP8.1+). [](https://www.dotnetfoundation.org/) We are now a member of the [.NET Foundation](https://www.dotnetfoundation.org/about)! From bb83746b010ba4dc84f337bac8751ee514d70592 Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 17:28:28 +0100 Subject: [PATCH 10/12] Readme: remove outdated package instructions Remove installation instructions for deprecated packages --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index 8c35ab08ce6..a3fe4640300 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,6 @@ We are now a member of the [.NET Foundation](https://www.dotnetfoundation.org/ab Install-Package Polly -You can install the Strongly Named version via: - - Install-Package Polly-Signed - -.NET4.0 support is provided via the packages: - - Install-Package Polly.Net40Async - Install-Package Polly.Net40Async-Signed - # Resilience policies From 5a05f042fcb7a8ded5991de463edffd0a4e8f43c Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 18:33:49 +0100 Subject: [PATCH 11/12] Add .NetStandard 2.0 target Adds .NetStandard 2.0 target, tests and packaging --- CHANGELOG.md | 1 + README.md | 12 +++---- build.cake | 11 ++++--- .../Polly.NetStandard20.Specs.csproj | 32 +++++++++++++++++++ .../Properties/AssemblyInfo.cs | 1 + .../Polly.NetStandard20.csproj | 30 +++++++++++++++++ .../Properties/AssemblyInfo.cs | 11 +++++++ src/Polly.nuspec | 4 ++- src/Polly.sln | 12 +++++++ 9 files changed, 103 insertions(+), 11 deletions(-) create mode 100644 src/Polly.NetStandard20.Specs/Polly.NetStandard20.Specs.csproj create mode 100644 src/Polly.NetStandard20.Specs/Properties/AssemblyInfo.cs create mode 100644 src/Polly.NetStandard20/Polly.NetStandard20.csproj create mode 100644 src/Polly.NetStandard20/Properties/AssemblyInfo.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index c3e68335294..0dbba369a5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## 6.0.0-v6alpha - Publish as strong-named package only (discontinue non-strong-named versions) +- Add .NetStandard 2.0 tfm - Provide .NET4.5 support via .NetStandard 1.1 tfm - Discontinue .NET4.0 support - Remove methods marked as deprecated in v5.9.0 diff --git a/README.md b/README.md index a3fe4640300..8eaab6ae823 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. -Polly targets .NET Standard 1.1 ([coverage](https://github.com/dotnet/standard/blob/master/docs/versions.md): .NET Framework 4.5+, .NET Core, Mono, Xamarin.iOS, Xamarin.Android, UWP, WP8.1+). +Polly targets .NET Standard 1.1 ([coverage](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support): .NET Framework 4.5-4.6.1, .NET Core 1.0, Mono, Xamarin, UWP, WP8.1+) and .NET Standard 2.0+ ([coverage](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support): .NET Framework 4.6.1, .NET Core 2.0+, and later Mono, Xamarin and UWP targets). [](https://www.dotnetfoundation.org/) -We are now a member of the [.NET Foundation](https://www.dotnetfoundation.org/about)! +We are a member of the [.NET Foundation](https://www.dotnetfoundation.org/about)! **Keep up to date with new feature announcements, tips & tricks, and other news through [www.thepollyproject.org](http://www.thepollyproject.org)** @@ -911,7 +911,7 @@ For more detail see: [Polly and interfaces](https://github.com/App-vNext/Polly/w From Polly v6.0.0, .NET4.5 support is provided [via the .Net Standard 1.1 target](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support). -Polly versions up to [v5.9.0](https://www.nuget.org/packages/Polly/5.9.0) have direct target support for .NET 4.5. +Polly versions up to [v5.9.0](https://www.nuget.org/packages/Polly/5.9.0) have direct target support for .NET Framework 4.5. # .NET4.0 support @@ -930,9 +930,9 @@ For details of changes by release see the [change log](https://github.com/App-vN * [Fluent Assertions](https://github.com/fluentassertions/fluentassertions) - A set of .NET extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style test | [Apache License 2.0 (Apache)](https://github.com/dennisdoomen/fluentassertions/blob/develop/LICENSE) * [xUnit.net](https://github.com/xunit/xunit) - Free, open source, community-focused unit testing tool for the .NET Framework | [Apache License 2.0 (Apache)](https://github.com/xunit/xunit/blob/master/license.txt) * [Ian Griffith's TimedLock](http://www.interact-sw.co.uk/iangblog/2004/04/26/yetmoretimedlocking) -* [Steven van Deursen's ReadOnlyDictionary](http://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=29) (until v5.0.6) -* [Stephen Cleary's AsyncEx library](https://github.com/StephenCleary/AsyncEx) for AsyncSemaphore (supports BulkheadAsync policy for .NET4.0 only) | [MIT license](https://github.com/StephenCleary/AsyncEx/blob/master/LICENSE) -* [@theraot](https://github.com/theraot)'s [ExceptionDispatchInfo implementation for .NET4.0](https://stackoverflow.com/a/31226509/) (supports Timeout policy for .NET4.0 only) including also a contribution by [@migueldeicaza](https://github.com/migueldeicaza) | Licensed under and distributed under [Creative Commons Attribution Share Alike license](https://creativecommons.org/licenses/by-sa/3.0/) per [StackExchange Terms of Service](https://stackexchange.com/legal) +* [Steven van Deursen's ReadOnlyDictionary](http://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=29) (until Polly v5.0.6) +* [Stephen Cleary's AsyncEx library](https://github.com/StephenCleary/AsyncEx) for AsyncSemaphore (supports BulkheadAsync policy for .NET4.0 only) (until Polly v5.9.0) | [MIT license](https://github.com/StephenCleary/AsyncEx/blob/master/LICENSE) +* [@theraot](https://github.com/theraot)'s [ExceptionDispatchInfo implementation for .NET4.0](https://stackoverflow.com/a/31226509/) (supports Timeout policy for .NET4.0 only) (until Polly v5.9.0) including also a contribution by [@migueldeicaza](https://github.com/migueldeicaza) | Licensed under and distributed under [Creative Commons Attribution Share Alike license](https://creativecommons.org/licenses/by-sa/3.0/) per [StackExchange Terms of Service](https://stackexchange.com/legal) * Build powered by [Cake](http://cakebuild.net/) and [GitVersionTask](https://github.com/GitTools/GitVersion). # Acknowledgements diff --git a/build.cake b/build.cake index 140260594d6..54da4066786 100644 --- a/build.cake +++ b/build.cake @@ -45,6 +45,7 @@ var snkFile = srcDir + File(keyName); var projectToNugetFolderMap = new Dictionary() { { "NetStandard11", new [] {"netstandard1.1"} }, + { "NetStandard20", new [] {"netstandard2.0"} }, }; // Gitversion @@ -209,10 +210,12 @@ Task("__BuildSolutions") Task("__RunTests") .Does(() => { - DotNetCoreTest("./src/Polly.NetStandard11.Specs/Polly.NetStandard11.Specs.csproj", new DotNetCoreTestSettings { - Configuration = configuration, - NoBuild = true - }); + foreach(var specsProj in GetFiles("./src/**/*.Specs.csproj")) { + DotNetCoreTest(specsProj.FullPath, new DotNetCoreTestSettings { + Configuration = configuration, + NoBuild = true + }); + } }); Task("__CopyOutputToNugetFolder") diff --git a/src/Polly.NetStandard20.Specs/Polly.NetStandard20.Specs.csproj b/src/Polly.NetStandard20.Specs/Polly.NetStandard20.Specs.csproj new file mode 100644 index 00000000000..6a73e8a2a92 --- /dev/null +++ b/src/Polly.NetStandard20.Specs/Polly.NetStandard20.Specs.csproj @@ -0,0 +1,32 @@ + + + false + Library + netcoreapp2.0 + library + + + full + TRACE;DEBUG;NETCOREAPP2_0 + + + pdbonly + true + TRACE;RELEASE;NETCOREAPP2_0 + + + + + + + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + diff --git a/src/Polly.NetStandard20.Specs/Properties/AssemblyInfo.cs b/src/Polly.NetStandard20.Specs/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..e76dbc82f26 --- /dev/null +++ b/src/Polly.NetStandard20.Specs/Properties/AssemblyInfo.cs @@ -0,0 +1 @@ +[assembly: Xunit.CollectionBehavior(DisableTestParallelization = false)] \ No newline at end of file diff --git a/src/Polly.NetStandard20/Polly.NetStandard20.csproj b/src/Polly.NetStandard20/Polly.NetStandard20.csproj new file mode 100644 index 00000000000..11f9a3042e6 --- /dev/null +++ b/src/Polly.NetStandard20/Polly.NetStandard20.csproj @@ -0,0 +1,30 @@ + + + netstandard2.0 + Polly + en-US + false + true + Polly + + + full + TRACE;DEBUG;PORTABLE;NETSTANDARD;NETSTANDARD2_0 + + + pdbonly + true + TRACE;PORTABLE;RELEASE;NETSTANDARD;NETSTANDARD2_0 + + + + False + + + + + Properties\GlobalAssemblyInfo.cs + + + + \ No newline at end of file diff --git a/src/Polly.NetStandard20/Properties/AssemblyInfo.cs b/src/Polly.NetStandard20/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..81f5e63cab9 --- /dev/null +++ b/src/Polly.NetStandard20/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("Polly")] +[assembly: AssemblyInformationalVersion("6.0.0.0")] +[assembly: AssemblyFileVersion("6.0.0.0")] +[assembly: AssemblyVersion("6.0.0.0")] +[assembly: CLSCompliant(true)] + +[assembly: InternalsVisibleTo("Polly.NetStandard20.Specs")] \ No newline at end of file diff --git a/src/Polly.nuspec b/src/Polly.nuspec index b30046caa21..5891536f053 100644 --- a/src/Polly.nuspec +++ b/src/Polly.nuspec @@ -4,7 +4,7 @@ App vNext Michael Wolfenden, App vNext - Polly is a .NET Standard 1.1 library that allows developers to express resilience and transient fault handling policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation and Fallback in a fluent and thread-safe manner. + Polly is a .NET Standard 1.1 and .NET Standard 2.0 library that allows developers to express resilience and transient fault handling policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation and Fallback in a fluent and thread-safe manner. en-US https://raw.github.com/App-vNext/Polly/master/LICENSE.txt @@ -16,6 +16,7 @@ 6.0.0-v6alpha --------------------- - Publish as strong-named package only (discontinue non-strong-named versions) + - Add .NetStandard 2.0 tfm - Provide .NET4.5 support via .NetStandard 1.1 tfm - Discontinue .NET4.0 support - Remove methods marked as deprecated in v5.9.0 @@ -234,6 +235,7 @@ + diff --git a/src/Polly.sln b/src/Polly.sln index 66a5485f9e0..9a27f218d0c 100644 --- a/src/Polly.sln +++ b/src/Polly.sln @@ -18,6 +18,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.NetStandard11", "Poll EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.NetStandard11.Specs", "Polly.NetStandard11.Specs\Polly.NetStandard11.Specs.csproj", "{615C92EC-5921-40F4-A690-C66B1587C08E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Polly.NetStandard20", "Polly.NetStandard20\Polly.NetStandard20.csproj", "{E43A312E-3324-4DB3-8707-6F2335F66CD1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Polly.NetStandard20.Specs", "Polly.NetStandard20.Specs\Polly.NetStandard20.Specs.csproj", "{AD51A3D7-01A9-4E41-966B-1A7BAA38A261}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Polly.Shared\Polly.Shared.projitems*{23fa87f9-c77d-4c67-a0b0-2901de51b3ff}*SharedItemsImports = 13 @@ -37,6 +41,14 @@ Global {615C92EC-5921-40F4-A690-C66B1587C08E}.Debug|Any CPU.Build.0 = Debug|Any CPU {615C92EC-5921-40F4-A690-C66B1587C08E}.Release|Any CPU.ActiveCfg = Release|Any CPU {615C92EC-5921-40F4-A690-C66B1587C08E}.Release|Any CPU.Build.0 = Release|Any CPU + {E43A312E-3324-4DB3-8707-6F2335F66CD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E43A312E-3324-4DB3-8707-6F2335F66CD1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E43A312E-3324-4DB3-8707-6F2335F66CD1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E43A312E-3324-4DB3-8707-6F2335F66CD1}.Release|Any CPU.Build.0 = Release|Any CPU + {AD51A3D7-01A9-4E41-966B-1A7BAA38A261}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AD51A3D7-01A9-4E41-966B-1A7BAA38A261}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AD51A3D7-01A9-4E41-966B-1A7BAA38A261}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AD51A3D7-01A9-4E41-966B-1A7BAA38A261}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 31fe6836487b30fa3b378e70473a06c4ca46ff9d Mon Sep 17 00:00:00 2001 From: reisenberger Date: Sun, 6 May 2018 17:19:42 +0100 Subject: [PATCH 12/12] v6 RTM Bump to v6.0.1 RTM --- CHANGELOG.md | 3 +++ GitVersionConfig.yaml | 2 +- README.md | 1 + src/Polly.NetStandard11/Properties/AssemblyInfo.cs | 4 ++-- src/Polly.NetStandard20/Properties/AssemblyInfo.cs | 4 ++-- src/Polly.nuspec | 3 +++ 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dbba369a5f..728df487dd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 6.0.1 +- Version 6 RTM, for integration to ASPNET Core 2.1 IHttpClientFactory + ## 6.0.0-v6alpha - Publish as strong-named package only (discontinue non-strong-named versions) - Add .NetStandard 2.0 tfm diff --git a/GitVersionConfig.yaml b/GitVersionConfig.yaml index e164313d5bb..67f30281d5d 100644 --- a/GitVersionConfig.yaml +++ b/GitVersionConfig.yaml @@ -1 +1 @@ -next-version: 6.0.0 \ No newline at end of file +next-version: 6.0.1 \ No newline at end of file diff --git a/README.md b/README.md index 8eaab6ae823..f5947d2a301 100644 --- a/README.md +++ b/README.md @@ -989,6 +989,7 @@ For details of changes by release see the [change log](https://github.com/App-vN * [@erickhouse](https://github.com/erickhouse) - Add a new onBreak overload that provides the prior state on a transition to an open state. * [@benagain](https://github.com/benagain) - Bug fix: RelativeTtl in CachePolicy now always returns a ttl relative to time item is cached. * [@urig](https://github.com/urig) - Allow TimeoutPolicy to be configured with Timeout.InfiniteTimeSpan. +* [@reisenberger](https://github.com/reisenberger) - Integration with [IHttpClientFactory](https://github.com/aspnet/HttpClientFactory/) for ASPNET Core 2.1. # Sample Projects diff --git a/src/Polly.NetStandard11/Properties/AssemblyInfo.cs b/src/Polly.NetStandard11/Properties/AssemblyInfo.cs index 30fb9872933..8bea54c3b51 100644 --- a/src/Polly.NetStandard11/Properties/AssemblyInfo.cs +++ b/src/Polly.NetStandard11/Properties/AssemblyInfo.cs @@ -3,8 +3,8 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly")] -[assembly: AssemblyInformationalVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.0.0.0")] +[assembly: AssemblyInformationalVersion("6.0.1.0")] +[assembly: AssemblyFileVersion("6.0.1.0")] [assembly: AssemblyVersion("6.0.0.0")] [assembly: CLSCompliant(true)] diff --git a/src/Polly.NetStandard20/Properties/AssemblyInfo.cs b/src/Polly.NetStandard20/Properties/AssemblyInfo.cs index 81f5e63cab9..7d9cb58df33 100644 --- a/src/Polly.NetStandard20/Properties/AssemblyInfo.cs +++ b/src/Polly.NetStandard20/Properties/AssemblyInfo.cs @@ -3,8 +3,8 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly")] -[assembly: AssemblyInformationalVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.0.0.0")] +[assembly: AssemblyInformationalVersion("6.0.1.0")] +[assembly: AssemblyFileVersion("6.0.1.0")] [assembly: AssemblyVersion("6.0.0.0")] [assembly: CLSCompliant(true)] diff --git a/src/Polly.nuspec b/src/Polly.nuspec index 5891536f053..263bad60ebb 100644 --- a/src/Polly.nuspec +++ b/src/Polly.nuspec @@ -13,6 +13,9 @@ Exception Handling Resilience Transient Fault Policy Circuit Breaker CircuitBreaker Retry Wait Cache Cache-aside Bulkhead Fallback Timeout Throttle Parallelization Copyright © 2018, App vNext + 6.0.1 + - Version 6 RTM, for integration to ASPNET Core 2.1 IHttpClientFactory + 6.0.0-v6alpha --------------------- - Publish as strong-named package only (discontinue non-strong-named versions)