From 72f1e88d78ffd598021930652142165fd4b5b25f Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Mon, 29 Feb 2016 18:05:33 -0800 Subject: [PATCH] Inlcude the file that was used to generate service descriptors --- .../generated/main/grpc/io/grpc/testing/TestServiceGrpc.java | 4 +++- .../src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java | 4 +++- compiler/src/java_plugin/cpp/java_generator.cpp | 5 ++++- compiler/src/test/golden/TestService.java.txt | 4 +++- compiler/src/test/golden/TestServiceNano.java.txt | 4 +++- .../main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java | 4 +++- .../grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java | 4 +++- .../generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java | 4 +++- .../io/grpc/testing/integration/ReconnectServiceGrpc.java | 4 +++- .../grpc/io/grpc/testing/integration/TestServiceGrpc.java | 4 +++- .../grpc/testing/integration/UnimplementedServiceGrpc.java | 4 +++- 11 files changed, 34 insertions(+), 11 deletions(-) diff --git a/benchmarks/src/generated/main/grpc/io/grpc/testing/TestServiceGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/testing/TestServiceGrpc.java index 45881e3f67..6268dd9d33 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/testing/TestServiceGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/testing/TestServiceGrpc.java @@ -13,7 +13,9 @@ import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: qpstest.proto") public class TestServiceGrpc { private TestServiceGrpc() {} diff --git a/benchmarks/src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java b/benchmarks/src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java index 0fa9d7d51e..86b52230de 100644 --- a/benchmarks/src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java +++ b/benchmarks/src/generated/main/grpc/io/grpc/testing/WorkerGrpc.java @@ -13,7 +13,9 @@ import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: qpstest.proto") public class WorkerGrpc { private WorkerGrpc() {} diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp index cdb17c0d9f..8be1575387 100644 --- a/compiler/src/java_plugin/cpp/java_generator.cpp +++ b/compiler/src/java_plugin/cpp/java_generator.cpp @@ -639,10 +639,13 @@ static void PrintService(const ServiceDescriptor* service, Printer* p, bool generate_nano) { (*vars)["service_name"] = service->name(); + (*vars)["file_name"] = service->file()->name(); (*vars)["service_class_name"] = ServiceClassName(service); p->Print( *vars, - "@$Generated$(\"by gRPC proto compiler\")\n" + "@$Generated$(\n" + " value = \"by gRPC proto compiler\",\n" + " comments = \"Source: $file_name$\")\n" "public class $service_class_name$ {\n\n"); p->Indent(); p->Print( diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt index 904963ed51..3dbaa26127 100644 --- a/compiler/src/test/golden/TestService.java.txt +++ b/compiler/src/test/golden/TestService.java.txt @@ -13,7 +13,9 @@ import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: test.proto") public class TestServiceGrpc { private TestServiceGrpc() {} diff --git a/compiler/src/test/golden/TestServiceNano.java.txt b/compiler/src/test/golden/TestServiceNano.java.txt index 4d8d1bac10..b310d927e0 100644 --- a/compiler/src/test/golden/TestServiceNano.java.txt +++ b/compiler/src/test/golden/TestServiceNano.java.txt @@ -15,7 +15,9 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import java.io.IOException; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: test.proto") public class TestServiceGrpc { private TestServiceGrpc() {} diff --git a/examples/src/generated/main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java b/examples/src/generated/main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java index ae525ef646..222b774e33 100644 --- a/examples/src/generated/main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java +++ b/examples/src/generated/main/grpc/io/grpc/examples/helloworld/GreeterGrpc.java @@ -13,7 +13,9 @@ import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: helloworld.proto") public class GreeterGrpc { private GreeterGrpc() {} diff --git a/examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java b/examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java index 6f732d15a1..d07de72302 100644 --- a/examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java +++ b/examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java @@ -13,7 +13,9 @@ import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: route_guide.proto") public class RouteGuideGrpc { private RouteGuideGrpc() {} diff --git a/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java b/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java index 20a86f0e1c..0b19a046d3 100644 --- a/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java +++ b/grpclb/src/generated/main/grpc/io/grpc/grpclb/LoadBalancerGrpc.java @@ -13,7 +13,9 @@ import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: load_balancer.proto") public class LoadBalancerGrpc { private LoadBalancerGrpc() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java index d27309fead..d14416896c 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java @@ -13,7 +13,9 @@ import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: io/grpc/testing/integration/test.proto") public class ReconnectServiceGrpc { private ReconnectServiceGrpc() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java index a0939a654b..f103d3221e 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java @@ -13,7 +13,9 @@ import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: io/grpc/testing/integration/test.proto") public class TestServiceGrpc { private TestServiceGrpc() {} diff --git a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java index 3cf6587d93..e63001ccb9 100644 --- a/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java +++ b/interop-testing/src/generated/main/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java @@ -13,7 +13,9 @@ import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -@javax.annotation.Generated("by gRPC proto compiler") +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: io/grpc/testing/integration/test.proto") public class UnimplementedServiceGrpc { private UnimplementedServiceGrpc() {}