Lines Matching +full:googleapis +full:- +full:gen
1 #!/bin/bash -e
3 # Run gapic-generator-java as a protoc plugin.
7 DIR=~/dev/googleapis/google/showcase/v1beta1
8 ./run.sh --g ~/dev/googleapis --p "$DIR"-s "$DIR/showcase_grpc_service_config.json"
14 DEFINE_string --alias=p protos '' 'Path to the protos to generate.'
15 DEFINE_string --alias=g googleapis '' 'Path to the googleapis directory.'
16 DEFINE_string --alias=s service_config '' 'Path to the JSON service config'
19 DEFINE_bool --alias=c use_cached false 'If true, does not rebuild the plugin.'
20 DEFINE_string --alias=o out '/tmp/test' 'Output directory'
36 echo -e "$BOLD $BACK_BLUE $WHITE $1 $UNSET"
45 echo -e "$BOLD $BACK_BLUE $WHITE $BACK_GREEN $1 $UNSET"
49 if [[ -z "${FLAGS_protos}" ]]
51 echo_error "Required flag --protos must be set."
55 if [[ -z "${FLAGS_googleapis}" ]]
57 echo_error "Required flag --googleapis must be set."
62 if [[ "${FLAGS_use_cached}" == 0 ]] || [[ ! -f bazel-bin/protoc-gen-java_gapic ]]
65 bazel build :protoc-gen-java_gapic
66 if [[ $? -ne 0 ]]
77 if [ -n "$FLAGS_service_config" ]
79 SERVICE_CONFIG_OPT="grpc-service-config=$FLAGS_service_config"
83 if [ -n "$FLAGS_gapic_config" ]
85 GAPIC_CONFIG_OPT="gapic-config=$FLAGS_gapic_config"
89 protoc -I="${PROTOC_INCLUDE_DIR}" -I="${FLAGS_googleapis}" -I="${FLAGS_protos}" \
90 -I="${FLAGS_googleapis}/google/longrunning" \
91 --include_source_info \
92 --plugin=bazel-bin/protoc-gen-java_gapic ${FLAGS_protos}/*.proto \
93 --java_gapic_out="${FLAGS_out}" \
94 --java_gapic_opt="${SERVICE_CONFIG_OPT},${GAPIC_CONFIG_OPT}" \
95 --experimental_allow_proto3_optional