Skip to content

Commit 2aa2ede

Browse files
committed
Remove hard coded service name from generator
1 parent 00c7d6e commit 2aa2ede

File tree

4 files changed

+16
-28
lines changed

4 files changed

+16
-28
lines changed

RSocket.Rpc.Protobuf/src/csharp_generator.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ void GenerateServerClass(Printer* out, const ServiceDescriptor* service) {
390390
}
391391
}
392392

393-
out->Print("static IAsyncEnumerable<byte[]> Dispatch(IEchoService service, ReadOnlySequence<byte> data, string method, in ReadOnlySequence<byte> tracing, in ReadOnlySequence<byte> metadata, IAsyncEnumerable<byte[]> messages)\n");
393+
out->Print("static IAsyncEnumerable<byte[]> Dispatch($interfacename$ service, ReadOnlySequence<byte> data, string method, in ReadOnlySequence<byte> tracing, in ReadOnlySequence<byte> metadata, IAsyncEnumerable<byte[]> messages)\n",
394+
"interfacename", GetInterfaceName(service));
394395
out->Print("{\n");
395396
out->Indent();
396397
out->Print("switch (method)\n");

RSocket.Rpc.Sample/EchoService.proto

-22
This file was deleted.

RSocket.Rpc.Sample/RSocket.Rpc.Sample.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
</ItemGroup>
4747

4848
<ItemGroup>
49-
<ProtoBuf Include="rsocket\options.proto" RSocketRpcServices="None" />
50-
<ProtoBuf Include="echo.proto" RSocketRpcServices="Both" />
49+
<ProtoBuf Include="rsocket\options.proto" />
50+
<ProtoBuf Include="**\*.proto" />
5151
</ItemGroup>
52-
52+
5353
</Project>

RSocket.Rpc.Tools/RSocket.Rpc.Tools.csproj

+11-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@ Linux and MacOS. Managed runtime is supplied separately in the RSocket.Rpc.Core
2828
<None Pack="true" PackagePath="build\" Include="build\**\*.xml; build\**\*.props; build\**\*.targets;" />
2929

3030
<!-- Protobuf assets (for Google.Protobuf.Tools) -->
31-
<_ProtoAssetName Include="any;api;descriptor;duration;empty;field_mask;source_context;struct;timestamp;type;wrappers" />
32-
<_Asset PackagePath="build/native/include/google/protobuf/" Include="@(_ProtoAssetName->'$(Assets_ProtoInclude)/google/protobuf/%(Identity).proto')" />
31+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/any.proto" />
32+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/api.proto" />
33+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/descriptor.proto" />
34+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/duration.proto" />
35+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/empty.proto" />
36+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/field_mask.proto" />
37+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/source_context.proto" />
38+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/struct.proto" />
39+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/timestamp.proto" />
40+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/type.proto" />
41+
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/wrappers.proto" />
3342
<_Asset PackagePath="build/native/include/rsocket/" Include="$(Assets_ProtoInclude)/rsocket/options.proto" />
3443
<_Asset PackagePath="tools/windows_x64/" Include="$(Assets_ProtoCompiler)windows_x64/protoc.exe" />
3544
<_Asset PackagePath="tools/linux_x64/" Include="$(Assets_ProtoCompiler)linux_x64/protoc" />

0 commit comments

Comments
 (0)