From dcf91f686bce553ba919387fc4c1f615cd4b496b Mon Sep 17 00:00:00 2001 From: Mira Leung Date: Fri, 11 Sep 2020 17:59:35 -0700 Subject: [PATCH] [ggj][bazel] fix: rename protoc plugin binary (#296) * fix: refactor and rename Bazel rules to use googleapis' toolchain * fix: simplify Bazel rules post-refactoring * fix: rename protoc plugin binary --- BUILD.bazel | 2 +- DEVELOPMENT.md | 4 ++-- run.sh | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 6b95642180..2c101a4988 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -28,7 +28,7 @@ java_proto_library( # ============= Binary targets ================ java_binary( - name = "protoc-gen-gapic-java", + name = "protoc-gen-java_gapic", srcs = [ "//src/main/java/com/google/api/generator:generator_files", ], diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 3bebe8b197..80a3ab67d5 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -35,7 +35,7 @@ below are temporary and better ones will be coming. 4. Build this plugin. ```sh - bazel build :protoc-gen-gapic-java + bazel build :protoc-gen-java_gapic ``` 5. Run the plugin. At this stage, it will not do anything except write @@ -43,7 +43,7 @@ below are temporary and better ones will be coming. ``` protoc -I=${PROTOC_INCLUDE_DIR} -I=${GOOGLEAPIS_DIR} -I=${YOUR_PROTO_DIR} \ - --plugin=bazel-bin/protoc-gen-gapic-java ~/dev/googleapis/google/showcase/v1test/*.proto \ + --plugin=bazel-bin/protoc-gen-java_gapic ~/dev/googleapis/google/showcase/v1test/*.proto \ --gapic-java_out=/tmp/test ``` diff --git a/run.sh b/run.sh index 46572fe76c..0103b0cec4 100755 --- a/run.sh +++ b/run.sh @@ -59,10 +59,10 @@ then fi # Build if needed. -if [[ "${FLAGS_use_cached}" == 0 ]] || [[ ! -f bazel-bin/protoc-gen-gapic-java ]] +if [[ "${FLAGS_use_cached}" == 0 ]] || [[ ! -f bazel-bin/protoc-gen-java_gapic ]] then echo_success "Rebuilding the microgenerator..." - bazel build :protoc-gen-gapic-java + bazel build :protoc-gen-java_gapic if [[ $? -ne 0 ]] then echo_error "Build failed." @@ -75,9 +75,9 @@ fi # Run protoc. protoc -I="${PROTOC_INCLUDE_DIR}" -I="${FLAGS_googleapis}" -I="${FLAGS_protos}" \ -I="${FLAGS_googleapis}/google/longrunning" \ - --plugin=bazel-bin/protoc-gen-gapic-java ${FLAGS_protos}/*.proto \ - --gapic-java_out="${FLAGS_out}" \ - --gapic-java_opt="${FLAGS_service_config},${FLAGS_gapic_config}" \ + --plugin=bazel-bin/protoc-gen-java_gapic ${FLAGS_protos}/*.proto \ + --java_gapic_out="${FLAGS_out}" \ + --java_gapic_opt="${FLAGS_service_config},${FLAGS_gapic_config}" \ --experimental_allow_proto3_optional echo_success "Output files written to ${FLAGS_out}"