Skip to content

Commit

Permalink
Update target frameworks to recommended versions
Browse files Browse the repository at this point in the history
Update packages to latest versions

Fixes #1172
  • Loading branch information
lukebakken committed Apr 6, 2022
1 parent 08d4417 commit 9e76201
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 39 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
submodules: true
- name: Cache installers
uses: actions/cache@v2
uses: actions/cache@v3
with:
# Note: the cache path is relative to the workspace directory
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action
Expand Down Expand Up @@ -66,11 +66,11 @@ jobs:
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v2
with:
dotnet-version: 3.1.x
dotnet-version: 6.x
- name: Cache NuGet packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.nuget/packages
Expand All @@ -83,6 +83,6 @@ jobs:
- name: Build
run: dotnet build --no-restore --verbosity=normal
- name: Test
run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework "netcoreapp3.1"
run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework "net6.0"
env:
RABBITMQ_RABBITMQCTL_PATH: DOCKER:${{job.services.rabbitmq.id}}
11 changes: 5 additions & 6 deletions projects/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<OutputType>Exe</OutputType>
<AssemblyOriginatorKeyFile>../rabbit.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<TargetFrameworks>netcoreapp3.1;net48</TargetFrameworks>
<ReleaseVersion>8.0</ReleaseVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="Ductus.FluentDocker" Version="2.7.3" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="Ductus.FluentDocker" Version="2.10.45" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\RabbitMQ.Client\RabbitMQ.Client.csproj" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
</ItemGroup>

</Project>
22 changes: 7 additions & 15 deletions projects/RabbitMQ.Client/RabbitMQ.Client.csproj
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>netcoreapp3.1;netstandard2.0</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyTitle>RabbitMQ Client Library for .NET</AssemblyTitle>
Expand Down Expand Up @@ -36,11 +36,6 @@
<Deterministic>true</Deterministic>
</PropertyGroup>

<!-- disable nullable warnings for .NET Standard 2.0 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<NoWarn>$(NoWarn);nullable</NoWarn>
</PropertyGroup>

<Target Name="SetVersionFromConcourseData" AfterTargets="MinVer" Condition="'$(CONCOURSE_PULL_REQUEST_NUMBER)' != ''">
<PropertyGroup>
<PackageVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)-$(MinVerPreRelease)-pr.$(CONCOURSE_PULL_REQUEST_NUMBER)</PackageVersion>
Expand All @@ -62,15 +57,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="2.4.0" PrivateAssets="All" />
<PackageReference Include="System.Threading.Channels" Version="5.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="3.1.0" PrivateAssets="All" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Threading.Channels" Version="6.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" PrivateAssets="All" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private IAuthMechanismFactory GetAuthMechanismFactory(string supportedMechanismN
// Our list is in order of preference, the server one is not.
foreach (var factory in _config.AuthMechanisms)
{
if (supportedMechanismNames.Contains(factory.Name, StringComparison.OrdinalIgnoreCase))
if (supportedMechanismNames.IndexOf(factory.Name, StringComparison.OrdinalIgnoreCase) >= 0)
{
return factory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion projects/TestApplications/MassPublish/MassPublish.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion projects/Unit/RabbitMQCtl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ namespace RabbitMQ.Client.Unit
#nullable enable
public static class RabbitMQCtl
{
private static readonly char[] newLine = new char[] { '\n' };
private static readonly Func<string, Process> s_invokeRabbitMqCtl = GetRabbitMqCtlInvokeAction();

private static Func<string, Process> GetRabbitMqCtlInvokeAction()
Expand Down Expand Up @@ -209,7 +210,8 @@ public static void CloseAllConnections()

private static string[] EnumerateConnectionsPid()
{
return ExecRabbitMQCtl("list_connections --silent pid").Split('\n', StringSplitOptions.RemoveEmptyEntries);
string rabbitmqCtlResult = ExecRabbitMQCtl("list_connections --silent pid");
return rabbitmqCtlResult.Split(newLine, StringSplitOptions.RemoveEmptyEntries);
}

public static void RestartRabbitMQ()
Expand Down
2 changes: 0 additions & 2 deletions projects/Unit/TestChannelAllocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

namespace RabbitMQ.Client.Unit
{


public class TestIModelAllocation : IDisposable
{
public const int CHANNEL_COUNT = 100;
Expand Down
12 changes: 6 additions & 6 deletions projects/Unit/Unit.csproj
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>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<AssemblyOriginatorKeyFile>../rabbit.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<LangVersion>latest</LangVersion>
Expand All @@ -13,15 +13,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
<PackageReference Include="PublicApiGenerator" Version="10.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" />
<PackageReference Include="PublicApiGenerator" Version="10.3.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Verify.Xunit" Version="11.18.2" />
<PackageReference Include="Verify.Xunit" Version="16.5.4" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ fi

cd "$script_dir"

dotnet test --no-build --logger 'console;verbosity=detailed' --framework 'netcoreapp3.1' ./RabbitMQDotNetClient.sln < /dev/null
dotnet test --no-build --logger 'console;verbosity=detailed' --framework 'net6.0' ./RabbitMQDotNetClient.sln < /dev/null

0 comments on commit 9e76201

Please sign in to comment.