Skip to content

Commit 5d63cd5

Browse files
committed
⬆️ Upgrading to .NET 8
- Bumping the package to version 8 to keep in sync with the target framework - Adding Just to colocate commands
1 parent de2393e commit 5d63cd5

File tree

8 files changed

+173
-116
lines changed

8 files changed

+173
-116
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ jobs:
2121
- name: Set up .NET
2222
uses: actions/setup-dotnet@v5
2323
with:
24-
dotnet-version: "6.0.x"
24+
dotnet-version: "8.0.x"
2525

2626
- name: Restore dependencies
2727
run: dotnet restore
2828

2929
- name: Run the build
3030
run: dotnet build --configuration Release
3131

32-
# - name: Run tests
33-
# run: dotnet test
32+
- name: Run tests
33+
run: dotnet test
3434

3535
- name: Pack the project
3636
run: dotnet pack --configuration Release --no-restore --output ${{ github.workspace }}/nuget

.vscode/extensions.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"ms-dotnettools.csdevkit",
77
"ms-dotnettools.csharp",
88
"ms-vscode.powershell",
9+
"nefrob.vscode-just-syntax",
910
"redhat.vscode-yaml",
1011
"streetsidesoftware.code-spell-checker",
11-
"yzhang.markdown-all-in-one",
12+
"yzhang.markdown-all-in-one"
1213
],
1314
"unwantedRecommendations": []
14-
}
15+
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![NuGet package](https://img.shields.io/nuget/v/WhatIsHeDoing.DomainModels.svg)][NuGet]
44
[![NuGet downloads](https://img.shields.io/nuget/dt/WhatIsHeDoing.DomainModels.svg)][NuGet]
5+
[![build](https://github.com/WhatIsHeDoing/WhatIsHeDoing.DomainModels/actions/workflows/build.yml/badge.svg)](https://github.com/WhatIsHeDoing/WhatIsHeDoing.DomainModels/actions/workflows/build.yml)
56

67
A library of domain models for .NET.
78

@@ -23,16 +24,15 @@ such as calling a service. For example, the UK postcode `SE1 9XX` is valid, but
2324

2425
## 📡 Demo
2526

26-
See how the Swagger demo site - use `dotnet run --project WhatIsHeDoing.DomainModels.APITest` -
27-
handles URL, JSON and XML domain model de/serialisation.
27+
Run `just api` to see how the Swagger demo site handles URL, JSON and XML domain model de/serialisation.
2828

2929
![Web API](WhatIsHeDoing.DomainModels.APITest/swagger.png)
3030

3131
## 🦮 Usage
3232

3333
### Installing
3434

35-
This package is available via [NuGet], and targets .NET Core 2.2 for cross-platform use.
35+
This package is available via [NuGet] and targets .NET 8 for cross-platform use.
3636

3737
### The Models
3838

WhatIsHeDoing.DomainModels.APITest/Startup.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5353
{
5454
config.SwaggerEndpoint(
5555
"/swagger/v1/swagger.json", "WhatIsHeDoing.DomainModels");
56+
57+
config.RoutePrefix = string.Empty;
5658
});
5759
}
5860
}
Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
2-
<PropertyGroup>
3-
<TargetFramework>net5.0</TargetFramework>
4-
<IsPackable>false</IsPackable>
5-
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
6-
</PropertyGroup>
7-
8-
<PropertyGroup>
9-
<DocumentationFile>bin\net5.0\WhatIsHeDoing.DomainModels.APITest.xml</DocumentationFile>
10-
<OutputPath>bin\</OutputPath>
11-
<NoWarn>1591;1701;1702;1705;AD0001;SG0016</NoWarn>
12-
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
13-
<WarningsAsErrors />
14-
<CodeAnalysisRuleSet>..\WhatIsHeDoing.ruleset</CodeAnalysisRuleSet>
15-
</PropertyGroup>
16-
17-
<ItemGroup>
18-
<Folder Include="wwwroot\" />
19-
</ItemGroup>
20-
21-
<ItemGroup>
22-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
23-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
24-
<PackageReference Include="RoslynSecurityGuard" Version="2.3.0" />
25-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
26-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.2" />
27-
</ItemGroup>
28-
29-
<ItemGroup>
30-
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
31-
</ItemGroup>
32-
33-
<ItemGroup>
34-
<ProjectReference Include="..\WhatIsHeDoing.DomainModels\WhatIsHeDoing.DomainModels.csproj" />
35-
</ItemGroup>
36-
</Project>
2+
<PropertyGroup>
3+
<TargetFramework>net8.0</TargetFramework>
4+
<IsPackable>false</IsPackable>
5+
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
6+
</PropertyGroup>
7+
<PropertyGroup>
8+
<DocumentationFile>bin\net5.0\WhatIsHeDoing.DomainModels.APITest.xml</DocumentationFile>
9+
<OutputPath>bin\</OutputPath>
10+
<NoWarn>1591;1701;1702;1705;AD0001;SG0016</NoWarn>
11+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
12+
<WarningsAsErrors />
13+
<CodeAnalysisRuleSet>..\WhatIsHeDoing.ruleset</CodeAnalysisRuleSet>
14+
</PropertyGroup>
15+
<ItemGroup>
16+
<Folder Include="wwwroot\" />
17+
</ItemGroup>
18+
<ItemGroup>
19+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
20+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
21+
<PrivateAssets>all</PrivateAssets>
22+
</PackageReference>
23+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
24+
<PackageReference Include="RoslynSecurityGuard" Version="2.3.0" />
25+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
26+
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6" />
27+
</ItemGroup>
28+
<ItemGroup>
29+
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
30+
</ItemGroup>
31+
<ItemGroup>
32+
<ProjectReference Include="..\WhatIsHeDoing.DomainModels\WhatIsHeDoing.DomainModels.csproj" />
33+
</ItemGroup>
34+
</Project>
Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFramework>net5.0</TargetFramework>
4-
<IsPackable>false</IsPackable>
5-
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
6-
</PropertyGroup>
7-
8-
<PropertyGroup>
9-
<CodeAnalysisRuleSet>..\WhatIsHeDoing.ruleset</CodeAnalysisRuleSet>
10-
</PropertyGroup>
11-
12-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
13-
<DebugType>full</DebugType>
14-
<DebugSymbols>true</DebugSymbols>
15-
</PropertyGroup>
16-
17-
<ItemGroup>
18-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
20-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
21-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
22-
<PackageReference Include="xunit" Version="2.4.1" />
23-
<PackageReference Include="xunit.analyzers" Version="0.10.0" />
24-
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
25-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
26-
</ItemGroup>
27-
28-
<ItemGroup>
29-
<ProjectReference Include="..\WhatIsHeDoing.DomainModels\WhatIsHeDoing.DomainModels.csproj" />
30-
</ItemGroup>
31-
</Project>
2+
<PropertyGroup>
3+
<TargetFramework>net8.0</TargetFramework>
4+
<IsPackable>false</IsPackable>
5+
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
6+
</PropertyGroup>
7+
<PropertyGroup>
8+
<CodeAnalysisRuleSet>..\WhatIsHeDoing.ruleset</CodeAnalysisRuleSet>
9+
</PropertyGroup>
10+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
11+
<DebugType>full</DebugType>
12+
<DebugSymbols>true</DebugSymbols>
13+
</PropertyGroup>
14+
<ItemGroup>
15+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
16+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
17+
<PrivateAssets>all</PrivateAssets>
18+
</PackageReference>
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
20+
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
21+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
22+
<PackageReference Include="xunit" Version="2.9.3" />
23+
<PackageReference Include="xunit.analyzers" Version="1.24.0">
24+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25+
<PrivateAssets>all</PrivateAssets>
26+
</PackageReference>
27+
<PackageReference Include="xunit.runner.console" Version="2.9.3">
28+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
29+
<PrivateAssets>all</PrivateAssets>
30+
</PackageReference>
31+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
32+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
33+
<PrivateAssets>all</PrivateAssets>
34+
</PackageReference>
35+
</ItemGroup>
36+
<ItemGroup>
37+
<ProjectReference Include="..\WhatIsHeDoing.DomainModels\WhatIsHeDoing.DomainModels.csproj" />
38+
</ItemGroup>
39+
</Project>
Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>net5.0</TargetFrameworks>
4-
<PackageId>WhatIsHeDoing.DomainModels </PackageId>
5-
<PackageVersion>5.0.1</PackageVersion>
6-
<Authors>WhatIsHeDoing</Authors>
7-
<Description>A library of domain models for .NET.</Description>
8-
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
9-
<PackageReleaseNotes>Upgrading latest Core package</PackageReleaseNotes>
10-
<Copyright></Copyright>
11-
<PackageTags>domain models</PackageTags>
12-
<PackageLicenseExpression>Unlicense</PackageLicenseExpression>
13-
<PackageProjectUrl>https://github.com/WhatIsHeDoing/WhatIsHeDoing.DomainModels</PackageProjectUrl>
14-
<Version>5.0.1</Version>
15-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
16-
<Company />
17-
<RepositoryUrl>https://github.com/WhatIsHeDoing/WhatIsHeDoing.DomainModels</RepositoryUrl>
18-
<PackageReadmeFile>README.md</PackageReadmeFile>
19-
<IsPackable>true</IsPackable>
20-
</PropertyGroup>
21-
22-
<PropertyGroup>
23-
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
24-
<WarningsAsErrors />
25-
<CodeAnalysisRuleSet>..\WhatIsHeDoing.ruleset</CodeAnalysisRuleSet>
26-
</PropertyGroup>
27-
28-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|AnyCPU'">
29-
<DebugType>full</DebugType>
30-
<DebugSymbols>true</DebugSymbols>
31-
</PropertyGroup>
32-
33-
<ItemGroup>
34-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
35-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
36-
<PackageReference Include="RoslynSecurityGuard" Version="2.3.0" />
37-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
38-
<PackageReference Include="WhatIsHeDoing.Core" Version="4.0.0" />
39-
</ItemGroup>
40-
41-
<!-- https://devblogs.microsoft.com/dotnet/add-a-readme-to-your-nuget-package/ -->
42-
<ItemGroup>
43-
<None Include="..\README.md" Pack="true" PackagePath="\"/>
44-
</ItemGroup>
2+
<PropertyGroup>
3+
<TargetFrameworks>net8.0</TargetFrameworks>
4+
<PackageId>WhatIsHeDoing.DomainModels </PackageId>
5+
<PackageVersion>8.0.0</PackageVersion>
6+
<Authors>WhatIsHeDoing</Authors>
7+
<Description>A library of domain models for .NET.</Description>
8+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
9+
<PackageReleaseNotes>Upgrading latest Core package</PackageReleaseNotes>
10+
<Copyright>
11+
</Copyright>
12+
<PackageTags>domain models</PackageTags>
13+
<PackageLicenseExpression>Unlicense</PackageLicenseExpression>
14+
<PackageProjectUrl>https://github.com/WhatIsHeDoing/WhatIsHeDoing.DomainModels</PackageProjectUrl>
15+
<Version>5.0.1</Version>
16+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
17+
<Company />
18+
<RepositoryUrl>https://github.com/WhatIsHeDoing/WhatIsHeDoing.DomainModels</RepositoryUrl>
19+
<PackageReadmeFile>README.md</PackageReadmeFile>
20+
<IsPackable>true</IsPackable>
21+
</PropertyGroup>
22+
<PropertyGroup>
23+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
24+
<WarningsAsErrors />
25+
<CodeAnalysisRuleSet>..\WhatIsHeDoing.ruleset</CodeAnalysisRuleSet>
26+
</PropertyGroup>
27+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|AnyCPU'">
28+
<DebugType>full</DebugType>
29+
<DebugSymbols>true</DebugSymbols>
30+
</PropertyGroup>
31+
<ItemGroup>
32+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
33+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
34+
<PrivateAssets>all</PrivateAssets>
35+
</PackageReference>
36+
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
37+
<PackageReference Include="RoslynSecurityGuard" Version="2.3.0" />
38+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
39+
<PackageReference Include="WhatIsHeDoing.Core" Version="4.0.0" />
40+
</ItemGroup>
41+
<!-- https://devblogs.microsoft.com/dotnet/add-a-readme-to-your-nuget-package/ -->
42+
<ItemGroup>
43+
<None Include="..\README.md" Pack="true" PackagePath="\" />
44+
</ItemGroup>
4545
</Project>

justfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# 🧐 Default interactive selection command.
2+
default:
3+
@just --choose
4+
5+
# 🚀 Runs a full CI build.
6+
ci: build_release test_release pack
7+
8+
# 🛜 Installs dependencies.
9+
restore:
10+
dotnet restore
11+
12+
# 🔨 Builds the library in debug.
13+
[group("Debug")]
14+
build:
15+
dotnet build
16+
17+
# 🧪 Runs the debug test project.
18+
[group("Debug")]
19+
test:
20+
dotnet test
21+
22+
# 🔨 Builds the library in release.
23+
[group("Release")]
24+
build_release:
25+
dotnet build --configuration Release
26+
27+
# 🧪 Runs the released test project.
28+
[group("Release")]
29+
test_release:
30+
dotnet test --configuration Release
31+
32+
# 📦 Packages the project ready to publish to NuGet.
33+
[group("Release")]
34+
pack:
35+
dotnet pack --configuration Release --no-restore --output ./nuget
36+
37+
# 👀 Runs the demo API project.
38+
api:
39+
dotnet run --project WhatIsHeDoing.DomainModels.APITest
40+
41+
# ⬆️ Upgrades all library dependencies.
42+
outdated:
43+
dotnet outdated --upgrade
44+
45+
# ⬆️ Runs an interactive framework upgrade.
46+
upgrade:
47+
# https://learn.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-how-to-upgrade#upgrade-a-project-from-the-cli
48+
upgrade-assistant upgrade

0 commit comments

Comments
 (0)