Skip to content

Commit 5a05f04

Browse files
committed
Add .NetStandard 2.0 target
Adds .NetStandard 2.0 target, tests and packaging
1 parent bb83746 commit 5a05f04

9 files changed

Lines changed: 103 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 6.0.0-v6alpha
22
- Publish as strong-named package only (discontinue non-strong-named versions)
3+
- Add .NetStandard 2.0 tfm
34
- Provide .NET4.5 support via .NetStandard 1.1 tfm
45
- Discontinue .NET4.0 support
56
- Remove methods marked as deprecated in v5.9.0

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
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.
44

5-
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+).
5+
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).
66

77
[<img align="right" src="https://github.com/dotnet/swag/raw/master/logo/dotnetfoundation_v4_small.png" width="100" />](https://www.dotnetfoundation.org/)
8-
We are now a member of the [.NET Foundation](https://www.dotnetfoundation.org/about)!
8+
We are a member of the [.NET Foundation](https://www.dotnetfoundation.org/about)!
99

1010
**Keep up to date with new feature announcements, tips & tricks, and other news through [www.thepollyproject.org](http://www.thepollyproject.org)**
1111

@@ -911,7 +911,7 @@ For more detail see: [Polly and interfaces](https://github.com/App-vNext/Polly/w
911911

912912
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).
913913
914-
Polly versions up to [v5.9.0](https://www.nuget.org/packages/Polly/5.9.0) have direct target support for .NET 4.5.
914+
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.
915915
916916
# .NET4.0 support
917917

@@ -930,9 +930,9 @@ For details of changes by release see the [change log](https://github.com/App-vN
930930
* [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)
931931
* [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)
932932
* [Ian Griffith's TimedLock](http://www.interact-sw.co.uk/iangblog/2004/04/26/yetmoretimedlocking)
933-
* [Steven van Deursen's ReadOnlyDictionary](http://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=29) (until v5.0.6)
934-
* [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)
935-
* [@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)
933+
* [Steven van Deursen's ReadOnlyDictionary](http://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=29) (until Polly v5.0.6)
934+
* [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)
935+
* [@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)
936936
* Build powered by [Cake](http://cakebuild.net/) and [GitVersionTask](https://github.com/GitTools/GitVersion).
937937
938938
# Acknowledgements

build.cake

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var snkFile = srcDir + File(keyName);
4545

4646
var projectToNugetFolderMap = new Dictionary<string, string[]>() {
4747
{ "NetStandard11", new [] {"netstandard1.1"} },
48+
{ "NetStandard20", new [] {"netstandard2.0"} },
4849
};
4950

5051
// Gitversion
@@ -209,10 +210,12 @@ Task("__BuildSolutions")
209210
Task("__RunTests")
210211
.Does(() =>
211212
{
212-
DotNetCoreTest("./src/Polly.NetStandard11.Specs/Polly.NetStandard11.Specs.csproj", new DotNetCoreTestSettings {
213-
Configuration = configuration,
214-
NoBuild = true
215-
});
213+
foreach(var specsProj in GetFiles("./src/**/*.Specs.csproj")) {
214+
DotNetCoreTest(specsProj.FullPath, new DotNetCoreTestSettings {
215+
Configuration = configuration,
216+
NoBuild = true
217+
});
218+
}
216219
});
217220

218221
Task("__CopyOutputToNugetFolder")
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
4+
<OutputType>Library</OutputType>
5+
<TargetFramework>netcoreapp2.0</TargetFramework>
6+
<OutputTypeEx>library</OutputTypeEx>
7+
</PropertyGroup>
8+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
9+
<DebugType>full</DebugType>
10+
<DefineConstants>TRACE;DEBUG;NETCOREAPP2_0</DefineConstants>
11+
</PropertyGroup>
12+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
13+
<DebugType>pdbonly</DebugType>
14+
<Optimize>true</Optimize>
15+
<DefineConstants>TRACE;RELEASE;NETCOREAPP2_0</DefineConstants>
16+
</PropertyGroup>
17+
<ItemGroup>
18+
<PackageReference Include="FluentAssertions" Version="4.19.3" />
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
20+
<PackageReference Include="xunit" Version="2.2.0" />
21+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
22+
</ItemGroup>
23+
<ItemGroup>
24+
<Compile Include="..\GlobalAssemblyInfo.cs">
25+
<Link>Properties\GlobalAssemblyInfo.cs</Link>
26+
</Compile>
27+
</ItemGroup>
28+
<ItemGroup>
29+
<ProjectReference Include="..\Polly.NetStandard20\Polly.NetStandard20.csproj" />
30+
</ItemGroup>
31+
<Import Project="..\Polly.SharedSpecs\Polly.SharedSpecs.projitems" Label="Shared" />
32+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[assembly: Xunit.CollectionBehavior(DisableTestParallelization = false)]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>netstandard2.0</TargetFramework>
4+
<AssemblyName>Polly</AssemblyName>
5+
<DefaultLanguage>en-US</DefaultLanguage>
6+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
7+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8+
<RootNamespace>Polly</RootNamespace>
9+
</PropertyGroup>
10+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
11+
<DebugType>full</DebugType>
12+
<DefineConstants>TRACE;DEBUG;PORTABLE;NETSTANDARD;NETSTANDARD2_0</DefineConstants>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
15+
<DebugType>pdbonly</DebugType>
16+
<Optimize>true</Optimize>
17+
<DefineConstants>TRACE;PORTABLE;RELEASE;NETSTANDARD;NETSTANDARD2_0</DefineConstants>
18+
</PropertyGroup>
19+
<ItemGroup>
20+
<NuSpecFile Include="$(SolutionDir)Polly.nuspec">
21+
<Visible>False</Visible>
22+
</NuSpecFile>
23+
</ItemGroup>
24+
<ItemGroup>
25+
<Compile Include="..\GlobalAssemblyInfo.cs">
26+
<Link>Properties\GlobalAssemblyInfo.cs</Link>
27+
</Compile>
28+
</ItemGroup>
29+
<Import Project="..\Polly.Shared\Polly.Shared.projitems" Label="Shared" />
30+
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using System.Reflection;
3+
using System.Runtime.CompilerServices;
4+
5+
[assembly: AssemblyTitle("Polly")]
6+
[assembly: AssemblyInformationalVersion("6.0.0.0")]
7+
[assembly: AssemblyFileVersion("6.0.0.0")]
8+
[assembly: AssemblyVersion("6.0.0.0")]
9+
[assembly: CLSCompliant(true)]
10+
11+
[assembly: InternalsVisibleTo("Polly.NetStandard20.Specs")]

src/Polly.nuspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<owners>App vNext</owners>
55
<authors>Michael Wolfenden, App vNext</authors>
66
<description>
7-
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.
7+
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.
88
</description>
99
<language>en-US</language>
1010
<licenseUrl>https://raw.github.com/App-vNext/Polly/master/LICENSE.txt</licenseUrl>
@@ -16,6 +16,7 @@
1616
6.0.0-v6alpha
1717
---------------------
1818
- Publish as strong-named package only (discontinue non-strong-named versions)
19+
- Add .NetStandard 2.0 tfm
1920
- Provide .NET4.5 support via .NetStandard 1.1 tfm
2021
- Discontinue .NET4.0 support
2122
- Remove methods marked as deprecated in v5.9.0
@@ -234,6 +235,7 @@
234235
<group targetFramework="netstandard1.1">
235236
<dependency id="NETStandard.Library" version="1.6.1" />
236237
</group>
238+
<group targetFramework="netstandard2.0"/>
237239
</dependencies>
238240
</metadata>
239241
<files>

src/Polly.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.NetStandard11", "Poll
1818
EndProject
1919
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.NetStandard11.Specs", "Polly.NetStandard11.Specs\Polly.NetStandard11.Specs.csproj", "{615C92EC-5921-40F4-A690-C66B1587C08E}"
2020
EndProject
21+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Polly.NetStandard20", "Polly.NetStandard20\Polly.NetStandard20.csproj", "{E43A312E-3324-4DB3-8707-6F2335F66CD1}"
22+
EndProject
23+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Polly.NetStandard20.Specs", "Polly.NetStandard20.Specs\Polly.NetStandard20.Specs.csproj", "{AD51A3D7-01A9-4E41-966B-1A7BAA38A261}"
24+
EndProject
2125
Global
2226
GlobalSection(SharedMSBuildProjectFiles) = preSolution
2327
Polly.Shared\Polly.Shared.projitems*{23fa87f9-c77d-4c67-a0b0-2901de51b3ff}*SharedItemsImports = 13
@@ -37,6 +41,14 @@ Global
3741
{615C92EC-5921-40F4-A690-C66B1587C08E}.Debug|Any CPU.Build.0 = Debug|Any CPU
3842
{615C92EC-5921-40F4-A690-C66B1587C08E}.Release|Any CPU.ActiveCfg = Release|Any CPU
3943
{615C92EC-5921-40F4-A690-C66B1587C08E}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{E43A312E-3324-4DB3-8707-6F2335F66CD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45+
{E43A312E-3324-4DB3-8707-6F2335F66CD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
46+
{E43A312E-3324-4DB3-8707-6F2335F66CD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
47+
{E43A312E-3324-4DB3-8707-6F2335F66CD1}.Release|Any CPU.Build.0 = Release|Any CPU
48+
{AD51A3D7-01A9-4E41-966B-1A7BAA38A261}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{AD51A3D7-01A9-4E41-966B-1A7BAA38A261}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{AD51A3D7-01A9-4E41-966B-1A7BAA38A261}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{AD51A3D7-01A9-4E41-966B-1A7BAA38A261}.Release|Any CPU.Build.0 = Release|Any CPU
4052
EndGlobalSection
4153
GlobalSection(SolutionProperties) = preSolution
4254
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)