From 58de563fa480ccc225efdd97d694f44ffa377e7e Mon Sep 17 00:00:00 2001 From: Rostislav Date: Tue, 2 Apr 2024 01:07:10 +0300 Subject: [PATCH] examples: support retry policy example for bazel build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the docs, I can use bazel to build examples, but retry-example is not supported in bazel config. So If you'll try to build this example with bazel, you'll get an error: ``` examples git:(master) ✗ bazel build :retrying-hello-world-server :retrying-hello-world-client ERROR: Skipping ':retrying-hello-world-client': no such target '//:retrying-hello-world-client': target 'retrying-hello-world-client' not declared in package '' defined by /Users/rostik404/projects/grpc-java/examples/BUILD.bazel ERROR: no such target '//:retrying-hello-world-client': target 'retrying-hello-world-client' not declared in package '' defined by /Users/rostik404/projects/grpc-java/examples/BUILD.bazel INFO: Elapsed time: 0.331s INFO: 0 processes. ERROR: Build did NOT complete successfully ``` --- examples/BUILD.bazel | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel index 563fa07ce8..e3bea9ba23 100644 --- a/examples/BUILD.bazel +++ b/examples/BUILD.bazel @@ -248,3 +248,20 @@ java_grpc_library( deps = ["@io_grpc_grpc_proto//:health_java_proto"], ) +java_binary( + name = "retrying-hello-world-client", + testonly = 1, + main_class = "io.grpc.examples.retrying.RetryingHelloWorldClient", + runtime_deps = [ + ":examples", + ], +) + +java_binary( + name = "retrying-hello-world-server", + testonly = 1, + main_class = "io.grpc.examples.retrying.RetryingHelloWorldServer", + runtime_deps = [ + ":examples", + ], +)