Skip to content

Commit 478ea77

Browse files
authored
feature: Add .NET 6 and deterministic builds (reactivemarbles#520)
1 parent 0a58324 commit 478ea77

12 files changed

Lines changed: 756 additions & 342 deletions

File tree

‎.editorconfig‎

Lines changed: 699 additions & 31 deletions
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎src/Directory.Build.props‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@
88
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
99
<IsBenchmarkProject>$(MSBuildProjectName.Contains('Benchmarks'))</IsBenchmarkProject>
1010
<DebugType>embedded</DebugType>
11-
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)analyzers.ruleset</CodeAnalysisRuleSet>
12-
1311
<Authors>Roland Pheasant</Authors>
1412
<Owners>Roland Pheasant</Owners>
15-
<Copyright>Copyright (c) Roland Pheasant 2011-2020</Copyright>
13+
<Copyright>Copyright (c) Roland Pheasant 2011-2021</Copyright>
1614
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1715
<PackageProjectUrl>http://dynamic-data.org</PackageProjectUrl>
18-
<PackageIconUrl>https://raw.githubusercontent.com/reactiveui/styleguide/master/logo_dynamic_data/main.png</PackageIconUrl>
1916
<PackageTags>DynamicData;Dynamic;Data;Rx;Reactive;Observable;Cache;Binding;ObservableCache;ObservableList;ObservableCollection;Collection;Linq</PackageTags>
2017
<PackageReleaseNotes>https://github.com/reactiveui/DynamicData/releases</PackageReleaseNotes>
2118
<RepositoryUrl>https://github.com/reactiveui/DynamicData</RepositoryUrl>
2219
<RepositoryType>git</RepositoryType>
23-
20+
<PackageIcon>logo.png</PackageIcon>
21+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
22+
2423
<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
2524
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2625
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
@@ -30,6 +29,10 @@
3029
<WarningsAsErrors>CS8600;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8623;CS8624;CS8625;CS8626;CS8627;CS8628;CS8629;CS8630;CS8634;CS8766;CS8767</WarningsAsErrors>
3130
</PropertyGroup>
3231

32+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
33+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
34+
</PropertyGroup>
35+
3336
<!-- MonoAndroid doesn't seem to want to allow debugging for maintainers -->
3437
<PropertyGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
3538
<DebugType>Full</DebugType>
@@ -39,7 +42,10 @@
3942
<IsPackable>false</IsPackable>
4043
<CodeAnalysisRuleSet></CodeAnalysisRuleSet>
4144
</PropertyGroup>
42-
45+
46+
<ItemGroup>
47+
<None Include="$(MSBuildThisFileDirectory)..\images\logo.png" Pack="true" PackagePath="\"/>
48+
</ItemGroup>
4349
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
4450
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
4551
</ItemGroup>
@@ -56,9 +62,8 @@
5662
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.240" PrivateAssets="all" />
5763
</ItemGroup>
5864
<ItemGroup Condition="!$(IsTestProject) AND !$(IsBenchmarkProject)">
59-
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.261" PrivateAssets="all" />
65+
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.354" PrivateAssets="all" />
6066
<PackageReference Include="Roslynator.Analyzers" Version="3.2.2" PrivateAssets="All" />
61-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="all" />
6267
</ItemGroup>
6368
<ItemGroup Condition="!$(IsTestProject) AND !$(IsBenchmarkProject)">
6469
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />

‎src/Directory.build.targets‎

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
<Project>
2-
<PropertyGroup>
3-
<Product>$(AssemblyName) ($(TargetFramework))</Product>
4-
</PropertyGroup>
2+
<PropertyGroup>
3+
<Product>$(AssemblyName) ($(TargetFramework))</Product>
4+
</PropertyGroup>
55

6-
<PropertyGroup Condition="$(TargetFramework.StartsWith('uap'))">
7-
<DefineConstants>$(DefineConstants);WINDOWS_UWP;P_LINQ</DefineConstants>
8-
</PropertyGroup>
6+
<PropertyGroup Condition="$(TargetFramework.StartsWith('uap'))">
7+
<DefineConstants>$(DefineConstants);WINDOWS_UWP;P_LINQ</DefineConstants>
8+
</PropertyGroup>
99

10-
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
11-
<DefineConstants>$(DefineConstants);P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
12-
</PropertyGroup>
10+
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
11+
<DefineConstants>$(DefineConstants);P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
12+
</PropertyGroup>
1313

14-
<PropertyGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
15-
<DefineConstants>$(DefineConstants);NETSTANDARD;PORTABLE;P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
16-
</PropertyGroup>
14+
<PropertyGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
15+
<DefineConstants>$(DefineConstants);NETSTANDARD;PORTABLE;P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
16+
</PropertyGroup>
1717

18-
<PropertyGroup Condition="$(TargetFramework.StartsWith('netcoreapp'))">
19-
<DefineConstants>$(DefineConstants);NETCOREAPP;P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
20-
</PropertyGroup>
18+
<PropertyGroup Condition="$(TargetFramework.StartsWith('netcoreapp'))">
19+
<DefineConstants>$(DefineConstants);NETCOREAPP;P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
20+
</PropertyGroup>
2121

22-
<PropertyGroup Condition="$(TargetFramework.StartsWith('net5'))">
23-
<DefineConstants>$(DefineConstants);NETSTANDARD;PORTABLE;P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
24-
</PropertyGroup>
22+
<PropertyGroup Condition="$(TargetFramework.StartsWith('net5'))">
23+
<DefineConstants>$(DefineConstants);NETSTANDARD;PORTABLE;P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
24+
</PropertyGroup>
25+
26+
<PropertyGroup Condition="$(TargetFramework.StartsWith('net6'))">
27+
<DefineConstants>$(DefineConstants);NETSTANDARD;PORTABLE;P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
28+
</PropertyGroup>
2529

2630
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# editorconfig.org
2+
3+
# top-most EditorConfig file
4+
root = true

‎src/DynamicData.Tests/Domain/PersonEmployment.cs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public override bool Equals(object? obj)
3030
return false;
3131
}
3232

33-
return obj is PersonEmpKey && Equals((PersonEmpKey)obj);
33+
return obj is PersonEmpKey personEmpKey && Equals(personEmpKey);
3434
}
3535

3636
public override int GetHashCode()
@@ -40,6 +40,16 @@ public override int GetHashCode()
4040
return ((_name is not null ? _name.GetHashCode() : 0) * 397) ^ (_company is not null ? _company.GetHashCode() : 0);
4141
}
4242
}
43+
44+
public static bool operator ==(PersonEmpKey left, PersonEmpKey right)
45+
{
46+
return left.Equals(right);
47+
}
48+
49+
public static bool operator !=(PersonEmpKey left, PersonEmpKey right)
50+
{
51+
return !(left == right);
52+
}
4353
}
4454

4555
public class PersonEmployment : IKey<PersonEmpKey>

‎src/DynamicData.Tests/DynamicData.Tests.csproj‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
4-
<NoWarn>$(NoWarn);CS0618;CA1801</NoWarn>
3+
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
4+
<NoWarn>$(NoWarn);CS0618;CA1801;CA1063</NoWarn>
55
<Nullable>enable</Nullable>
66
<LangVersion>latest</LangVersion>
77
</PropertyGroup>

‎src/DynamicData.sln‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29025.244
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31808.319
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamicData", "DynamicData\DynamicData.csproj", "{FE903921-6C55-40E3-9A16-4127ECACC12C}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".other", ".other", "{DFCC45F8-251C-4D78-AF9B-15C1EDF0E603}"
99
ProjectSection(SolutionItems) = preProject
10-
analyzers.ruleset = analyzers.ruleset
11-
appveyor.yml = appveyor.yml
10+
..\.editorconfig = ..\.editorconfig
11+
..\.gitignore = ..\.gitignore
1212
Directory.Build.props = Directory.Build.props
1313
Directory.build.targets = Directory.build.targets
1414
global.json = global.json

0 commit comments

Comments
 (0)