Skip to content

Commit 4c083ff

Browse files
Merge pull request #111 from Stillpoint-Software/develop
Updated to .NET 10
2 parents 0128c14 + 84586e4 commit 4c083ff

24 files changed

+209
-140
lines changed

Directory.Build.props

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
<Project>
2-
<!-- Shared package refs -->
32
<ItemGroup>
43
<!-- NBGV drives versions; PrivateAssets=all keeps it out of consumers -->
5-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.8.38-alpha" PrivateAssets="all" />
6-
4+
<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="all" />
75
<!-- SourceLink for GitHub -->
8-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
9-
<PrivateAssets>all</PrivateAssets>
10-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
11-
</PackageReference>
12-
6+
<PackageReference Include="Microsoft.SourceLink.GitHub"/>
7+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" />
138
</ItemGroup>
14-
15-
<!-- SourceLink / build hygiene -->
9+
1610
<PropertyGroup>
1711
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
1812
<Deterministic>true</Deterministic>
@@ -44,4 +38,9 @@
4438
PackagePath="\"
4539
Link="LICENSE" />
4640
</ItemGroup>
41+
<!-- Global project properies -->
42+
<PropertyGroup>
43+
<ImplicitUsings>enable</ImplicitUsings>
44+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
45+
</PropertyGroup>
4746
</Project>

Directory.Packages.props

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<!-- Development Tools -->
7+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.9.50" />
8+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
9+
<PrivateAssets>all</PrivateAssets>
10+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
11+
</PackageVersion>
12+
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
13+
<PackageVersion Include="DotNext.Metaprogramming" Version="5.26.1" />
14+
<PackageVersion Include="FastExpressionCompiler" Version="5.3.0" />
15+
<PackageVersion Include="coverlet.collector" Version="6.0.4">
16+
<PrivateAssets>all</PrivateAssets>
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
</PackageVersion>
19+
<!-- Hyperbee.Json: conditional versions by target framework -->
20+
<PackageVersion Include="Hyperbee.Json" Version="3.0.6" Condition="'$(TargetFramework)' == 'net8.0'" />
21+
<PackageVersion Include="Hyperbee.Json" Version="3.1.2" Condition="'$(TargetFramework)' == 'net10.0'" />
22+
23+
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.1" />
24+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
25+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.1" />
26+
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.1" />
27+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
28+
<PackageVersion Include="MSTest.TestAdapter" Version="4.0.2" />
29+
<PackageVersion Include="MSTest.TestFramework" Version="4.0.2" />
30+
<PackageVersion Include="Hyperbee.Collections" Version="2.6.4" />
31+
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.1" />
32+
<!-- Roslyn: use consistent version for all frameworks -->
33+
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="5.0.0" />
34+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
35+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="5.0.0" />
36+
</ItemGroup>
37+
</Project>

Hyperbee.Expressions.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.10.35122.118
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.1.11312.151 d18.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6103145C-EC79-4B5F-9CE6-8F10BFC6ACC5}"
77
ProjectSection(SolutionItems) = preProject
88
Directory.Build.props = Directory.Build.props
9+
Directory.Packages.props = Directory.Packages.props
910
LICENSE = LICENSE
1011
README.md = README.md
1112
version.json = version.json

src/Hyperbee.Expressions.Lab/Hyperbee.Expressions.Lab.csproj

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
5-
<ImplicitUsings>enable</ImplicitUsings>
64
<Nullable>disable</Nullable>
75
<IsPackable>true</IsPackable>
86

@@ -43,18 +41,16 @@
4341
<None Include="..\..\assets\icon.png" Pack="true" Visible="false" PackagePath="/" />
4442
<None Include="..\..\README.md" Pack="true" Visible="true" PackagePath="/" Link="README.md" />
4543
<None Include="..\..\LICENSE" Pack="true" Visible="false" PackagePath="/" />
46-
<PackageReference Include="Hyperbee.Collections" Version="2.4.0" />
47-
<PackageReference Include="Hyperbee.Json" Version="3.0.6" />
48-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
49-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.8" />
50-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.8" />
51-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.8" />
52-
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" />
44+
<PackageReference Include="Hyperbee.Collections" />
45+
<PackageReference Include="Hyperbee.Json" />
46+
<PackageReference Include="Microsoft.CodeAnalysis.Common" />
47+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
48+
<PackageReference Include="Microsoft.Extensions.Configuration" />
49+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
50+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
51+
<PackageReference Include="Microsoft.Extensions.Http" />
5352
<ProjectReference Include="..\Hyperbee.Expressions\Hyperbee.Expressions.csproj" />
54-
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0">
55-
<PrivateAssets>all</PrivateAssets>
56-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
57-
</PackageReference>
53+
<PackageReference Update="Microsoft.SourceLink.GitHub" />
5854
</ItemGroup>
5955

6056
</Project>

src/Hyperbee.Expressions/Hyperbee.Expressions.csproj

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
5-
<ImplicitUsings>enable</ImplicitUsings>
64
<Nullable>disable</Nullable>
75
<IsPackable>true</IsPackable>
86

@@ -43,15 +41,13 @@
4341
<None Include="..\..\assets\icon.png" Pack="true" Visible="false" PackagePath="/" />
4442
<None Include="..\..\README.md" Pack="true" Visible="true" PackagePath="/" Link="README.md" />
4543
<None Include="..\..\LICENSE" Pack="true" Visible="false" PackagePath="/" />
46-
<PackageReference Include="Hyperbee.Collections" Version="2.4.0" />
47-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
48-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.8" />
49-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.8" />
50-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.8" />
51-
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0">
52-
<PrivateAssets>all</PrivateAssets>
53-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
54-
</PackageReference>
44+
<PackageReference Include="Hyperbee.Collections" />
45+
<PackageReference Include="Microsoft.CodeAnalysis.Common" />
46+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
47+
<PackageReference Include="Microsoft.Extensions.Configuration" />
48+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
49+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
50+
<PackageReference Update="Microsoft.SourceLink.GitHub" />
5551
</ItemGroup>
5652

5753
</Project>

test/Hyperbee.Expressions.Benchmark/BenchmarkConfig.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using BenchmarkDotNet.Columns;
22
using BenchmarkDotNet.Configs;
33
using BenchmarkDotNet.Diagnosers;
4+
using BenchmarkDotNet.Environments;
45
using BenchmarkDotNet.Exporters;
56
using BenchmarkDotNet.Jobs;
67
using BenchmarkDotNet.Loggers;
@@ -15,7 +16,14 @@ public class Config : ManualConfig
1516
{
1617
public Config()
1718
{
18-
AddJob( Job.ShortRun );
19+
AddJob( Job.ShortRun
20+
.WithRuntime( CoreRuntime.Core80 )
21+
.WithId( ".NET 8" ) );
22+
23+
AddJob( Job.ShortRun
24+
.WithRuntime( CoreRuntime.Core10_0 )
25+
.WithId( ".NET 10" ) );
26+
1927

2028
AddExporter( MarkdownExporter.GitHub );
2129
AddValidator( JitOptimizationsValidator.DontFailOnError );
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net9.0</TargetFrameworks>
6-
<ImplicitUsings>enable</ImplicitUsings>
75
<Nullable>disable</Nullable>
86
<IsPackable>false</IsPackable>
97
</PropertyGroup>
108

119
<ItemGroup>
12-
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
13-
<PackageReference Include="DotNext.Metaprogramming" Version="5.23.0" />
14-
<PackageReference Include="FastExpressionCompiler" Version="5.1.1" />
10+
<PackageReference Include="BenchmarkDotNet" />
11+
<PackageReference Include="DotNext.Metaprogramming" />
12+
<PackageReference Include="FastExpressionCompiler" />
1513
</ItemGroup>
1614

1715
<ItemGroup>
1816
<ProjectReference Include="..\..\src\Hyperbee.Expressions\Hyperbee.Expressions.csproj" />
1917
</ItemGroup>
2018

2119
<ItemGroup>
22-
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0">
23-
<PrivateAssets>all</PrivateAssets>
24-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25-
</PackageReference>
20+
<PackageReference Update="Microsoft.SourceLink.GitHub" />
2621
</ItemGroup>
2722

2823
</Project>

test/Hyperbee.Expressions.Tests/BlockAsyncBasicTests.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ public async Task BlockAsync_ShouldAwaitMultipleTasks_WithDifferentResults( Comp
121121
[DataRow( CompilerType.Fast )]
122122
[DataRow( CompilerType.System )]
123123
[DataRow( CompilerType.Interpret )]
124-
[ExpectedException( typeof( InvalidOperationException ) )]
125124
public async Task BlockAsync_ShouldThrowException_WithFaultedTask( CompilerType compiler )
126125
{
127126
// Arrange
@@ -133,14 +132,13 @@ public async Task BlockAsync_ShouldThrowException_WithFaultedTask( CompilerType
133132
var compiledLambda = lambda.Compile( compiler );
134133

135134
// Act & Assert
136-
await compiledLambda();
135+
await Assert.ThrowsExactlyAsync<InvalidOperationException>( async () => await compiledLambda() );
137136
}
138137

139138
[TestMethod]
140139
[DataRow( CompilerType.Fast )]
141140
[DataRow( CompilerType.System )]
142141
[DataRow( CompilerType.Interpret )]
143-
[ExpectedException( typeof( TaskCanceledException ) )]
144142
public async Task BlockAsync_ShouldHandleCanceledTask_WithCancellation( CompilerType compiler )
145143
{
146144
// Arrange
@@ -153,7 +151,7 @@ public async Task BlockAsync_ShouldHandleCanceledTask_WithCancellation( Compiler
153151
var compiledLambda = lambda.Compile( compiler );
154152

155153
// Act & Assert
156-
await compiledLambda();
154+
await Assert.ThrowsExactlyAsync<TaskCanceledException>( async () => await compiledLambda() );
157155
}
158156

159157
[TestMethod]
@@ -554,7 +552,7 @@ public async Task BlockAsync_ShouldAllowParallelBlocks_WithTaskWhenAll( Complete
554552
var result = await compiledLambda();
555553

556554
// Assert
557-
Assert.AreEqual( threadCount, result.Length );
555+
Assert.HasCount( threadCount, result );
558556
for ( var tC = 0; tC < threadCount; tC++ )
559557
{
560558
Assert.AreEqual( tC, result[tC] );

test/Hyperbee.Expressions.Tests/BlockAsyncConditionalTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithConditionalReturningTas
370370
}
371371

372372
[TestMethod]
373-
[ExpectedException( typeof( NullReferenceException ) )]
374373
public async Task AsyncBlock_ShouldThrowException_WithNullTaskInConditional()
375374
{
376375
// Arrange: One of the branches returns a null task, leading to exception
@@ -385,6 +384,6 @@ public async Task AsyncBlock_ShouldThrowException_WithNullTaskInConditional()
385384
var compiledLambda = lambda.Compile();
386385

387386
// Act & Assert
388-
await compiledLambda();
387+
await Assert.ThrowsExactlyAsync<NullReferenceException>( async () => await compiledLambda() );
389388
}
390389
}

test/Hyperbee.Expressions.Tests/BlockAsyncSwitchTests.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -189,29 +189,29 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithNestedSwitchesAndAwaits
189189
[DataRow( CompleterType.Deferred, CompilerType.Fast )]
190190
[DataRow( CompleterType.Deferred, CompilerType.System )]
191191
[DataRow( CompleterType.Deferred, CompilerType.Interpret )]
192-
[ExpectedException( typeof( ArgumentException ) )]
193192
public async Task AsyncBlock_ShouldThrowException_WithAwaitInSwitchCaseTestValues( CompleterType completer, CompilerType compiler )
194193
{
195-
// Arrange: Switch case test values cannot contain awaited tasks
196-
var block = Switch(
197-
Constant( 1 ),
198-
Constant( 0 ),
199-
SwitchCase(
200-
Constant( 10 ),
201-
Await( BlockAsync(
202-
Await( AsyncHelper.Completer(
203-
Constant( completer ),
204-
Constant( 1 )
194+
// Act & Assert: The exception should be thrown during lambda construction or compilation
195+
await Assert.ThrowsExactlyAsync<ArgumentException>(async () =>
196+
{
197+
var block = Switch(
198+
Constant( 1 ),
199+
Constant( 0 ),
200+
SwitchCase(
201+
Constant( 10 ),
202+
Await( BlockAsync(
203+
Await( AsyncHelper.Completer(
204+
Constant( completer ),
205+
Constant( 1 )
206+
) )
205207
) )
206-
) )
207-
),
208-
SwitchCase( Constant( 20 ), Constant( 2 ) )
209-
);
210-
var lambda = Lambda<Func<Task<int>>>( block );
211-
var compiledLambda = lambda.Compile( compiler );
212-
213-
// Act
214-
await compiledLambda();
208+
),
209+
SwitchCase( Constant( 20 ), Constant( 2 ) )
210+
);
211+
var lambda = Lambda<Func<Task<int>>>( block );
212+
var compiledLambda = lambda.Compile( compiler );
213+
await compiledLambda();
214+
});
215215
}
216216

217217
[TestMethod]

0 commit comments

Comments
 (0)