1#!/usr/bin/env bash 2 3# Run this script to regenerate descriptor protos after the protocol compiler 4# changes. 5 6set -e 7 8if [[ -z "${PROTOC}" ]]; then 9 PROTOC=$(pwd)/protoc 10fi 11if [ ! -f $PROTOC ]; then 12 ${BAZEL:-bazel} $BAZEL_STARTUP_FLAGS build -c opt //:protoc $BAZEL_FLAGS 13 PROTOC=$(pwd)/bazel-bin/protoc 14fi 15 16if test ! -e src/google/protobuf/stubs/common.h; then 17 cat >&2 << __EOF__ 18Could not find source code. Make sure you are running this script from the 19root of the distribution tree. 20__EOF__ 21 exit 1 22fi 23 24pushd src 25$PROTOC --php_out=internal:../php/src google/protobuf/descriptor.proto 26$PROTOC --php_out=internal_generate_c_wkt:../php/src \ 27 google/protobuf/any.proto \ 28 google/protobuf/api.proto \ 29 google/protobuf/duration.proto \ 30 google/protobuf/empty.proto \ 31 google/protobuf/field_mask.proto \ 32 google/protobuf/source_context.proto \ 33 google/protobuf/struct.proto \ 34 google/protobuf/type.proto \ 35 google/protobuf/timestamp.proto \ 36 google/protobuf/wrappers.proto 37popd 38