Skip to content

Commit b859378

Browse files
linkdotnetegil
andauthored
feat: Added support for net9.0 (#1404)
* feat: Added support for net9.0 * ci: include .net 9 sdk in workflow * chore: replace verfication file reference in solution with ci. * note about .net 9 support in v1 --------- Co-authored-by: Egil Hansen <[email protected]>
1 parent 80a8010 commit b859378

File tree

20 files changed

+65
-21
lines changed

20 files changed

+65
-21
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
6.0.x
5050
7.0.x
5151
8.0.x
52+
9.0.x
5253
5354
- name: ⚙️ Setup GIT versioning
5455
uses: dotnet/[email protected]
@@ -132,6 +133,7 @@ jobs:
132133
6.0.x
133134
7.0.x
134135
8.0.x
136+
9.0.x
135137
136138
- name: 🧪 Run unit tests
137139
run: dotnet test -c release --blame --blame-crash --blame-hang
@@ -209,6 +211,7 @@ jobs:
209211
6.0.x
210212
7.0.x
211213
8.0.x
214+
9.0.x
212215
213216
- name: ⚙️ Setup GIT versioning
214217
uses: dotnet/[email protected]

.github/workflows/docs-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
6.0.x
7878
7.0.x
7979
8.0.x
80+
9.0.x
8081
8182
- name: 🎨 Setup color
8283
run: |

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
6.0.x
6363
7.0.x
6464
8.0.x
65+
9.0.x
6566
6667
- name: 🛠️ Update changelog
6768
uses: thomaseizinger/[email protected]

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to **bUnit** will be documented in this file. The project ad
88

99
### Added
1010
- Support for `IKeyedServiceProvider` in net8.0. Reported by [@ViRuSTriNiTy](https://github.com/ViRuSTriNiTy). By [@linkdotnet](https://github.com/linkdotnet).
11+
- Support for `net9.0`. NOTE, there is no commitment as of now to support net9.0 in bUnit v1. However. Support for net9.0 may move to a future v2 release of bUnit and be deprecated in v1. However, allowing bUnit to build and work with net9.0 previews allows our users to keep testing!
1112

1213
### Fixed
1314
- Support for `SupplyFromQueryParameter` in net8.0. Reported by [@aayjaychan](https://github.com/aayjaychan). Fixed by [@egil](https://github.com/egil) and [@linkdotnet](https://github.com/linkdotnet).

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<DotNet6Version>6.0.*</DotNet6Version>
88
<DotNet7Version>7.0.*</DotNet7Version>
99
<DotNet8Version>8.0.*</DotNet8Version>
10+
<DotNet9Version>9.0.0-*</DotNet9Version>
1011
</PropertyGroup>
1112

1213
<!-- Solution wide properties -->

bunit.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.testassets", "tests\b
4848
EndProject
4949
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".workflows", ".workflows", "{3B2F3419-5336-4147-A212-E19091195203}"
5050
ProjectSection(SolutionItems) = preProject
51+
.github\workflows\ci.yml = .github\workflows\ci.yml
5152
.github\workflows\docs-deploy.yml = .github\workflows\docs-deploy.yml
5253
.github\workflows\prepare-release.yml = .github\workflows\prepare-release.yml
5354
.github\workflows\release-preview.yml = .github\workflows\release-preview.yml
5455
.github\workflows\release.yml = .github\workflows\release.yml
55-
.github\workflows\verification.yml = .github\workflows\verification.yml
5656
EndProjectSection
5757
EndProject
5858
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmark", "benchmark", "{F6084D31-2A92-4794-A47E-A8F2254E6970}"
@@ -72,7 +72,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.generators.internal",
7272
EndProject
7373
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.generators.tests", "tests\bunit.generators.tests\bunit.generators.tests.csproj", "{09046981-D9EC-4295-8502-721AC54E1F12}"
7474
EndProject
75-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bunit.generators", "src\bunit.generators\bunit.generators.csproj", "{A7C6A2AA-FF8F-4ED1-8590-5324FC566059}"
75+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.generators", "src\bunit.generators\bunit.generators.csproj", "{A7C6A2AA-FF8F-4ED1-8590-5324FC566059}"
7676
EndProject
7777
Global
7878
GlobalSection(SolutionConfigurationPlatforms) = preSolution

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
33
"rollForward": "latestMajor",
4-
"allowPrerelease": false
4+
"allowPrerelease": true
55
}
66
}

src/bunit.core/bunit.core.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
55
<RootNamespace>Bunit</RootNamespace>
66
<AssemblyName>Bunit.Core</AssemblyName>
77
</PropertyGroup>
8-
8+
99
<PropertyGroup>
1010
<PackageId>bunit.core</PackageId>
1111
<Title>bUnit.core</Title>
@@ -44,4 +44,10 @@
4444
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet8Version)" />
4545
</ItemGroup>
4646

47-
</Project>
47+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
48+
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(DotNet9Version)" />
49+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(DotNet9Version)" />
50+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet9Version)" />
51+
</ItemGroup>
52+
53+
</Project>

src/bunit.web.query/bunit.web.query.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
55
<RootNamespace>Bunit</RootNamespace>
66
<AssemblyName>Bunit.Web.Query</AssemblyName>
77
</PropertyGroup>
@@ -44,4 +44,10 @@
4444
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet8Version)" />
4545
</ItemGroup>
4646

47-
</Project>
47+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
48+
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(DotNet9Version)" />
49+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(DotNet9Version)" />
50+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet9Version)" />
51+
</ItemGroup>
52+
53+
</Project>

src/bunit.web/JSInterop/Implementation/BunitJSObjectReference.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
namespace Bunit;
1010

1111
[SuppressMessage("Minor Code Smell", "S1939:Inheritance list should not be redundant", Justification = "By design. To make it obvious that both is implemented.")]
12-
internal sealed class BunitJSObjectReference : IJSObjectReference, IJSInProcessObjectReference, IJSUnmarshalledObjectReference
12+
internal sealed class BunitJSObjectReference : IJSObjectReference, IJSInProcessObjectReference
13+
#if !NET9_0_OR_GREATER
14+
, IJSUnmarshalledObjectReference
15+
#endif
1316
{
1417
private BunitJSInterop JSInterop { get; }
1518

0 commit comments

Comments
 (0)