Skip to content

Commit

Permalink
Try previews of .NET/EF 9
Browse files Browse the repository at this point in the history
  • Loading branch information
bkoelman committed May 25, 2024
1 parent 7b5db17 commit dedc89f
Show file tree
Hide file tree
Showing 23 changed files with 61 additions and 26 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
dotnet-version: |
6.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'
- name: Setup PowerShell (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
Expand Down Expand Up @@ -196,6 +198,8 @@ jobs:
dotnet-version: |
6.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'
- name: Git checkout
uses: actions/checkout@v4
- name: Restore tools
Expand Down Expand Up @@ -251,6 +255,8 @@ jobs:
dotnet-version: |
6.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'
- name: Git checkout
uses: actions/checkout@v4
with:
Expand All @@ -263,6 +269,9 @@ jobs:
dotnet restore
- name: CleanupCode (on PR diff)
if: github.event_name == 'pull_request'
env:
# Workaround for https://github.com/dotnet/runtime/issues/64103
COMPlus_ReadyToRun: 0
shell: pwsh
run: |
# Not using the environment variables for SHAs, because they may be outdated. This may happen on force-push after the build is queued, but before it starts.
Expand All @@ -274,6 +283,9 @@ jobs:
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
- name: CleanupCode (on branch)
if: github.event_name == 'push' || github.event_name == 'release'
env:
# Workaround for https://github.com/dotnet/runtime/issues/64103
COMPlus_ReadyToRun: 0
shell: pwsh
run: |
Write-Output "Running code cleanup on all files."
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
dotnet-version: |
6.0.x
8.0.x
9.0.x
dotnet-quality: 'preview'
- name: Git checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
Expand Down
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);NU5104;NU1608</NoWarn>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.*" PrivateAssets="All" />
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.8.*" PrivateAssets="All" />
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>

Expand Down
16 changes: 16 additions & 0 deletions package-versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,27 @@
<XunitVersion>2.8.*</XunitVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net9.0'">
<!-- Published dependencies (only update on major version change) -->
<EntityFrameworkCoreFrozenVersion>9.0.0-preview.3.24172.4</EntityFrameworkCoreFrozenVersion>

<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
<AspNetCoreVersion>9.0.*-*</AspNetCoreVersion>
<EntityFrameworkCoreVersion>$(EntityFrameworkCoreFrozenVersion)</EntityFrameworkCoreVersion>
<EntityFrameworkCorePostgreSQLVersion>9.0.0-preview.3</EntityFrameworkCorePostgreSQLVersion>
<EntityFrameworkCorePomeloVersion>9.0.0-preview.1</EntityFrameworkCorePomeloVersion>
<SystemTextJsonVersion>$(AspNetCoreVersion)</SystemTextJsonVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<!-- Published dependencies (only update on major version change) -->
<EntityFrameworkCoreFrozenVersion>8.0.0</EntityFrameworkCoreFrozenVersion>

<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
<AspNetCoreVersion>8.0.*</AspNetCoreVersion>
<EntityFrameworkCoreVersion>8.0.*</EntityFrameworkCoreVersion>
<EntityFrameworkCorePostgreSQLVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCorePostgreSQLVersion>
<EntityFrameworkCorePomeloVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCorePomeloVersion>
<SystemTextJsonVersion>$(AspNetCoreVersion)</SystemTextJsonVersion>
</PropertyGroup>

Expand All @@ -37,6 +51,8 @@
<AspNetCoreVersion>6.0.*</AspNetCoreVersion>
<DateOnlyTimeOnlyVersion>2.1.*</DateOnlyTimeOnlyVersion>
<EntityFrameworkCoreVersion>7.0.*</EntityFrameworkCoreVersion>
<EntityFrameworkCorePostgreSQLVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCorePostgreSQLVersion>
<EntityFrameworkCorePomeloVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCorePomeloVersion>
<SystemTextJsonVersion>7.0.*</SystemTextJsonVersion>
</PropertyGroup>
</Project>
10 changes: 5 additions & 5 deletions src/Examples/DapperExample/DapperExample.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\package-versions.props" />

<ItemGroup>
<ProjectReference Include="..\..\JsonApiDotNetCore\JsonApiDotNetCore.csproj" />
<ProjectReference Include="..\..\JsonApiDotNetCore.SourceGenerators\JsonApiDotNetCore.SourceGenerators.csproj" OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\JsonApiDotNetCore.SourceGenerators\JsonApiDotNetCore.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="$(DapperVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCorePostgreSQLVersion)" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="$(EntityFrameworkCorePomeloVersion)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\package-versions.props" />
Expand All @@ -13,6 +13,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCorePostgreSQLVersion)" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Examples/GettingStarted/GettingStarted.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\package-versions.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\package-versions.props" />
Expand All @@ -13,6 +13,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCorePostgreSQLVersion)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\package-versions.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\package-versions.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/Examples/ReportsExample/ReportsExample.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\package-versions.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0;netstandard1.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0;netstandard1.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RootNamespace>JsonApiDotNetCore</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/AnnotationTests/AnnotationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\package-versions.props" />
Expand Down
2 changes: 1 addition & 1 deletion test/DapperTests/DapperTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\package-versions.props" />
Expand Down
2 changes: 1 addition & 1 deletion test/DiscoveryTests/DiscoveryTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\package-versions.props" />
Expand Down
2 changes: 1 addition & 1 deletion test/JsonApiDotNetCoreTests/JsonApiDotNetCoreTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\package-versions.props" />
Expand Down
2 changes: 1 addition & 1 deletion test/MultiDbContextTests/MultiDbContextTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\package-versions.props" />
Expand Down
2 changes: 1 addition & 1 deletion test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\package-versions.props" />
Expand Down
2 changes: 1 addition & 1 deletion test/SourceGeneratorTests/SourceGeneratorTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\package-versions.props" />
Expand Down
4 changes: 2 additions & 2 deletions test/TestBuildingBlocks/TestBuildingBlocks.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\package-versions.props" />
Expand All @@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCorePostgreSQLVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" PrivateAssets="All" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\package-versions.props" />
Expand Down

0 comments on commit dedc89f

Please sign in to comment.