Skip to content

Commit f9dc48f

Browse files
committed
Update to .NET 8 and EF Core 8 RC1
1 parent 1c64675 commit f9dc48f

File tree

9 files changed

+25
-21
lines changed

9 files changed

+25
-21
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ jobs:
4747
- name: Setup .NET
4848
uses: actions/setup-dotnet@v3
4949
with:
50-
dotnet-version: 7.0.x
50+
dotnet-version: 8.0.x
51+
dotnet-quality: 'preview'
5152
- name: Setup PowerShell (Ubuntu)
5253
if: matrix.os == 'ubuntu-latest'
5354
run: |
@@ -174,7 +175,7 @@ jobs:
174175
run: |
175176
$inspectCodeOutputPath = Join-Path $env:RUNNER_TEMP 'jetbrains-inspectcode-results.xml'
176177
Write-Output "INSPECT_CODE_OUTPUT_PATH=$inspectCodeOutputPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
177-
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$inspectCodeOutputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:ContinuousIntegrationBuild=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
178+
dotnet jb inspectcode JsonApiDotNetCore.sln --dotnetcoresdk=8.0.100-rc.1.23463.5 --build --output="$inspectCodeOutputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:ContinuousIntegrationBuild=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
178179
- name: Verify outcome
179180
shell: pwsh
180181
run: |
@@ -235,13 +236,13 @@ jobs:
235236
$baseCommitHash = git rev-parse HEAD~1
236237
237238
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
238-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
239+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=8.0.100-rc.1.23463.5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
239240
- name: CleanupCode (on branch)
240241
if: github.event_name == 'push'
241242
shell: pwsh
242243
run: |
243244
Write-Output "Running code cleanup on all files."
244-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff
245+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb --dotnetcoresdk=8.0.100-rc.1.23463.5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff
245246
246247
publish:
247248
timeout-minutes: 60

Directory.Build.props

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFrameworkName>net7.0</TargetFrameworkName>
4-
<AspNetVersion>7.0.*</AspNetVersion>
5-
<EFCoreVersion>7.0.*</EFCoreVersion>
6-
<EFCorePostgresVersion>7.0.*</EFCorePostgresVersion>
3+
<TargetFrameworkName>net8.0</TargetFrameworkName>
4+
<AspNetVersion>8.0.0-rc.1.*</AspNetVersion>
5+
<EFCoreVersion>8.0.0-rc.1.*</EFCoreVersion>
6+
<EFCorePostgresVersion>8.0.0-rc.1</EFCorePostgresVersion>
77
<MicrosoftCodeAnalysisVersion>4.7.*</MicrosoftCodeAnalysisVersion>
88
<HumanizerVersion>2.14.1</HumanizerVersion>
9-
<JsonApiDotNetCoreVersionPrefix>5.3.1</JsonApiDotNetCoreVersionPrefix>
9+
<!-- workaround for "NU5104: A stable release of a package should not have a prerelease dependency." -->
10+
<JsonApiDotNetCoreVersionPrefix>5.3.1-net80</JsonApiDotNetCoreVersionPrefix>
1011
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
1112
<WarningLevel>9999</WarningLevel>
1213
<Nullable>enable</Nullable>
1314
<ImplicitUsings>enable</ImplicitUsings>
1415
<IsPackable>false</IsPackable>
1516
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
17+
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
1618
</PropertyGroup>
1719

1820
<ItemGroup>

cleanupcode.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ if ($revision) {
2828

2929
if ($baseCommitHash -eq $headCommitHash) {
3030
Write-Output "Running code cleanup on staged/unstaged files."
31-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified
31+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified --jb --dotnetcoresdk=8.0.100-rc.1.23463.5
3232
VerifySuccessExitCode
3333
}
3434
else {
3535
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash, including staged/unstaged files."
36-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
36+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash --jb --dotnetcoresdk=8.0.100-rc.1.23463.5
3737
VerifySuccessExitCode
3838
}
3939
}
4040
else {
4141
Write-Output "Running code cleanup on all files."
42-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN
42+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --jb --dotnetcoresdk=8.0.100-rc.1.23463.5
4343
VerifySuccessExitCode
4444
}

inspectcode.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if ($LastExitCode -ne 0) {
1010

1111
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
1212
$resultPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.html')
13-
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
13+
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal --dotnetcoresdk=8.0.100-rc.1.23463.5
1414

1515
if ($LastExitCode -ne 0) {
1616
throw "Code inspection failed with exit code $LastExitCode"

src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<NoWarn>$(NoWarn);NU5128</NoWarn>
88
<LangVersion>latest</LangVersion>
99
<IsRoslynComponent>true</IsRoslynComponent>
10+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
1011
</PropertyGroup>
1112

1213
<PropertyGroup>
@@ -46,6 +47,6 @@
4647

4748
<ItemGroup>
4849
<PackageReference Include="Humanizer.Core" Version="$(HumanizerVersion)" PrivateAssets="all" GeneratePathProperty="true" />
49-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" PrivateAssets="all" />
50+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all" />
5051
</ItemGroup>
5152
</Project>

src/JsonApiDotNetCore/JsonApiDotNetCore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
<ItemGroup>
3939
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
4040
<PackageReference Include="Humanizer.Core" Version="$(HumanizerVersion)" />
41-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
42-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.0" />
41+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(EFCoreVersion)" />
42+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
4343
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
4444
<PackageReference Include="SauceControl.InheritDoc" Version="1.3.0" PrivateAssets="All" />
4545
</ItemGroup>

src/JsonApiDotNetCore/Serialization/Response/FingerprintGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace JsonApiDotNetCore.Serialization.Response;
66
/// <inheritdoc cref="IFingerprintGenerator" />
77
internal sealed class FingerprintGenerator : IFingerprintGenerator
88
{
9-
private static readonly byte[] Separator = Encoding.UTF8.GetBytes("|");
9+
private static readonly byte[] Separator = "|"u8.ToArray();
1010
private static readonly uint[] LookupTable = Enumerable.Range(0, 256).Select(ToLookupEntry).ToArray();
1111

1212
private static uint ToLookupEntry(int index)

test/JsonApiDotNetCoreTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public async Task ApiController_attribute_transforms_NotFound_action_result_with
3333

3434
ErrorObject error = responseDocument.Errors[0];
3535
error.Links.ShouldNotBeNull();
36-
error.Links.About.Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.4");
36+
error.Links.About.Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.5");
3737
}
3838

3939
[Fact]
@@ -66,15 +66,15 @@ public async Task ProblemDetails_from_invalid_ModelState_is_translated_into_erro
6666
ErrorObject error1 = responseDocument.Errors[0];
6767
error1.StatusCode.Should().Be(HttpStatusCode.BadRequest);
6868
error1.Links.ShouldNotBeNull();
69-
error1.Links.About.Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.1");
69+
error1.Links.About.Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.1");
7070
error1.Title.Should().Be("One or more validation errors occurred.");
7171
error1.Detail.Should().Be("The Name field is required.");
7272
error1.Source.Should().BeNull();
7373

7474
ErrorObject error2 = responseDocument.Errors[1];
7575
error2.StatusCode.Should().Be(HttpStatusCode.BadRequest);
7676
error2.Links.ShouldNotBeNull();
77-
error2.Links.About.Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.1");
77+
error2.Links.About.Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.1");
7878
error2.Title.Should().Be("One or more validation errors occurred.");
7979
error2.Detail.Should().Be("The field YearOfBirth must be between 1900 and 2050.");
8080
error2.Source.Should().BeNull();

test/JsonApiDotNetCoreTests/JsonApiDotNetCoreTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(EFCoreVersion)" />
1818
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="$(EFCoreVersion)" />
1919
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
20-
<PackageReference Include="System.Text.Json" Version="7.0.*" />
20+
<PackageReference Include="System.Text.Json" Version="$(AspNetVersion)" />
2121
</ItemGroup>
2222
</Project>

0 commit comments

Comments
 (0)