Skip to content

Commit 0ac5f7f

Browse files
authored
feat(TargetFramework): support net10 (#7100)
* refactor: 精简单元测试配置 * chore: 更新框架为 net10 * chore: 更新解决方案配置 * refactor: 精简代码 * refactor: 增加逻辑不是当前月日期不参与 Range
1 parent 5e93bb5 commit 0ac5f7f

File tree

8 files changed

+45
-81
lines changed

8 files changed

+45
-81
lines changed

BootstrapBlazor.slnx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
<Folder Name="/configuration/">
1010
<File Path=".editorconfig" />
1111
<File Path=".gitignore" />
12-
<File Path="Directory.Build.props" />
1312
<File Path="exclusion.dic" />
14-
<File Path="Framework.props" />
15-
<File Path="Version.props" />
1613
</Folder>
1714
<Folder Name="/docs/">
1815
<File Path="README.md" />
@@ -28,6 +25,11 @@
2825
<File Path="localization/uk-UA.json" />
2926
<File Path="localization/zh-TW.json" />
3027
</Folder>
28+
<Folder Name="/props/">
29+
<File Path="Directory.Build.props" />
30+
<File Path="Framework.props" />
31+
<File Path="Version.props" />
32+
</Folder>
3133
<Folder Name="/scripts/" />
3234
<Folder Name="/scripts/linux/">
3335
<File Path="scripts/linux/ba.blazor.service" />
@@ -55,12 +57,20 @@
5557
<Project Path="src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj" />
5658
<Project Path="src/BootstrapBlazor/BootstrapBlazor.csproj" />
5759
</Folder>
60+
<Folder Name="/src/props/">
61+
<File Path="src/Directory.Build.props" />
62+
<File Path="src/Logo.props" />
63+
<File Path="src/SourceLink.targets" />
64+
</Folder>
5865
<Folder Name="/test/">
5966
<Project Path="test/UniTest.Sass/UniTest.Sass.csproj" />
6067
<Project Path="test/UnitTest.Localization/UnitTest.Localization.csproj" />
6168
<Project Path="test/UnitTest/UnitTest.csproj" />
6269
<Project Path="test/UnitTestDocs/UnitTestDocs.csproj" />
6370
</Folder>
71+
<Folder Name="/test/props/">
72+
<File Path="test/Directory.Build.props" />
73+
</Folder>
6474
<Folder Name="/tools/">
6575
<Project Path="tools/Benchmarks/UnitTest.Benchmarks.csproj" />
6676
</Folder>

Version.props

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<Project>
22

3-
<PropertyGroup Condition="'$(VisualStudioVersion)' == '17.0'">
4-
<RunTargetFramework>net9.0</RunTargetFramework>
5-
<RunTargetFrameworks>net6.0;net7.0;net8.0;net9.0</RunTargetFrameworks>
6-
</PropertyGroup>
7-
8-
<PropertyGroup Condition="'$(VisualStudioVersion)' == '18.0'">
3+
<PropertyGroup>
94
<RunTargetFramework>net10.0</RunTargetFramework>
105
<RunTargetFrameworks>net6.0;net7.0;net8.0;net9.0;net10.0</RunTargetFrameworks>
116
</PropertyGroup>

src/BootstrapBlazor/BootstrapBlazor.csproj

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

3-
<PropertyGroup Condition="'$(VisualStudioVersion)' == '17.0'">
4-
<Version>9.12.2-beta03</Version>
5-
</PropertyGroup>
6-
7-
<PropertyGroup Condition="'$(VisualStudioVersion)' == '18.0'">
8-
<Version>10.0.0-rc.2.2.5</Version>
3+
<PropertyGroup>
4+
<Version>10.0.0</Version>
95
</PropertyGroup>
106

117
<ItemGroup>

test/Directory.Build.props

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<Using Include="BootstrapBlazor.Components"/>
13-
<Using Include="Bunit"/>
14-
<Using Include="Microsoft.AspNetCore.Components"/>
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
13+
<PackageReference Include="xunit" Version="2.*" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
15+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16+
<PrivateAssets>all</PrivateAssets>
17+
</PackageReference>
18+
<PackageReference Include="coverlet.collector" Version="6.*">
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
<PrivateAssets>all</PrivateAssets>
21+
</PackageReference>
22+
</ItemGroup>
23+
24+
<ItemGroup>
1525
<Using Include="System.Diagnostics.CodeAnalysis"/>
16-
<Using Include="UnitTest.Core"/>
1726
<Using Include="Xunit"/>
1827
<Using Include="Xunit.Abstractions"/>
1928
</ItemGroup>
Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<ItemGroup>
4-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
5-
<PackageReference Include="xunit" Version="2.*" />
6-
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
7-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
8-
<PrivateAssets>all</PrivateAssets>
9-
</PackageReference>
10-
<PackageReference Include="coverlet.collector" Version="6.*">
11-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12-
<PrivateAssets>all</PrivateAssets>
13-
</PackageReference>
14-
</ItemGroup>
15-
16-
<ItemGroup>
17-
<Using Remove="BootstrapBlazor.Components" />
18-
<Using Remove="Bunit" />
19-
<Using Remove="Microsoft.AspNetCore.Components" />
20-
<Using Remove="UnitTest.Core" />
21-
</ItemGroup>
22-
233
</Project>

test/UnitTest.Localization/UnitTest.Localization.csproj

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

33
<ItemGroup>
44
<Compile Include="..\..\src\BootstrapBlazor.Server\Data\Foo.cs" Link="Mics\Foo.cs" />
@@ -9,16 +9,6 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="bunit" Version="1.*" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
13-
<PackageReference Include="xunit" Version="2.*" />
14-
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
15-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16-
<PrivateAssets>all</PrivateAssets>
17-
</PackageReference>
18-
<PackageReference Include="coverlet.collector" Version="6.*">
19-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20-
<PrivateAssets>all</PrivateAssets>
21-
</PackageReference>
2212
</ItemGroup>
2313

2414
<ItemGroup>
@@ -40,4 +30,11 @@
4030
<ProjectReference Include="..\..\src\BootstrapBlazor\BootstrapBlazor.csproj" />
4131
</ItemGroup>
4232

33+
<ItemGroup>
34+
<Using Include="BootstrapBlazor.Components"/>
35+
<Using Include="Bunit"/>
36+
<Using Include="Microsoft.AspNetCore.Components"/>
37+
<Using Include="UnitTest.Core"/>
38+
</ItemGroup>
39+
4340
</Project>

test/UnitTest/UnitTest.csproj

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

33
<ItemGroup>
44
<PackageReference Include="bunit" Version="1.*" />
55
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.*" />
6-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
7-
<PackageReference Include="xunit" Version="2.*" />
8-
<PackageReference Include="xunit.runner.visualstudio" Version="3.*">
9-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
10-
<PrivateAssets>all</PrivateAssets>
11-
</PackageReference>
12-
<PackageReference Include="coverlet.collector" Version="6.*">
13-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
14-
<PrivateAssets>all</PrivateAssets>
15-
</PackageReference>
166
</ItemGroup>
177

188
<ItemGroup>
@@ -58,4 +48,11 @@
5848
</None>
5949
</ItemGroup>
6050

51+
<ItemGroup>
52+
<Using Include="BootstrapBlazor.Components"/>
53+
<Using Include="Bunit"/>
54+
<Using Include="Microsoft.AspNetCore.Components"/>
55+
<Using Include="UnitTest.Core"/>
56+
</ItemGroup>
57+
6158
</Project>

test/UnitTestDocs/UnitTestDocs.csproj

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

3-
<PropertyGroup>
4-
<IsPackable>false</IsPackable>
5-
<IsTestProject>true</IsTestProject>
6-
</PropertyGroup>
7-
83
<ItemGroup>
94
<Compile Include="..\..\src\BootstrapBlazor.Server\Extensions\MenusLocalizerExtensions.cs" Link="Extensions\MenusLocalizerExtensions.cs" />
105
<Compile Include="..\..\src\BootstrapBlazor.Server\Services\MenuService.cs" Link="Services\MenuService.cs" />
116
</ItemGroup>
127

13-
<ItemGroup>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
15-
<PackageReference Include="xunit" Version="2.*" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
17-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18-
<PrivateAssets>all</PrivateAssets>
19-
</PackageReference>
20-
<PackageReference Include="coverlet.collector" Version="6.*">
21-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22-
<PrivateAssets>all</PrivateAssets>
23-
</PackageReference>
24-
</ItemGroup>
25-
268
<ItemGroup>
279
<Using Include="BootstrapBlazor.Components" />
2810
<Using Include="BootstrapBlazor.Server.Components" />
@@ -32,8 +14,6 @@
3214
<Using Include="Microsoft.AspNetCore.Components" />
3315
<Using Include="Microsoft.Extensions.Localization" />
3416
<Using Include="System.ComponentModel.DataAnnotations" />
35-
<Using Remove="Bunit" />
36-
<Using Remove="UnitTest.Core" />
3717
</ItemGroup>
3818

3919
<ItemGroup>

0 commit comments

Comments
 (0)