Merge pull request #6282 from jtattermusch/disable_internal_obsolete

Disable warnings for use of our own obsolete interfaces
pull/6299/head
Jan Tattermusch 9 years ago
commit eeef86cea2
  1. 4
      src/compiler/csharp_generator.cc
  2. 6
      src/csharp/Grpc.Examples/MathGrpc.cs
  3. 6
      src/csharp/Grpc.HealthCheck/HealthGrpc.cs
  4. 6
      src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs
  5. 12
      src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs
  6. 18
      src/csharp/Grpc.IntegrationTesting/TestGrpc.cs

@ -350,10 +350,12 @@ void GenerateServerClass(Printer* out, const ServiceDescriptor *service) {
void GenerateClientStub(Printer* out, const ServiceDescriptor *service) {
out->Print("// client stub\n");
out->Print("#pragma warning disable 0618\n");
out->Print(
"public class $name$ : ClientBase<$name$>, $interface$\n",
"name", GetClientClassName(service),
"interface", GetClientInterfaceName(service));
out->Print("#pragma warning restore 0618\n");
out->Print("{\n");
out->Indent();
@ -480,10 +482,12 @@ void GenerateBindServiceMethod(Printer* out, const ServiceDescriptor *service,
bool use_server_class) {
out->Print(
"// creates service definition that can be registered with a server\n");
out->Print("#pragma warning disable 0618\n");
out->Print(
"public static ServerServiceDefinition BindService($interface$ serviceImpl)\n",
"interface", use_server_class ? GetServerClassName(service) :
GetServerInterfaceName(service));
out->Print("#pragma warning restore 0618\n");
out->Print("{\n");
out->Indent();

@ -103,7 +103,9 @@ namespace Math {
}
// client stub
#pragma warning disable 0618
public class MathClient : ClientBase<MathClient>, IMathClient
#pragma warning restore 0618
{
public MathClient(Channel channel) : base(channel)
{
@ -167,7 +169,9 @@ namespace Math {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(IMath serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_Div, serviceImpl.Div)
@ -177,7 +181,9 @@ namespace Math {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(MathBase serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_Div, serviceImpl.Div)

@ -56,7 +56,9 @@ namespace Grpc.Health.V1 {
}
// client stub
#pragma warning disable 0618
public class HealthClient : ClientBase<HealthClient>, IHealthClient
#pragma warning restore 0618
{
public HealthClient(Channel channel) : base(channel)
{
@ -96,14 +98,18 @@ namespace Grpc.Health.V1 {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(IHealth serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_Check, serviceImpl.Check).Build();
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(HealthBase serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_Check, serviceImpl.Check).Build();

@ -72,7 +72,9 @@ namespace Grpc.Testing {
}
// client stub
#pragma warning disable 0618
public class MetricsServiceClient : ClientBase<MetricsServiceClient>, IMetricsServiceClient
#pragma warning restore 0618
{
public MetricsServiceClient(Channel channel) : base(channel)
{
@ -120,7 +122,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(IMetricsService serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges)
@ -128,7 +132,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(MetricsServiceBase serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges)

@ -71,7 +71,9 @@ namespace Grpc.Testing {
}
// client stub
#pragma warning disable 0618
public class BenchmarkServiceClient : ClientBase<BenchmarkServiceClient>, IBenchmarkServiceClient
#pragma warning restore 0618
{
public BenchmarkServiceClient(Channel channel) : base(channel)
{
@ -119,7 +121,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(IBenchmarkService serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
@ -127,7 +131,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
@ -241,7 +247,9 @@ namespace Grpc.Testing {
}
// client stub
#pragma warning disable 0618
public class WorkerServiceClient : ClientBase<WorkerServiceClient>, IWorkerServiceClient
#pragma warning restore 0618
{
public WorkerServiceClient(Channel channel) : base(channel)
{
@ -313,7 +321,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(IWorkerService serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_RunServer, serviceImpl.RunServer)
@ -323,7 +333,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(WorkerServiceBase serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_RunServer, serviceImpl.RunServer)

@ -138,7 +138,9 @@ namespace Grpc.Testing {
}
// client stub
#pragma warning disable 0618
public class TestServiceClient : ClientBase<TestServiceClient>, ITestServiceClient
#pragma warning restore 0618
{
public TestServiceClient(Channel channel) : base(channel)
{
@ -226,7 +228,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(ITestService serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall)
@ -238,7 +242,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(TestServiceBase serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall)
@ -303,7 +309,9 @@ namespace Grpc.Testing {
}
// client stub
#pragma warning disable 0618
public class UnimplementedServiceClient : ClientBase<UnimplementedServiceClient>, IUnimplementedServiceClient
#pragma warning restore 0618
{
public UnimplementedServiceClient(Channel channel) : base(channel)
{
@ -343,14 +351,18 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(IUnimplementedService serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build();
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(UnimplementedServiceBase serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build();
@ -429,7 +441,9 @@ namespace Grpc.Testing {
}
// client stub
#pragma warning disable 0618
public class ReconnectServiceClient : ClientBase<ReconnectServiceClient>, IReconnectServiceClient
#pragma warning restore 0618
{
public ReconnectServiceClient(Channel channel) : base(channel)
{
@ -485,7 +499,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(IReconnectService serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_Start, serviceImpl.Start)
@ -493,7 +509,9 @@ namespace Grpc.Testing {
}
// creates service definition that can be registered with a server
#pragma warning disable 0618
public static ServerServiceDefinition BindService(ReconnectServiceBase serviceImpl)
#pragma warning restore 0618
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_Start, serviceImpl.Start)

Loading…
Cancel
Save