Skip to content

Commit cdfe1df

Browse files
committed
Updating test project to .NET 10
1 parent 20d481f commit cdfe1df

File tree

11 files changed

+28
-74
lines changed

11 files changed

+28
-74
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
dotnet test
3939
--configuration Release
4040
-p:GeneratorVersion=${{ matrix.roslyn }}
41-
--logger "console;verbosity=normal"
4241
4342
- name: Upload Test Results
4443
if: failure()
@@ -70,11 +69,11 @@ jobs:
7069

7170
- name: 🛠️ Build code
7271
run: >
73-
dotnet build
74-
--configuration Release
75-
-p:Version=${{ github.ref_name }}
76-
-p:GitSha=${{ github.sha }}
77-
--no-restore
72+
dotnet build
73+
--configuration Release
74+
-p:Version=${{ github.ref_name }}
75+
-p:GitSha=${{ github.sha }}
76+
--no-restore
7877
7978
- name: 📝 Generate Release Notes
8079
run: gh release create ${{ github.ref_name }} --draft --generate-notes nugets/*.nupkg

AutoCtor.slnx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Solution>
22
<Folder Name="/Solution Items/">
3+
<File Path="global.json" />
34
<File Path="mdsnippets.json" />
45
<File Path="readme.nuget.md" />
56
<File Path="readme.source.md" />
67
<File Path="src/Common.props" />
78
<File Path="src/Directory.Build.props" />
89
<File Path="src/Directory.Packages.props" />
9-
<File Path="src/global.json" />
1010
<File Path="src/nugetfiles/AutoCtor.badcompat.targets" />
1111
<File Path="src/nugetfiles/AutoCtor.props" />
1212
<File Path="src/nugetfiles/AutoCtor.targets" />
@@ -19,6 +19,5 @@
1919
<Project Path="src/AutoCtor.Roslyn3.11/AutoCtor.Roslyn3.11.csproj" />
2020
<Project Path="src/AutoCtor.Roslyn4.0/AutoCtor.Roslyn4.0.csproj" />
2121
<Project Path="src/AutoCtor.Roslyn4.4/AutoCtor.Roslyn4.4.csproj" />
22-
<Project Path="src/AutoCtor.Shared/AutoCtor.Shared.shproj" />
2322
<Project Path="src/AutoCtor.Tests/AutoCtor.Tests.csproj" />
2423
</Solution>

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test": {
3+
"runner": "Microsoft.Testing.Platform"
4+
}
5+
}

src/AutoCtor.Shared/AutoCtor.Shared.projitems

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/AutoCtor.Shared/AutoCtor.Shared.shproj

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/AutoCtor.Tests/AutoCtor.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<IsPackable>false</IsPackable>
77
<NoWarn>CS0169;CS0414</NoWarn>
88
</PropertyGroup>
@@ -47,7 +47,6 @@
4747
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" />
4848
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
4949
<PackageReference Include="Microsoft.NET.Test.Sdk" />
50-
<PackageReference Include="System.Linq.Async" />
5150
<PackageReference Include="TUnit" />
5251
<PackageReference Include="Verify.DiffPlex" />
5352
<PackageReference Include="Verify.SourceGenerators" />

src/AutoCtor.Tests/Utilities/CompilationBuilder.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ private CompilationBuilder(CompilationBuilder other)
3939
public async Task<CSharpCompilation> Build(string assemblyName, CancellationToken cancellationToken = default)
4040
{
4141
var nugetReferences = await _nugetReferences.ToAsyncEnumerable()
42-
.SelectManyAwait(async r =>
43-
(await r.ResolveAsync(null, cancellationToken).ConfigureAwait(false))
44-
.ToAsyncEnumerable())
45-
.ToListAsync(cancellationToken).ConfigureAwait(false);
42+
.SelectMany<ReferenceAssemblies, MetadataReference>(static async (r, ct) =>
43+
await r.ResolveAsync(null, ct)
44+
.ConfigureAwait(false))
45+
.ToListAsync(cancellationToken)
46+
.ConfigureAwait(false);
4647

4748
return CSharpCompilation.Create(assemblyName)
4849
.AddReferences(nugetReferences)

src/Common.props

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
<AssemblyMetadata Include="PackageProjectUrl" Value="$(PackageProjectUrl)" />
2323
</ItemGroup>
2424

25-
<Import Project="AutoCtor.Shared\AutoCtor.Shared.projitems" Label="Shared" />
25+
<ItemGroup>
26+
<Compile Include="$(MSBuildThisFileDirectory)AutoCtor.Shared\*\*.cs" />
27+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)AutoCtor.Shared\*.md" />
28+
</ItemGroup>
2629

27-
</Project>
30+
</Project>

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<Nullable>enable</Nullable>
88
<NoWarn>NU5128</NoWarn>
99
<UseArtifactsOutput>true</UseArtifactsOutput>
10+
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
1011
</PropertyGroup>
1112

1213
<ItemGroup>

src/Directory.Packages.props

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
<PackageVersion Include="Microsoft.NETCore.App.Ref" Version="9.0.10" />
1414
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
1515
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
16-
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
17-
<PackageVersion Include="TUnit" Version="1.1.0" />
16+
<PackageVersion Include="TUnit" Version="1.1.10" />
1817
<PackageVersion Include="Verify.DiffPlex" Version="3.1.2" />
1918
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0" />
20-
<PackageVersion Include="Verify.TUnit" Version="31.6.1" />
19+
<PackageVersion Include="Verify.TUnit" Version="31.7.1" />
2120
</ItemGroup>
22-
</Project>
21+
</Project>

0 commit comments

Comments
 (0)