Skip to content

Commit eabff1b

Browse files
Upgrade specs and benchmarks to .NET 6.0 (#142)
* Update to .NET 6.0 Replace Obsolete BenchmarkDot APIs with preferred approaches. * Revert unnecessary upgrade The Ais.Net project itself does not benefit at all from being upgraded to .NET 6.0. It turns out that all the gains can be had simply by loading the existing library into a .NET 6.0 application. The existing library targetting .netstandard2.1 performs exactly as well as one targetting .NET 6.0 directly (even if we upgrade to the latest System.Io.Pipelines) so there's no need for us to do a new release. * Remove SourceLink from specs & benchmark We don't publish the spec or benchmark projects as a library so there's no reason for them to use sourcelink. * Add .NET 6.0 SDK to build * Remove .NET Core 2.1 support Looks like it won't build unless we do this. * I hate yaml * Attempt to fix broken build Co-authored-by: Howard van Rooijen <[email protected]>
1 parent e5c10dc commit eabff1b

20 files changed

+47
-9973
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,7 @@ ASALocalRun/
336336
coverage.cobertura.xml
337337

338338
# VS Code config files
339-
/.vscode
339+
/.vscode
340+
341+
# Generated SpecFlow files
342+
*.feature.cs

Solutions/Ais.Net.Benchmarks/Ais.Net.Benchmarks.csproj

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<Import Project="..\Common.NetCore_3_1.proj" />
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<Import Project="..\Common.Net.proj" />
48

59
<PropertyGroup>
6-
<OutputType>Exe</OutputType>
10+
<OutputType>Exe</OutputType>
711
<IsPackable>false</IsPackable>
812
</PropertyGroup>
913

@@ -14,7 +18,7 @@
1418
</ItemGroup>
1519

1620
<ItemGroup>
17-
<PackageReference Include="BenchmarkDotNet" Version="0.12.0" />
21+
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
1822
</ItemGroup>
1923

2024
<ItemGroup>
@@ -25,4 +29,11 @@
2529
<Folder Include="TestData\" />
2630
</ItemGroup>
2731

32+
<ItemGroup>
33+
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1">
34+
<PrivateAssets>all</PrivateAssets>
35+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
36+
</PackageReference>
37+
</ItemGroup>
38+
2839
</Project>

Solutions/Ais.Net.Benchmarks/Program.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ private static void Main(string[] args)
4343
{
4444
Job job = Job.Default;
4545
IConfig config = DefaultConfig.Instance
46-
.With(MemoryDiagnoser.Default);
46+
.AddDiagnoser(MemoryDiagnoser.Default);
4747

4848
if (args.Length == 1 && args[0] == "inprocess")
4949
{
5050
job = job
5151
.WithMinWarmupCount(2)
5252
.WithMaxWarmupCount(4)
53-
.With(InProcessEmitToolchain.Instance);
54-
config = config.With(ConfigOptions.DisableOptimizationsValidator);
53+
.WithToolchain(InProcessEmitToolchain.Instance);
54+
config = config.WithOptions(ConfigOptions.DisableOptimizationsValidator);
5555
}
5656
else
5757
{
@@ -65,11 +65,11 @@ private static void Main(string[] args)
6565
if (args.Length > 1)
6666
{
6767
string version = args[1];
68-
job = job.With(new Argument[] { new MsBuildArgument($"/p:Version={version}") });
68+
job = job.WithArguments(new Argument[] { new MsBuildArgument($"/p:Version={version}") });
6969
}
7070
}
7171

72-
config = config.With(job);
72+
config = config.AddJob(job);
7373

7474
BenchmarkRunner.Run<AisNetBenchmarks>(config);
7575
}

Solutions/Ais.Net.Specs/Ais.Net.Specs.csproj

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
3-
<Import Project="..\Common.NetCore_3_1.proj" />
43
<PropertyGroup>
5-
<IsPackable>false</IsPackable>
4+
<TargetFramework>net6.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<Import Project="..\Common.Net.proj" />
8+
9+
<PropertyGroup>
10+
<IsPackable>false</IsPackable>
611
<!--
712
Note: SA1633 and SA1649 are disabled because of a bug introduced by SpecFlow 3.1.
813
If https://github.com/SpecFlowOSS/SpecFlow/pull/1790 is ever successfully merged, we should re-enable them.
@@ -11,7 +16,7 @@
1116
</PropertyGroup>
1217
<ItemGroup>
1318
<PackageReference Include="System.Memory" Version="4.5.4" />
14-
<PackageReference Include="Corvus.Testing.SpecFlow.NUnit" Version="1.4.5" />
19+
<PackageReference Include="Corvus.Testing.SpecFlow.NUnit" Version="1.4.6" />
1520
</ItemGroup>
1621
<ItemGroup>
1722
<ProjectReference Include="..\Ais.Net\Ais.Net.csproj" />

0 commit comments

Comments
 (0)