Skip to content

Commit 31f3736

Browse files
authored
Merge pull request #6 from synercoder/features/multiple-targetframeworks
Features/multiple targetframeworks
2 parents 9c1229e + a786e33 commit 31f3736

File tree

10 files changed

+482
-38
lines changed

10 files changed

+482
-38
lines changed

Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,14 @@
4444
<LangVersion>8.0</LangVersion>
4545
</PropertyGroup>
4646

47+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
48+
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
49+
</PropertyGroup>
50+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
51+
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
52+
</PropertyGroup>
53+
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
54+
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
55+
</PropertyGroup>
56+
4757
</Project>

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<Project>
33

44
<PropertyGroup>
5+
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;netstandard2.1;netstandard2.0;netstandard1.6</TargetFrameworks>
56
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props</MSBuildAllProjects>
67
<SynercodingProjectCategory>src</SynercodingProjectCategory>
78
</PropertyGroup>

src/Synercoding.Primitives/Point.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ public override int GetHashCode()
7171
=> HashCode.Combine(X, Y);
7272

7373
/// <inheritdoc />
74-
public override bool Equals(object obj)
75-
{
76-
return obj is Point unit && Equals(unit);
77-
}
74+
public override bool Equals(object? obj)
75+
=> obj is Point unit && Equals(unit);
7876

7977
/// <inheritdoc />
8078
public bool Equals(Point other)

src/Synercoding.Primitives/Rectangle.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,8 @@ public override int GetHashCode()
143143
=> HashCode.Combine(LLX, LLY, URX, URY);
144144

145145
/// <inheritdoc/>
146-
public override bool Equals(object obj)
147-
{
148-
return obj is Rectangle unit && Equals(unit);
149-
}
146+
public override bool Equals(object? obj)
147+
=> obj is Rectangle unit && Equals(unit);
150148

151149
/// <inheritdoc/>
152150
public bool Equals(Rectangle other)

src/Synercoding.Primitives/Size.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ public override int GetHashCode()
8383
=> HashCode.Combine(Width, Height);
8484

8585
/// <inheritdoc/>
86-
public override bool Equals(object obj)
87-
{
88-
return obj is Size unit && Equals(unit);
89-
}
86+
public override bool Equals(object? obj)
87+
=> obj is Size unit && Equals(unit);
9088

9189
/// <inheritdoc/>
9290
public bool Equals(Size other)

src/Synercoding.Primitives/Spacing.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,8 @@ public override int GetHashCode()
105105
=> HashCode.Combine(Left, Top, Right, Bottom);
106106

107107
/// <inheritdoc/>
108-
public override bool Equals(object obj)
109-
{
110-
return obj is Spacing unit && Equals(unit);
111-
}
108+
public override bool Equals(object? obj)
109+
=> obj is Spacing unit && Equals(unit);
112110

113111
/// <inheritdoc/>
114112
public bool Equals(Spacing other)
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
54
<Nullable>enable</Nullable>
65
<LangVersion>8.0</LangVersion>
76
</PropertyGroup>
87

98
<Import Project="$(MSBuildThisFileDirectory)\PackageDetails.props" />
109

10+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netstandard1.6'">
11+
<PackageReference Include="System.Memory " Version="4.5.4" />
12+
</ItemGroup>
13+
14+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
15+
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
16+
</ItemGroup>
17+
1118
</Project>

0 commit comments

Comments
 (0)