From ef951e9f52f798cbff7db5d1d919f4262ba97e9f Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 20:38:47 +0100 Subject: [PATCH 1/5] Build only a single, signed package --- build.cake | 60 ++----------------- ...ons.Http.NetStandard11-Signed.Specs.csproj | 33 ---------- .../Properties/AssemblyInfo.cs | 1 - ...xtensions.Http.NetStandard11-Signed.csproj | 34 ----------- .../Properties/AssemblyInfo.cs | 9 --- ...Extensions.Http.NetStandard11.Specs.csproj | 2 +- ...Polly.Extensions.Http.NetStandard11.csproj | 2 +- .../Properties/AssemblyInfo.cs | 2 +- src/Polly.Extensions.Http.nuspec | 2 +- src/Polly.Extensions.Http.sln | 12 ---- 10 files changed, 10 insertions(+), 147 deletions(-) delete mode 100644 src/Polly.Extensions.Http.NetStandard11-Signed.Specs/Polly.Extensions.Http.NetStandard11-Signed.Specs.csproj delete mode 100644 src/Polly.Extensions.Http.NetStandard11-Signed.Specs/Properties/AssemblyInfo.cs delete mode 100644 src/Polly.Extensions.Http.NetStandard11-Signed/Polly.Extensions.Http.NetStandard11-Signed.csproj delete mode 100644 src/Polly.Extensions.Http.NetStandard11-Signed/Properties/AssemblyInfo.cs diff --git a/build.cake b/build.cake index aca42d7..7d73ccf 100644 --- a/build.cake +++ b/build.cake @@ -38,17 +38,14 @@ var testResultsDir = artifactsDir + Directory("test-results"); // NuGet var nuspecExtension = ".nuspec"; -var signed = "-Signed"; var nuspecFolder = "nuget-package"; var nuspecSrcFile = srcDir + File(projectName + nuspecExtension); var nuspecDestFile = buildDir + File(projectName + nuspecExtension); -var nuspecSignedDestFile = buildDir + File(projectName + signed + nuspecExtension); var nupkgDestDir = artifactsDir + Directory(nuspecFolder); var snkFile = srcDir + File(keyName); var projectToNugetFolderMap = new Dictionary() { { "NetStandard11", new [] {"netstandard1.1"} }, - { "NetStandard11-Signed", new [] {"netstandard1.1"} }, }; // Gitversion @@ -189,31 +186,12 @@ Task("__RunTests") } }); -Task("__CopyNonSignedOutputToNugetFolder") - .Does(() => -{ - foreach(var project in projectToNugetFolderMap.Keys - .Where(p => !p.Contains(signed)) - ) { - var sourceDir = srcDir + Directory(projectName + "." + project) + Directory("bin") + Directory(configuration); - - foreach(var targetFolder in projectToNugetFolderMap[project]) { - var destDir = buildDir + Directory("lib"); - - Information("Copying {0} -> {1}.", sourceDir, destDir); - CopyDirectory(sourceDir, destDir); - } - } - - CopyFile(nuspecSrcFile, nuspecDestFile); -}); -Task("__CopySignedOutputToNugetFolder") +Task("__CopyOutputToNugetFolder") .Does(() => { - foreach(var project in projectToNugetFolderMap.Keys - .Where(p => p.Contains(signed)) - ) { + foreach(var project in projectToNugetFolderMap.Keys) + { var sourceDir = srcDir + Directory(projectName + "." + project) + Directory("bin") + Directory(configuration); foreach(var targetFolder in projectToNugetFolderMap[project]) { @@ -224,16 +202,10 @@ Task("__CopySignedOutputToNugetFolder") } } - CopyFile(nuspecSrcFile, nuspecSignedDestFile); - - var replacedFiles = ReplaceTextInFiles(nuspecSignedDestFile, "dependency id=\"Polly\"", "dependency id=\"Polly-Signed\""); - if (!replacedFiles.Any()) - { - throw new Exception("Could not set Polly dependency to Polly-Signed, for -Signed nuget package."); - } + CopyFile(nuspecSrcFile, nuspecDestFile); }); -Task("__CreateNonSignedNugetPackage") +Task("__CreateSignedNugetPackage") .Does(() => { var nugetVersion = gitVersionOutput["NuGetVersion"].ToString(); @@ -251,24 +223,6 @@ Task("__CreateNonSignedNugetPackage") NuGetPack(nuspecDestFile, nuGetPackSettings); }); -Task("__CreateSignedNugetPackage") - .Does(() => -{ - var nugetVersion = gitVersionOutput["NuGetVersion"].ToString(); - var packageName = projectName + "-Signed"; - - Information("Building {0}.{1}.nupkg", packageName, nugetVersion); - - var nuGetPackSettings = new NuGetPackSettings { - Id = packageName, - Title = packageName, - Version = nugetVersion, - OutputDirectory = nupkgDestDir - }; - - NuGetPack(nuspecSignedDestFile, nuGetPackSettings); -}); - Task("__StronglySignAssemblies") .Does(() => { @@ -297,9 +251,7 @@ Task("Build") .IsDependentOn("__UpdateAppVeyorBuildNumber") .IsDependentOn("__BuildSolutions") .IsDependentOn("__RunTests") - .IsDependentOn("__CopyNonSignedOutputToNugetFolder") - .IsDependentOn("__CreateNonSignedNugetPackage") - .IsDependentOn("__CopySignedOutputToNugetFolder") + .IsDependentOn("__CopyOutputToNugetFolder") .IsDependentOn("__StronglySignAssemblies") .IsDependentOn("__CreateSignedNugetPackage"); diff --git a/src/Polly.Extensions.Http.NetStandard11-Signed.Specs/Polly.Extensions.Http.NetStandard11-Signed.Specs.csproj b/src/Polly.Extensions.Http.NetStandard11-Signed.Specs/Polly.Extensions.Http.NetStandard11-Signed.Specs.csproj deleted file mode 100644 index 25cf76b..0000000 --- a/src/Polly.Extensions.Http.NetStandard11-Signed.Specs/Polly.Extensions.Http.NetStandard11-Signed.Specs.csproj +++ /dev/null @@ -1,33 +0,0 @@ - - - false - Library - netcoreapp1.1 - library - - - full - TRACE;DEBUG;NETCOREAPP1_1 - - - pdbonly - true - TRACE;RELEASE;NETCOREAPP1_1 - - - - - - - - - - - Properties\GlobalAssemblyInfo.cs - - - - - - - diff --git a/src/Polly.Extensions.Http.NetStandard11-Signed.Specs/Properties/AssemblyInfo.cs b/src/Polly.Extensions.Http.NetStandard11-Signed.Specs/Properties/AssemblyInfo.cs deleted file mode 100644 index e76dbc8..0000000 --- a/src/Polly.Extensions.Http.NetStandard11-Signed.Specs/Properties/AssemblyInfo.cs +++ /dev/null @@ -1 +0,0 @@ -[assembly: Xunit.CollectionBehavior(DisableTestParallelization = false)] \ No newline at end of file diff --git a/src/Polly.Extensions.Http.NetStandard11-Signed/Polly.Extensions.Http.NetStandard11-Signed.csproj b/src/Polly.Extensions.Http.NetStandard11-Signed/Polly.Extensions.Http.NetStandard11-Signed.csproj deleted file mode 100644 index 37210ab..0000000 --- a/src/Polly.Extensions.Http.NetStandard11-Signed/Polly.Extensions.Http.NetStandard11-Signed.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - Polly.Extensions.Http - - TRACE;PORTABLE - en-US - false - true - PolicyExtensions - netstandard1.1 - 1.6.1 - - - full - - - pdbonly - true - - - - False - - - - - Properties\GlobalAssemblyInfo.cs - - - - - - - \ No newline at end of file diff --git a/src/Polly.Extensions.Http.NetStandard11-Signed/Properties/AssemblyInfo.cs b/src/Polly.Extensions.Http.NetStandard11-Signed/Properties/AssemblyInfo.cs deleted file mode 100644 index 063044a..0000000 --- a/src/Polly.Extensions.Http.NetStandard11-Signed/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyTitle("Polly.Extensions.Http")] -[assembly: AssemblyVersion("1.0.3.0")] -[assembly: CLSCompliant(true)] - -[assembly: InternalsVisibleTo("Polly.Extensions.Http.NetStandard11-Signed.Specs")] \ No newline at end of file diff --git a/src/Polly.Extensions.Http.NetStandard11.Specs/Polly.Extensions.Http.NetStandard11.Specs.csproj b/src/Polly.Extensions.Http.NetStandard11.Specs/Polly.Extensions.Http.NetStandard11.Specs.csproj index f91ccd3..d4cc0a2 100644 --- a/src/Polly.Extensions.Http.NetStandard11.Specs/Polly.Extensions.Http.NetStandard11.Specs.csproj +++ b/src/Polly.Extensions.Http.NetStandard11.Specs/Polly.Extensions.Http.NetStandard11.Specs.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj b/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj index 3c17f50..74aa304 100644 --- a/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj +++ b/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj @@ -28,7 +28,7 @@ - + \ No newline at end of file diff --git a/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs b/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs index 963c192..7b38350 100644 --- a/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs +++ b/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly.Extensions.Http")] -[assembly: AssemblyVersion("1.0.3.0")] +[assembly: AssemblyVersion("1.0.4.0")] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("Polly.Extensions.Http.NetStandard11.Specs")] \ No newline at end of file diff --git a/src/Polly.Extensions.Http.nuspec b/src/Polly.Extensions.Http.nuspec index 6dd5cc4..14ef8ed 100644 --- a/src/Polly.Extensions.Http.nuspec +++ b/src/Polly.Extensions.Http.nuspec @@ -36,7 +36,7 @@ - + diff --git a/src/Polly.Extensions.Http.sln b/src/Polly.Extensions.Http.sln index 8226d85..b94ff73 100644 --- a/src/Polly.Extensions.Http.sln +++ b/src/Polly.Extensions.Http.sln @@ -17,10 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetSt EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetStandard11.Specs", "Polly.Extensions.Http.NetStandard11.Specs\Polly.Extensions.Http.NetStandard11.Specs.csproj", "{615C92EC-5921-40F4-A690-C66B1587C08E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetStandard11-Signed", "Polly.Extensions.Http.NetStandard11-Signed\Polly.Extensions.Http.NetStandard11-Signed.csproj", "{1CFC0F44-E534-4F9F-B916-F408244356B4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetStandard11-Signed.Specs", "Polly.Extensions.Http.NetStandard11-Signed.Specs\Polly.Extensions.Http.NetStandard11-Signed.Specs.csproj", "{A69B39A4-158C-41C0-9144-E49503FE7A8D}" -EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Polly.Extensions.Http.Shared\Polly.Extensions.Http.Shared.projitems*{23fa87f9-c77d-4c67-a0b0-2901de51b3ff}*SharedItemsImports = 13 @@ -40,14 +36,6 @@ 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 - {1CFC0F44-E534-4F9F-B916-F408244356B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1CFC0F44-E534-4F9F-B916-F408244356B4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1CFC0F44-E534-4F9F-B916-F408244356B4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1CFC0F44-E534-4F9F-B916-F408244356B4}.Release|Any CPU.Build.0 = Release|Any CPU - {A69B39A4-158C-41C0-9144-E49503FE7A8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A69B39A4-158C-41C0-9144-E49503FE7A8D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A69B39A4-158C-41C0-9144-E49503FE7A8D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A69B39A4-158C-41C0-9144-E49503FE7A8D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 0e01b703ebfdc28331819e47d7aaa9e538f1553d Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 20:45:34 +0100 Subject: [PATCH 2/5] Adopt new versioning strategy Adopt new package and DLL versioning strategy, See #3. 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 | 96 ++++++++++++------- .../Properties/AssemblyInfo.cs | 4 +- 2 files changed, 65 insertions(+), 35 deletions(-) diff --git a/build.cake b/build.cake index 7d73ccf..2037618 100644 --- a/build.cake +++ b/build.cake @@ -52,6 +52,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,37 +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 NetStandard AssemblyVersions to {0}", assemblySemVer); + 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 assemblyInfo in assemblyInfosToUpdate) { - var replacedFiles = ReplaceRegexInFiles(assemblyInfo, "AssemblyVersion[(]\".*\"[)]", "AssemblyVersion(\"" + assemblySemVer +"\")"); - if (!replacedFiles.Any()) - { - throw new Exception($"AssemblyVersion could not be updated in {assemblyInfo}."); + 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") @@ -186,12 +217,10 @@ Task("__RunTests") } }); - Task("__CopyOutputToNugetFolder") .Does(() => { - foreach(var project in projectToNugetFolderMap.Keys) - { + foreach(var project in projectToNugetFolderMap.Keys) { var sourceDir = srcDir + Directory(projectName + "." + project) + Directory("bin") + Directory(configuration); foreach(var targetFolder in projectToNugetFolderMap[project]) { @@ -205,10 +234,25 @@ Task("__CopyOutputToNugetFolder") CopyFile(nuspecSrcFile, nuspecDestFile); }); +Task("__StronglySignAssemblies") + .Does(() => +{ + //see: https://github.com/brutaldev/StrongNameSigner + var strongNameSignerSettings = new ProcessSettings() + .WithArguments(args => args + .Append("-in") + .AppendQuoted(buildDir) + .Append("-k") + .AppendQuoted(snkFile) + .Append("-l") + .AppendQuoted("Changes")); + + StartProcess(strongNameSignerPath, strongNameSignerSettings); +}); + Task("__CreateSignedNugetPackage") .Does(() => { - var nugetVersion = gitVersionOutput["NuGetVersion"].ToString(); var packageName = projectName; Information("Building {0}.{1}.nupkg", packageName, nugetVersion); @@ -223,22 +267,6 @@ Task("__CreateSignedNugetPackage") NuGetPack(nuspecDestFile, nuGetPackSettings); }); -Task("__StronglySignAssemblies") - .Does(() => -{ - //see: https://github.com/brutaldev/StrongNameSigner - var strongNameSignerSettings = new ProcessSettings() - .WithArguments(args => args - .Append("-in") - .AppendQuoted(buildDir) - .Append("-k") - .AppendQuoted(snkFile) - .Append("-l") - .AppendQuoted("Changes")); - - StartProcess(strongNameSignerPath, strongNameSignerSettings); -}); - ////////////////////////////////////////////////////////////////////// // BUILD TASKS ////////////////////////////////////////////////////////////////////// diff --git a/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs b/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs index 7b38350..acd1709 100644 --- a/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs +++ b/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs @@ -3,7 +3,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly.Extensions.Http")] -[assembly: AssemblyVersion("1.0.4.0")] +[assembly: AssemblyInformationalVersion("1.0.5.0")] +[assembly: AssemblyFileVersion("1.0.5.0")] +[assembly: AssemblyVersion("1.0.0.0")] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("Polly.Extensions.Http.NetStandard11.Specs")] \ No newline at end of file From ebd83bdb49fdcc14ce2c93c5bcbb8d02f9fce87b Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 21:02:17 +0100 Subject: [PATCH 3/5] Add v2.0.0-v2alpha doco Also link to latest IHttpClientFactory documentation. Fixes #4 --- CHANGELOG.md | 3 +++ GitVersionConfig.yaml | 2 +- README.md | 19 +++++++++---------- .../Properties/AssemblyInfo.cs | 6 +++--- src/Polly.Extensions.Http.nuspec | 4 ++++ 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4154644..9fcc1e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.0.0-v2alpha +- Publish as strong-named package only (discontinue non-strong-named versions) + ## 1.0.3 - RTM version diff --git a/GitVersionConfig.yaml b/GitVersionConfig.yaml index cd6a99d..ddba28c 100644 --- a/GitVersionConfig.yaml +++ b/GitVersionConfig.yaml @@ -1 +1 @@ -next-version: 1.0.3 \ No newline at end of file +next-version: 2.0.0 \ No newline at end of file diff --git a/README.md b/README.md index af0a447..2f52f14 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,7 @@ Polly is a member of the [.NET Foundation](https://www.dotnetfoundation.org/abou Install-Package Polly.Extensions.Http -You can install the Strongly Named version via: - - Install-Package Polly.Extensions.Http-Signed - -The strongly-named version works with the strongly-named Polly-Signed nuget package. +This package contains a strongly-named DLL. # Convenience methods for transient faults of HttpClient calls @@ -72,9 +68,9 @@ var policy = Policy .RetryAsync(3); ``` -# Using Polly.Extensions.Http with HttpClientFactory +# Using Polly.Extensions.Http with IHttpClientFactory -Polly.Extensions.Http is ideal for creating custom Polly policies for use with HttpClientFactory ([preview1 blog post](https://blogs.msdn.microsoft.com/webdev/2018/02/28/asp-net-core-2-1-preview1-introducing-httpclient-factory/); [preview2 blog post](https://blogs.msdn.microsoft.com/webdev/2018/04/12/asp-net-core-2-1-0-preview2-now-available/)), available from ASP.NET Core 2.1. +Polly.Extensions.Http is ideal for creating custom Polly policies for use with IHttpClientFactory, available from ASP.NET Core 2.1. ```csharp var retryPolicy = HttpPolicyExtensions @@ -89,11 +85,14 @@ serviceCollection.AddHttpClient("example.com", c => c.BaseAddress = new Uri("htt .AddPolicyHandler(timeoutPolicy); ``` -#### TODO: link to public HttpClientFactory documentation and/or expand example, when that documentation is published. +## Official documentation -# For more information on Polly ++ [Microsoft documentation on IHttpClientFactory](https://docs.microsoft.com/en-gb/aspnet/core/fundamentals/http-requests?view=aspnetcore-2.1) ++ [Microsoft documentation on using Polly policies with IHttpClientFactory](https://docs.microsoft.com/en-gb/aspnet/core/fundamentals/http-requests?view=aspnetcore-2.1#use-polly-based-handlers) ++ [Polly documentation on Polly and HttpClientFactory](https://github.com/App-vNext/Polly/wiki/Polly-and-HttpClientFactory) ++ [Main Polly readme](https://github.com/App-vNext/Polly): quickstart details of all Polly policies and features ++ [Polly wiki](https://github.com/App-vNext/Polly/wiki): deep doco on Polly features -For more information on Polly and configuring Polly policies see the [main Polly repository](https://github.com/App-vNext/Polly) and [wiki](https://github.com/App-vNext/Polly/wiki). # Release notes diff --git a/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs b/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs index acd1709..ba95ac0 100644 --- a/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs +++ b/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs @@ -3,9 +3,9 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly.Extensions.Http")] -[assembly: AssemblyInformationalVersion("1.0.5.0")] -[assembly: AssemblyFileVersion("1.0.5.0")] -[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyInformationalVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] +[assembly: AssemblyVersion("2.0.0.0")] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("Polly.Extensions.Http.NetStandard11.Specs")] \ No newline at end of file diff --git a/src/Polly.Extensions.Http.nuspec b/src/Polly.Extensions.Http.nuspec index 14ef8ed..2c10307 100644 --- a/src/Polly.Extensions.Http.nuspec +++ b/src/Polly.Extensions.Http.nuspec @@ -13,6 +13,10 @@ HttpClient Exception Handling Resilience Transient Fault Policy Copyright © 2018, App vNext + 2.0.0-v2alpha + --------------------- + - Publish as strong-named package only (discontinue non-strong-named versions) + 1.0.3 --------------------- - RTM version From 52407e727b136877c11f1143d9d558c35335648d Mon Sep 17 00:00:00 2001 From: reisenberger Date: Thu, 3 May 2018 21:37:07 +0100 Subject: [PATCH 4/5] Add .Net Standard 2.0 target Adds .NetStandard 2.0 target, tests and packaging --- CHANGELOG.md | 1 + README.md | 2 +- build.cake | 1 + ...Polly.Extensions.Http.NetStandard11.csproj | 2 +- ...Extensions.Http.NetStandard20.Specs.csproj | 33 +++++++++++++++++++ .../Properties/AssemblyInfo.cs | 1 + ...Polly.Extensions.Http.NetStandard20.csproj | 33 +++++++++++++++++++ .../Properties/AssemblyInfo.cs | 11 +++++++ src/Polly.Extensions.Http.nuspec | 4 +++ src/Polly.Extensions.Http.sln | 12 +++++++ 10 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 src/Polly.Extensions.Http.NetStandard20.Specs/Polly.Extensions.Http.NetStandard20.Specs.csproj create mode 100644 src/Polly.Extensions.Http.NetStandard20.Specs/Properties/AssemblyInfo.cs create mode 100644 src/Polly.Extensions.Http.NetStandard20/Polly.Extensions.Http.NetStandard20.csproj create mode 100644 src/Polly.Extensions.Http.NetStandard20/Properties/AssemblyInfo.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fcc1e7..7dbb935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## 2.0.0-v2alpha - Publish as strong-named package only (discontinue non-strong-named versions) +- Add .NetStandard 2.0 target ## 1.0.3 - RTM version diff --git a/README.md b/README.md index 2f52f14..cce5669 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Polly.Extensions.Http is an extensions package containing opinionated convenience methods for configuring [Polly](https://github.com/App-vNext/Polly) policies to handle transient faults typical of calls through HttpClient. -Polly.Extensions.Http targets .NET Standard 1.1. +Polly.Extensions.Http targets .NET Standard 1.1 and .NET Standard 2.0. [Polly](https://github.com/App-vNext/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. diff --git a/build.cake b/build.cake index 2037618..c94a056 100644 --- a/build.cake +++ b/build.cake @@ -46,6 +46,7 @@ var snkFile = srcDir + File(keyName); var projectToNugetFolderMap = new Dictionary() { { "NetStandard11", new [] {"netstandard1.1"} }, + { "NetStandard20", new [] {"netstandard2.0"} }, }; // Gitversion diff --git a/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj b/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj index 74aa304..e2cfc1a 100644 --- a/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj +++ b/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj @@ -6,7 +6,7 @@ en-US false true - PolicyExtensions + Polly.Extensions.Http netstandard1.1 1.6.1 diff --git a/src/Polly.Extensions.Http.NetStandard20.Specs/Polly.Extensions.Http.NetStandard20.Specs.csproj b/src/Polly.Extensions.Http.NetStandard20.Specs/Polly.Extensions.Http.NetStandard20.Specs.csproj new file mode 100644 index 0000000..f08b6b8 --- /dev/null +++ b/src/Polly.Extensions.Http.NetStandard20.Specs/Polly.Extensions.Http.NetStandard20.Specs.csproj @@ -0,0 +1,33 @@ + + + false + Library + netcoreapp2.0 + library + + + full + TRACE;DEBUG;NETCOREAPP2_0 + + + pdbonly + true + TRACE;RELEASE;NETCOREAPP2_0 + + + + + + + + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + diff --git a/src/Polly.Extensions.Http.NetStandard20.Specs/Properties/AssemblyInfo.cs b/src/Polly.Extensions.Http.NetStandard20.Specs/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e76dbc8 --- /dev/null +++ b/src/Polly.Extensions.Http.NetStandard20.Specs/Properties/AssemblyInfo.cs @@ -0,0 +1 @@ +[assembly: Xunit.CollectionBehavior(DisableTestParallelization = false)] \ No newline at end of file diff --git a/src/Polly.Extensions.Http.NetStandard20/Polly.Extensions.Http.NetStandard20.csproj b/src/Polly.Extensions.Http.NetStandard20/Polly.Extensions.Http.NetStandard20.csproj new file mode 100644 index 0000000..2a79975 --- /dev/null +++ b/src/Polly.Extensions.Http.NetStandard20/Polly.Extensions.Http.NetStandard20.csproj @@ -0,0 +1,33 @@ + + + Polly.Extensions.Http + + TRACE;PORTABLE + en-US + false + true + Polly.Extensions.Http + netstandard2.0 + + + full + + + pdbonly + true + + + + False + + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + \ No newline at end of file diff --git a/src/Polly.Extensions.Http.NetStandard20/Properties/AssemblyInfo.cs b/src/Polly.Extensions.Http.NetStandard20/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4a3be2e --- /dev/null +++ b/src/Polly.Extensions.Http.NetStandard20/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("Polly.Extensions.Http")] +[assembly: AssemblyInformationalVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: CLSCompliant(true)] + +[assembly: InternalsVisibleTo("Polly.Extensions.Http.NetStandard20.Specs")] \ No newline at end of file diff --git a/src/Polly.Extensions.Http.nuspec b/src/Polly.Extensions.Http.nuspec index 2c10307..8818f68 100644 --- a/src/Polly.Extensions.Http.nuspec +++ b/src/Polly.Extensions.Http.nuspec @@ -16,6 +16,7 @@ 2.0.0-v2alpha --------------------- - Publish as strong-named package only (discontinue non-strong-named versions) + - Add .NetStandard 2.0 target 1.0.3 --------------------- @@ -43,6 +44,9 @@ + + + diff --git a/src/Polly.Extensions.Http.sln b/src/Polly.Extensions.Http.sln index b94ff73..412814c 100644 --- a/src/Polly.Extensions.Http.sln +++ b/src/Polly.Extensions.Http.sln @@ -17,6 +17,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetSt EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetStandard11.Specs", "Polly.Extensions.Http.NetStandard11.Specs\Polly.Extensions.Http.NetStandard11.Specs.csproj", "{615C92EC-5921-40F4-A690-C66B1587C08E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Polly.Extensions.Http.NetStandard20", "Polly.Extensions.Http.NetStandard20\Polly.Extensions.Http.NetStandard20.csproj", "{D8108479-6F4B-45CB-9E49-D45D1DC18F10}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Polly.Extensions.Http.NetStandard20.Specs", "Polly.Extensions.Http.NetStandard20.Specs\Polly.Extensions.Http.NetStandard20.Specs.csproj", "{435D99EB-3689-4EA0-96FE-2FA17930322D}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Polly.Extensions.Http.Shared\Polly.Extensions.Http.Shared.projitems*{23fa87f9-c77d-4c67-a0b0-2901de51b3ff}*SharedItemsImports = 13 @@ -36,6 +40,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 + {D8108479-6F4B-45CB-9E49-D45D1DC18F10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8108479-6F4B-45CB-9E49-D45D1DC18F10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8108479-6F4B-45CB-9E49-D45D1DC18F10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8108479-6F4B-45CB-9E49-D45D1DC18F10}.Release|Any CPU.Build.0 = Release|Any CPU + {435D99EB-3689-4EA0-96FE-2FA17930322D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {435D99EB-3689-4EA0-96FE-2FA17930322D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {435D99EB-3689-4EA0-96FE-2FA17930322D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {435D99EB-3689-4EA0-96FE-2FA17930322D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From f6c643a7de987b3e234b5a4b0dcfb5871d8766e4 Mon Sep 17 00:00:00 2001 From: reisenberger Date: Sun, 6 May 2018 18:28:55 +0100 Subject: [PATCH 5/5] v2 RTM Bump to v2.0.1 RTM. Reference Polly v6.0.1 RTM --- CHANGELOG.md | 3 +++ GitVersionConfig.yaml | 2 +- .../Polly.Extensions.Http.NetStandard11.Specs.csproj | 2 +- .../Polly.Extensions.Http.NetStandard11.csproj | 2 +- .../Properties/AssemblyInfo.cs | 4 ++-- .../Polly.Extensions.Http.NetStandard20.Specs.csproj | 2 +- .../Polly.Extensions.Http.NetStandard20.csproj | 2 +- .../Properties/AssemblyInfo.cs | 4 ++-- src/Polly.Extensions.Http.nuspec | 8 ++++++-- 9 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dbb935..a4d84d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.0.1 +- Version 2 RTM, for integration to ASPNET Core 2.1 IHttpClientFactory + ## 2.0.0-v2alpha - Publish as strong-named package only (discontinue non-strong-named versions) - Add .NetStandard 2.0 target diff --git a/GitVersionConfig.yaml b/GitVersionConfig.yaml index ddba28c..58c9946 100644 --- a/GitVersionConfig.yaml +++ b/GitVersionConfig.yaml @@ -1 +1 @@ -next-version: 2.0.0 \ No newline at end of file +next-version: 2.0.1 \ No newline at end of file diff --git a/src/Polly.Extensions.Http.NetStandard11.Specs/Polly.Extensions.Http.NetStandard11.Specs.csproj b/src/Polly.Extensions.Http.NetStandard11.Specs/Polly.Extensions.Http.NetStandard11.Specs.csproj index d4cc0a2..7fb7747 100644 --- a/src/Polly.Extensions.Http.NetStandard11.Specs/Polly.Extensions.Http.NetStandard11.Specs.csproj +++ b/src/Polly.Extensions.Http.NetStandard11.Specs/Polly.Extensions.Http.NetStandard11.Specs.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj b/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj index e2cfc1a..8f60a27 100644 --- a/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj +++ b/src/Polly.Extensions.Http.NetStandard11/Polly.Extensions.Http.NetStandard11.csproj @@ -28,7 +28,7 @@ - + \ No newline at end of file diff --git a/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs b/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs index ba95ac0..1754279 100644 --- a/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs +++ b/src/Polly.Extensions.Http.NetStandard11/Properties/AssemblyInfo.cs @@ -3,8 +3,8 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly.Extensions.Http")] -[assembly: AssemblyInformationalVersion("2.0.0.0")] -[assembly: AssemblyFileVersion("2.0.0.0")] +[assembly: AssemblyInformationalVersion("2.0.1.0")] +[assembly: AssemblyFileVersion("2.0.1.0")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: CLSCompliant(true)] diff --git a/src/Polly.Extensions.Http.NetStandard20.Specs/Polly.Extensions.Http.NetStandard20.Specs.csproj b/src/Polly.Extensions.Http.NetStandard20.Specs/Polly.Extensions.Http.NetStandard20.Specs.csproj index f08b6b8..77fe697 100644 --- a/src/Polly.Extensions.Http.NetStandard20.Specs/Polly.Extensions.Http.NetStandard20.Specs.csproj +++ b/src/Polly.Extensions.Http.NetStandard20.Specs/Polly.Extensions.Http.NetStandard20.Specs.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Polly.Extensions.Http.NetStandard20/Polly.Extensions.Http.NetStandard20.csproj b/src/Polly.Extensions.Http.NetStandard20/Polly.Extensions.Http.NetStandard20.csproj index 2a79975..79e77c1 100644 --- a/src/Polly.Extensions.Http.NetStandard20/Polly.Extensions.Http.NetStandard20.csproj +++ b/src/Polly.Extensions.Http.NetStandard20/Polly.Extensions.Http.NetStandard20.csproj @@ -27,7 +27,7 @@ - + \ No newline at end of file diff --git a/src/Polly.Extensions.Http.NetStandard20/Properties/AssemblyInfo.cs b/src/Polly.Extensions.Http.NetStandard20/Properties/AssemblyInfo.cs index 4a3be2e..70f5749 100644 --- a/src/Polly.Extensions.Http.NetStandard20/Properties/AssemblyInfo.cs +++ b/src/Polly.Extensions.Http.NetStandard20/Properties/AssemblyInfo.cs @@ -3,8 +3,8 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Polly.Extensions.Http")] -[assembly: AssemblyInformationalVersion("2.0.0.0")] -[assembly: AssemblyFileVersion("2.0.0.0")] +[assembly: AssemblyInformationalVersion("2.0.1.0")] +[assembly: AssemblyFileVersion("2.0.1.0")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: CLSCompliant(true)] diff --git a/src/Polly.Extensions.Http.nuspec b/src/Polly.Extensions.Http.nuspec index 8818f68..d79d757 100644 --- a/src/Polly.Extensions.Http.nuspec +++ b/src/Polly.Extensions.Http.nuspec @@ -13,6 +13,10 @@ HttpClient Exception Handling Resilience Transient Fault Policy Copyright © 2018, App vNext + 2.0.1 + --------------------- + - Version 2 RTM, for integration to ASPNET Core 2.1 IHttpClientFactory + 2.0.0-v2alpha --------------------- - Publish as strong-named package only (discontinue non-strong-named versions) @@ -41,11 +45,11 @@ - + - +