Skip to content

Commit e418160

Browse files
thompson-tomolukebakken
authored andcommitted
Have added net 6 as a TFM and implement conditional packages
1 parent 13dbfdc commit e418160

File tree

6 files changed

+21
-16
lines changed

6 files changed

+21
-16
lines changed

.ci/versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"erlang": "26.0.2",
3-
"rabbitmq": "3.12.4"
2+
"erlang": "26.2.2",
3+
"rabbitmq": "3.12.12"
44
}

projects/RabbitMQ.Client.OAuth2/RabbitMQ.Client.OAuth2.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net462;netstandard2.0;net6.0</TargetFrameworks>
55
<NoWarn>$(NoWarn);CS1591</NoWarn>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
77
<AssemblyTitle>RabbitMQ OAuth2 Client Library for .NET</AssemblyTitle>
@@ -59,6 +59,9 @@
5959
<ItemGroup>
6060
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
6161
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="all" />
62+
</ItemGroup>
63+
64+
<ItemGroup Condition="$(TargetFramework) == 'net462' OR $(TargetFramework) == 'netstandard2.0'">
6265
<PackageReference Include="System.Net.Http.Json" Version="7.0.1" />
6366
<PackageReference Include="System.Text.Json" Version="7.0.2" />
6467
</ItemGroup>

projects/RabbitMQ.Client/RabbitMQ.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net462;netstandard2.0;net6.0</TargetFrameworks>
55
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
66
<NoWarn>$(NoWarn);CS1591</NoWarn>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -60,10 +60,10 @@
6060
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
6161

6262
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />
63-
<PackageReference Include="System.Threading.Channels" Version="7.0.0" />
6463
</ItemGroup>
6564

66-
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
65+
<ItemGroup Condition="$(TargetFramework) == 'net462' OR $(TargetFramework) == 'netstandard2.0'">
66+
<PackageReference Include="System.Threading.Channels" Version="7.0.0" />
6767
<PackageReference Include="System.Memory" Version="4.5.5" />
6868
</ItemGroup>
6969

projects/RabbitMQ.Client/client/logging/RabbitMqClientEventSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public RabbitMqClientEventSource() : base(EventSourceSettings.EtwSelfDescribingE
4747
{
4848
}
4949

50-
public static RabbitMqClientEventSource Log = new RabbitMqClientEventSource();
50+
public static readonly RabbitMqClientEventSource Log = new RabbitMqClientEventSource();
5151

5252
[Event(1, Message = "INFO", Keywords = Keywords.Log, Level = EventLevel.Informational)]
5353
public void Info(string message)

projects/RabbitMQ.Client/util/NetworkOrderDeserializer.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal static double ReadDouble(ReadOnlySpan<byte> span)
1515
throw new ArgumentOutOfRangeException(nameof(span), "Insufficient length to decode Double from memory.");
1616
}
1717
ulong val = ReadUInt64(span);
18-
#elif NETSTANDARD
18+
#else
1919
ulong val = BinaryPrimitives.ReadUInt64BigEndian(span);
2020
#endif
2121
return Unsafe.As<ulong, double>(ref val);
@@ -31,7 +31,7 @@ internal static short ReadInt16(ReadOnlySpan<byte> span)
3131
}
3232

3333
return (short)ReadUInt16(span);
34-
#elif NETSTANDARD
34+
#else
3535
return BinaryPrimitives.ReadInt16BigEndian(span);
3636
#endif
3737
}
@@ -46,7 +46,7 @@ internal static int ReadInt32(ReadOnlySpan<byte> span)
4646
}
4747

4848
return (int)ReadUInt32(span);
49-
#elif NETSTANDARD
49+
#else
5050
return BinaryPrimitives.ReadInt32BigEndian(span);
5151
#endif
5252
}
@@ -61,7 +61,7 @@ internal static long ReadInt64(ReadOnlySpan<byte> span)
6161
}
6262

6363
return (long)ReadUInt64(span);
64-
#elif NETSTANDARD
64+
#else
6565
return BinaryPrimitives.ReadInt64BigEndian(span);
6666
#endif
6767
}
@@ -76,7 +76,7 @@ internal static float ReadSingle(ReadOnlySpan<byte> span)
7676
}
7777

7878
uint num = ReadUInt32(span);
79-
#elif NETSTANDARD
79+
#else
8080
uint num = BinaryPrimitives.ReadUInt32BigEndian(span);
8181
#endif
8282
return Unsafe.As<uint, float>(ref num);
@@ -92,7 +92,7 @@ internal static ushort ReadUInt16(ReadOnlySpan<byte> span)
9292
}
9393

9494
return (ushort)((span[0] << 8) | span[1]);
95-
#elif NETSTANDARD
95+
#else
9696
return BinaryPrimitives.ReadUInt16BigEndian(span);
9797
#endif
9898
}
@@ -107,7 +107,7 @@ internal static uint ReadUInt32(ReadOnlySpan<byte> span)
107107
}
108108

109109
return (uint)((span[0] << 24) | (span[1] << 16) | (span[2] << 8) | span[3]);
110-
#elif NETSTANDARD
110+
#else
111111
return BinaryPrimitives.ReadUInt32BigEndian(span);
112112
#endif
113113
}
@@ -124,7 +124,7 @@ internal static ulong ReadUInt64(ReadOnlySpan<byte> span)
124124
uint num1 = (uint)((span[0] << 24) | (span[1] << 16) | (span[2] << 8) | span[3]);
125125
uint num2 = (uint)((span[4] << 24) | (span[5] << 16) | (span[6] << 8) | span[7]);
126126
return ((ulong)num1 << 32) | num2;
127-
#elif NETSTANDARD
127+
#else
128128
return BinaryPrimitives.ReadUInt64BigEndian(span);
129129
#endif
130130
}

projects/Unit/APIApproval.Approve.verified.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,10 +675,12 @@ namespace RabbitMQ.Client
675675
public static RabbitMQ.Client.TimerBasedCredentialRefresherEventSource Log { get; }
676676
[System.Diagnostics.Tracing.Event(6)]
677677
public void AlreadyRegistered(string name) { }
678+
[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification="Parameters to this method are primitive and are trimmer safe")]
678679
[System.Diagnostics.Tracing.Event(5)]
679680
public void RefreshedCredentials(string name, bool succesfully) { }
680681
[System.Diagnostics.Tracing.Event(1)]
681682
public void Registered(string name) { }
683+
[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification="Parameters to this method are primitive and are trimmer safe")]
682684
[System.Diagnostics.Tracing.Event(3)]
683685
public void ScheduledTimer(string name, double interval) { }
684686
[System.Diagnostics.Tracing.Event(4)]
@@ -985,7 +987,7 @@ namespace RabbitMQ.Client.Logging
985987
[System.Diagnostics.Tracing.EventSource(Name="rabbitmq-dotnet-client")]
986988
public sealed class RabbitMqClientEventSource : System.Diagnostics.Tracing.EventSource
987989
{
988-
public static RabbitMQ.Client.Logging.RabbitMqClientEventSource Log;
990+
public static readonly RabbitMQ.Client.Logging.RabbitMqClientEventSource Log;
989991
public RabbitMqClientEventSource() { }
990992
[System.Diagnostics.Tracing.Event(3, Keywords=System.Diagnostics.Tracing.EventKeywords.None, Level=System.Diagnostics.Tracing.EventLevel.Error, Message="ERROR")]
991993
public void Error(string message, RabbitMQ.Client.Logging.RabbitMqExceptionDetail ex) { }

0 commit comments

Comments
 (0)