1load("@rules_java//java:defs.bzl", "java_binary", "java_proto_library") 2 3package(default_visibility = ["//visibility:public"]) 4 5java_binary( 6 name = "protoc-gen-java_gapic", 7 main_class = "com.google.api.generator.Main", 8 runtime_deps = ["@maven//:com_google_api_gapic_generator_java"], 9) 10 11# Request dumper binary, which dumps the CodeGeneratorRequest to a file on disk 12# which will be identical to the one passed to the protoc-gen-java_gapic during 13# normal execution. The dumped file then can be used to run this gapic-generator 14# directly (instead of relying on protoc to start the process), which would give 15# much greater flexibility in terms of debugging features, like attaching a 16# debugger, easier work with stdout and stderr etc. 17# 18# Usage example, via the rule in a corresponding BUILD.bazel file: 19# 20# load("@gapic_generator_java//rules_java_gapic:java_gapic.bzl", "java_generator_request_dump") 21# java_generator_request_dump( 22# name = "compute_small_request_dump", 23# srcs = [":compute_small_proto_with_info"], 24# transport = "rest", 25# ) 26# 27java_binary( 28 name = "protoc-gen-code_generator_request_dumper", 29 main_class = "com.google.api.generator.debug.CodeGeneratorRequestDumper", 30 runtime_deps = ["@maven//:com_google_api_gapic_generator_java"], 31) 32 33# A binary similar to protoc-gen-java_gapic but reads the CodeGeneratorRequest 34# directly from a file instead of relying on protoc to pipe it in. 35# 36# Usage example: 37# 38# bazel run code_generator_request_file_to_gapic_main desc-dump.bin dump.jar 39# 40java_binary( 41 name = "code_generator_request_file_to_gapic_main", 42 main_class = "com.google.api.generator.debug.CodeGeneratorRequestFileToGapicMain", 43 runtime_deps = ["@maven//:com_google_api_gapic_generator_java"], 44) 45 46# google-java-format 47java_binary( 48 name = "google_java_format_binary", 49 jvm_flags = ["-Xmx512m"], 50 main_class = "com.google.googlejavaformat.java.Main", 51 runtime_deps = ["@google_java_format_all_deps//jar"], 52) 53