Skip to content

Commit

Permalink
[csharp] update TFM to net6 and net8 (#799)
Browse files Browse the repository at this point in the history
* [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]>
  • Loading branch information
catcherwong authored Aug 7, 2024
1 parent 950652b commit bd2588a
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 26 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/csharp_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions csharp/examples/examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
6 changes: 3 additions & 3 deletions csharp/rocketmq-client-csharp/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
using System.Linq;
using Microsoft.Extensions.Logging;
using Proto = Apache.Rocketmq.V2;
using grpc = Grpc.Core;
using grpcLib = Grpc.Core;

namespace Org.Apache.Rocketmq
{
Expand Down Expand Up @@ -390,9 +390,9 @@ private async void Heartbeat()
}
}

internal grpc.Metadata Sign()
internal grpcLib.Metadata Sign()
{
var metadata = new grpc::Metadata();
var metadata = new grpcLib::Metadata();
Signature.Sign(this, metadata);
return metadata;
}
Expand Down
4 changes: 2 additions & 2 deletions csharp/rocketmq-client-csharp/ClientManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = Grpc.Core;
using grpcLib = Grpc.Core;
using System.Collections.Generic;
using System.Linq;

Expand Down Expand Up @@ -89,7 +89,7 @@ public async Task Shutdown()
}
}

public grpc::AsyncDuplexStreamingCall<Proto::TelemetryCommand, Proto::TelemetryCommand> Telemetry(
public grpcLib::AsyncDuplexStreamingCall<Proto::TelemetryCommand, Proto::TelemetryCommand> Telemetry(
Endpoints endpoints)
{
return GetRpcClient(endpoints).Telemetry(_client.Sign());
Expand Down
1 change: 0 additions & 1 deletion csharp/rocketmq-client-csharp/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using System.Threading.Tasks;
using Grpc.Core;
using Microsoft.Extensions.Logging;
using grpc = Grpc.Core;
using Proto = Apache.Rocketmq.V2;

namespace Org.Apache.Rocketmq
Expand Down
4 changes: 2 additions & 2 deletions csharp/rocketmq-client-csharp/Signature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions csharp/rocketmq-client-csharp/rocketmq-client-csharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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" />
Expand Down
17 changes: 10 additions & 7 deletions csharp/tests/tests.csproj
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

0 comments on commit bd2588a

Please sign in to comment.