This is an automated email from the ASF dual-hosted git repository.
lizhanhui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
The following commit(s) were added to refs/heads/master by this push:
new bd2588a0 [csharp] update TFM to net6 and net8 (#799)
bd2588a0 is described below
commit bd2588a0847cfdd72a4bc1cdaf943a03be60b3c4
Author: Catcher Wong <[email protected]>
AuthorDate: Wed Aug 7 10:24:38 2024 +0800
[csharp] update TFM to net6 and net8 (#799)
* [csharp] update TFM to net6 and net8
Signed-off-by: catcherwong <[email protected]>
* update ci from macos-11 to macos-12
Signed-off-by: catcherwong <[email protected]>
---------
Signed-off-by: catcherwong <[email protected]>
---
.github/workflows/csharp_build.yml | 5 +----
csharp/examples/examples.csproj | 4 ++--
csharp/rocketmq-client-csharp/Client.cs | 6 +++---
csharp/rocketmq-client-csharp/ClientManager.cs | 4 ++--
csharp/rocketmq-client-csharp/Session.cs | 1 -
csharp/rocketmq-client-csharp/Signature.cs | 4 ++--
.../rocketmq-client-csharp.csproj | 10 +++++-----
csharp/tests/tests.csproj | 17 ++++++++++-------
8 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/.github/workflows/csharp_build.yml
b/.github/workflows/csharp_build.yml
index 04546d2f..13a4db0c 100644
--- a/.github/workflows/csharp_build.yml
+++ b/.github/workflows/csharp_build.yml
@@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [ubuntu-20.04, macos-11, windows-2022]
+ os: [ubuntu-20.04, macos-12, windows-2022]
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -18,11 +18,8 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
- 5.0.x
6.0.x
- 7.0.x
8.0.x
- 3.1.x
- name: Build artifacts
working-directory: ./csharp
run: |
diff --git a/csharp/examples/examples.csproj b/csharp/examples/examples.csproj
index 34e14655..905e6a04 100644
--- a/csharp/examples/examples.csproj
+++ b/csharp/examples/examples.csproj
@@ -3,12 +3,12 @@
<ProjectReference
Include="..\rocketmq-client-csharp\rocketmq-client-csharp.csproj" />
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Microsoft.Extensions.Logging.Console"
Version="3.1.32" />
+ <PackageReference Include="Microsoft.Extensions.Logging.Console"
Version="6.0.0" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
+ <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
</Project>
diff --git a/csharp/rocketmq-client-csharp/Client.cs
b/csharp/rocketmq-client-csharp/Client.cs
index f3ea4a87..1c81b410 100644
--- a/csharp/rocketmq-client-csharp/Client.cs
+++ b/csharp/rocketmq-client-csharp/Client.cs
@@ -23,7 +23,7 @@ using System;
using System.Linq;
using Microsoft.Extensions.Logging;
using Proto = Apache.Rocketmq.V2;
-using grpc = Grpc.Core;
+using grpcLib = Grpc.Core;
namespace Org.Apache.Rocketmq
{
@@ -390,9 +390,9 @@ namespace Org.Apache.Rocketmq
}
}
- internal grpc.Metadata Sign()
+ internal grpcLib.Metadata Sign()
{
- var metadata = new grpc::Metadata();
+ var metadata = new grpcLib::Metadata();
Signature.Sign(this, metadata);
return metadata;
}
diff --git a/csharp/rocketmq-client-csharp/ClientManager.cs
b/csharp/rocketmq-client-csharp/ClientManager.cs
index 90fdde7f..fed6f38c 100644
--- a/csharp/rocketmq-client-csharp/ClientManager.cs
+++ b/csharp/rocketmq-client-csharp/ClientManager.cs
@@ -19,7 +19,7 @@ using Proto = Apache.Rocketmq.V2;
using System;
using System.Threading;
using System.Threading.Tasks;
-using grpc = Grpc.Core;
+using grpcLib = Grpc.Core;
using System.Collections.Generic;
using System.Linq;
@@ -89,7 +89,7 @@ namespace Org.Apache.Rocketmq
}
}
- public grpc::AsyncDuplexStreamingCall<Proto::TelemetryCommand,
Proto::TelemetryCommand> Telemetry(
+ public grpcLib::AsyncDuplexStreamingCall<Proto::TelemetryCommand,
Proto::TelemetryCommand> Telemetry(
Endpoints endpoints)
{
return GetRpcClient(endpoints).Telemetry(_client.Sign());
diff --git a/csharp/rocketmq-client-csharp/Session.cs
b/csharp/rocketmq-client-csharp/Session.cs
index ac66d5b7..d47b6060 100644
--- a/csharp/rocketmq-client-csharp/Session.cs
+++ b/csharp/rocketmq-client-csharp/Session.cs
@@ -20,7 +20,6 @@ using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
using Microsoft.Extensions.Logging;
-using grpc = Grpc.Core;
using Proto = Apache.Rocketmq.V2;
namespace Org.Apache.Rocketmq
diff --git a/csharp/rocketmq-client-csharp/Signature.cs
b/csharp/rocketmq-client-csharp/Signature.cs
index ea701d16..949ac49c 100644
--- a/csharp/rocketmq-client-csharp/Signature.cs
+++ b/csharp/rocketmq-client-csharp/Signature.cs
@@ -18,14 +18,14 @@
using System;
using System.Collections.Generic;
using System.Text;
-using grpc = Grpc.Core;
+using grpcLib = Grpc.Core;
using System.Security.Cryptography;
namespace Org.Apache.Rocketmq
{
public static class Signature
{
- public static void Sign(Client client, grpc::Metadata metadata)
+ public static void Sign(Client client, grpcLib::Metadata metadata)
{
var headers = Sign(client);
foreach (var (key, value) in headers)
diff --git a/csharp/rocketmq-client-csharp/rocketmq-client-csharp.csproj
b/csharp/rocketmq-client-csharp/rocketmq-client-csharp.csproj
index b13ea1d1..5fe87fcd 100644
--- a/csharp/rocketmq-client-csharp/rocketmq-client-csharp.csproj
+++ b/csharp/rocketmq-client-csharp/rocketmq-client-csharp.csproj
@@ -6,7 +6,7 @@
<Authors>RocketMQ Authors</Authors>
<Company>Apache Software Foundation</Company>
- <TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
+ <TargetFrameworks>net6.0;net8.0;</TargetFrameworks>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RootNamespace>Org.Apache.Rocketmq</RootNamespace>
<PackageReadmeFile>README.md</PackageReadmeFile>
@@ -23,13 +23,13 @@
<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
<PackageReference Include="Crc32.NET" Version="1.2.0" />
- <PackageReference Include="Google.Protobuf" Version="3.19.4" />
- <PackageReference Include="Grpc.Net.Client" Version="2.43.0" />
- <PackageReference Include="Grpc.Tools" Version="2.43.0">
+ <PackageReference Include="Google.Protobuf" Version="3.27.2" />
+ <PackageReference Include="Grpc.Net.Client" Version="2.63.0" />
+ <PackageReference Include="Grpc.Tools" Version="2.64.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers;
buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
- <PackageReference Include="Microsoft.Extensions.Logging.Abstractions"
Version="3.1.32" />
+ <PackageReference Include="Microsoft.Extensions.Logging.Abstractions"
Version="6.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.4" />
<PackageReference Include="OpenTelemetry" Version="1.3.1" />
<PackageReference Include="OpenTelemetry.Api" Version="1.3.1" />
diff --git a/csharp/tests/tests.csproj b/csharp/tests/tests.csproj
index 1e3b9fee..c16faa0f 100644
--- a/csharp/tests/tests.csproj
+++ b/csharp/tests/tests.csproj
@@ -1,18 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
+ <TargetFrameworks>net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="Microsoft.Extensions.Logging.Console"
Version="3.1.32" />
- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
- <PackageReference Include="Moq" Version="4.16.1" />
- <PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
- <PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
- <PackageReference Include="coverlet.collector" Version="3.0.2" />
+ <PackageReference Include="Microsoft.Extensions.Logging.Console"
Version="8.0.0" />
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
+ <PackageReference Include="Moq" Version="4.20.70" />
+ <PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
+ <PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
+ <PackageReference Include="coverlet.collector" Version="6.0.2">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers;
buildtransitive</IncludeAssets>
+ </PackageReference>
</ItemGroup>
<ItemGroup>