Skip to content

Commit

Permalink
Prepare repo for .NET 8 (#1208)
Browse files Browse the repository at this point in the history
* Bump major version

* Update to NServiceBus 9

* Update Microsoft packages

* Remove ifdefs and pragmas

* Update workflows

* Clean up project files

* Remove dependency that is provided by Core

* Clean up project file

* Update API approval file
  • Loading branch information
bording authored Sep 22, 2023
1 parent 3b1bfec commit 4afc804
Show file tree
Hide file tree
Showing 26 changed files with 87 additions and 340 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
strategy:
matrix:
include:
- os: windows-2019
- os: windows-2022
name: Windows
- os: ubuntu-20.04
- os: ubuntu-22.04
name: Linux
fail-fast: false
steps:
Expand All @@ -33,9 +33,8 @@ jobs:
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: |
7.0.x
6.0.x
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Azure login
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ env:
DOTNET_NOLOGO: true
jobs:
release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Sign NuGet packages
Expand All @@ -36,4 +37,4 @@ jobs:
- name: Deploy
uses: Particular/[email protected]
with:
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }}
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }}
2 changes: 1 addition & 1 deletion src/Custom.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<MinVerMinimumMajorMinor>8.1</MinVerMinimumMajorMinor>
<MinVerMinimumMajorMinor>9.0</MinVerMinimumMajorMinor>
<MinVerAutoIncrement>minor</MinVerAutoIncrement>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ public static async Task DeleteDatabase(string dbName, CancellationToken cancell
break;
}
}
#pragma warning disable IDE0083
catch (Exception ex) when (!(ex is OperationCanceledException) || !cancellationToken.IsCancellationRequested)
#pragma warning restore IDE0083
catch (Exception ex) when (ex is not OperationCanceledException || !cancellationToken.IsCancellationRequested)
{
if (triesLeft == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@ static bool ListenerIsRegistered(IDocumentStore store)
{
var eventField = typeof(DocumentStoreBase).GetField("OnBeforeConversionToEntity", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField);

#pragma warning disable IDE0078
#pragma warning disable IDE0083
if (!(eventField.GetValue(store) is EventHandler<BeforeConversionToEntityEventArgs> eventDelegate))
if (eventField.GetValue(store) is not EventHandler<BeforeConversionToEntityEventArgs> eventDelegate)
{
return false;
}
#pragma warning restore IDE0083
#pragma warning restore IDE0078

foreach (var existingHandler in eventDelegate.GetInvocationList())
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -10,14 +10,14 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.1.1" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.4" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.104" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointInMemoryPersistence.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointLearningPersistence.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConventionEnforcementTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ public static async Task DeleteDatabase(string dbName, CancellationToken cancell
break;
}
}
#pragma warning disable IDE0083
catch (Exception ex) when (!(ex is OperationCanceledException) || !cancellationToken.IsCancellationRequested)
#pragma warning restore IDE0083
catch (Exception ex) when (ex is not OperationCanceledException || !cancellationToken.IsCancellationRequested)
{
if (triesLeft == 0)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>NServiceBus.RavenDB.AcceptanceTests</RootNamespace>
</PropertyGroup>

Expand All @@ -11,8 +11,8 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.1.1" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.4" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.104" />
Expand All @@ -22,7 +22,7 @@
<Compile Include="..\NServiceBus.RavenDB.AcceptanceTests\**\*.cs" Exclude="**\obj\**" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointInMemoryPersistence.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointLearningPersistence.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConventionEnforcementTests.cs" />
Expand All @@ -43,7 +43,9 @@
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\TimeToBeReceived\*.*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Tx\**\*.*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Versioning\*.*" />
</ItemGroup>

<ItemGroup>
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\When_storing_saga_with_high_contention.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\ConfigureEndpointRavenDBPersistence.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\TestSuiteConstraints.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\NServiceBus.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>..\NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -12,9 +12,8 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus" Version="8.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.4" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Particular.Approvals" Version="0.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ public static async Task DeleteDatabase(string dbName, CancellationToken cancell
break;
}
}
#pragma warning disable IDE0083
catch (Exception ex) when (!(ex is OperationCanceledException) || !cancellationToken.IsCancellationRequested)
#pragma warning restore IDE0083
catch (Exception ex) when (ex is not OperationCanceledException || !cancellationToken.IsCancellationRequested)
{
if (triesLeft == 0)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>NServiceBus.RavenDB.AcceptanceTests</RootNamespace>
</PropertyGroup>

Expand All @@ -11,8 +11,8 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.1.1" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.4" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.104" />
Expand All @@ -22,7 +22,7 @@
<Compile Include="..\NServiceBus.RavenDB.AcceptanceTests\**\*.cs" Exclude="**\obj\**" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointInMemoryPersistence.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointLearningPersistence.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConventionEnforcementTests.cs" />
Expand All @@ -43,7 +43,9 @@
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\TimeToBeReceived\*.*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Tx\**\*.*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Versioning\*.*" />
</ItemGroup>

<ItemGroup>
<!-- The high contention test is only relevant for pessimistic concurrency control -->
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\When_storing_saga_with_high_contention.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\ConfigureEndpointRavenDBPersistence.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ public static async Task DeleteDatabase(string dbName, CancellationToken cancell
break;
}
}
#pragma warning disable IDE0083
catch (Exception ex) when (!(ex is OperationCanceledException) || !cancellationToken.IsCancellationRequested)
#pragma warning restore IDE0083
catch (Exception ex) when (ex is not OperationCanceledException || !cancellationToken.IsCancellationRequested)
{
if (triesLeft == 0)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>NServiceBus.RavenDB.AcceptanceTests</RootNamespace>
</PropertyGroup>

Expand All @@ -11,8 +11,8 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="8.1.1" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.4" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.104" />
Expand All @@ -22,7 +22,7 @@
<Compile Include="..\NServiceBus.RavenDB.AcceptanceTests\**\*.cs" Exclude="**\obj\**" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointInMemoryPersistence.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConfigureEndpointLearningPersistence.cs" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\ConventionEnforcementTests.cs" />
Expand All @@ -43,7 +43,9 @@
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\TimeToBeReceived\*.*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Tx\**\*.*" />
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Versioning\*.*" />
</ItemGroup>

<ItemGroup>
<!-- The high contention test is only relevant for pessimistic concurrency control -->
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\When_storing_saga_with_high_contention.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\ConfigureEndpointRavenDBPersistence.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Test.snk</AssemblyOriginatorKeyFile>
<LangVersion>10.0</LangVersion>
<AssemblyOriginatorKeyFile>..\NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,16 +12,11 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus.PersistenceTests.Sources" Version="8.1.1" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="NServiceBus.PersistenceTests.Sources" Version="9.0.0-alpha.4" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.104" />
</ItemGroup>

<ItemGroup>
<!-- To remove when https://github.com/Particular/NServiceBus/pull/6603 is merged and released -->
<Compile Remove="$(PkgNServiceBus_PersistenceTests_Sources)\**\When_updating_saga_concurrently_on_same_thread.cs" />
<Compile Remove="$(PkgNServiceBus_PersistenceTests_Sources)\**\When_updating_saga_concurrently_twice_on_the_same_thread.cs" />
</ItemGroup>
</Project>
Loading

0 comments on commit 4afc804

Please sign in to comment.