Skip to content

Commit

Permalink
Remove hard coded service name from generator
Browse files Browse the repository at this point in the history
  • Loading branch information
rdegnan committed May 28, 2019
1 parent 00c7d6e commit 2aa2ede
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 28 deletions.
3 changes: 2 additions & 1 deletion RSocket.Rpc.Protobuf/src/csharp_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ void GenerateServerClass(Printer* out, const ServiceDescriptor* service) {
}
}

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");
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",
"interfacename", GetInterfaceName(service));
out->Print("{\n");
out->Indent();
out->Print("switch (method)\n");
Expand Down
22 changes: 0 additions & 22 deletions RSocket.Rpc.Sample/EchoService.proto

This file was deleted.

6 changes: 3 additions & 3 deletions RSocket.Rpc.Sample/RSocket.Rpc.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
</ItemGroup>

<ItemGroup>
<ProtoBuf Include="rsocket\options.proto" RSocketRpcServices="None" />
<ProtoBuf Include="echo.proto" RSocketRpcServices="Both" />
<ProtoBuf Include="rsocket\options.proto" />
<ProtoBuf Include="**\*.proto" />
</ItemGroup>

</Project>
13 changes: 11 additions & 2 deletions RSocket.Rpc.Tools/RSocket.Rpc.Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,17 @@ Linux and MacOS. Managed runtime is supplied separately in the RSocket.Rpc.Core
<None Pack="true" PackagePath="build\" Include="build\**\*.xml; build\**\*.props; build\**\*.targets;" />

<!-- Protobuf assets (for Google.Protobuf.Tools) -->
<_ProtoAssetName Include="any;api;descriptor;duration;empty;field_mask;source_context;struct;timestamp;type;wrappers" />
<_Asset PackagePath="build/native/include/google/protobuf/" Include="@(_ProtoAssetName->'$(Assets_ProtoInclude)/google/protobuf/%(Identity).proto')" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/any.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/api.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/descriptor.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/duration.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/empty.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/field_mask.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/source_context.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/struct.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/timestamp.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/type.proto" />
<_Asset PackagePath="build/native/include/google/protobuf" Include="$(Assets_ProtoInclude)/google/protobuf/wrappers.proto" />
<_Asset PackagePath="build/native/include/rsocket/" Include="$(Assets_ProtoInclude)/rsocket/options.proto" />
<_Asset PackagePath="tools/windows_x64/" Include="$(Assets_ProtoCompiler)windows_x64/protoc.exe" />
<_Asset PackagePath="tools/linux_x64/" Include="$(Assets_ProtoCompiler)linux_x64/protoc" />
Expand Down

0 comments on commit 2aa2ede

Please sign in to comment.