diff options
author | Josh Haberman <jhaberman@gmail.com> | 2016-03-29 16:24:35 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2016-03-29 16:24:35 -0700 |
commit | a15b916c419000565384a78224e402ed925e5fc8 (patch) | |
tree | d0bd6aa4648fddbb08d35d8b78dba32958ae7b51 /objectivec/generate_well_known_types.sh | |
parent | 67c727cd411a339eb4233c84d9a1afadd8c20566 (diff) | |
parent | 261ee021f640ea6fe67aaf1f53e1518ed154cad0 (diff) | |
download | protobuf-a15b916c419000565384a78224e402ed925e5fc8.tar.gz protobuf-a15b916c419000565384a78224e402ed925e5fc8.tar.bz2 protobuf-a15b916c419000565384a78224e402ed925e5fc8.zip |
Merge branch 'master' into docker
Diffstat (limited to 'objectivec/generate_well_known_types.sh')
-rwxr-xr-x | objectivec/generate_well_known_types.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/objectivec/generate_well_known_types.sh b/objectivec/generate_well_known_types.sh new file mode 100755 index 00000000..be9b38a5 --- /dev/null +++ b/objectivec/generate_well_known_types.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Run this script to regenerate *.pbobjc.{h,m} for the well known types after +# the protocol compiler changes. + +# HINT: Flags passed to generate_well_known_types.sh will be passed directly +# to make when building protoc. This is particularly useful for passing +# -j4 to run 4 jobs simultaneously. + +set -eu + +readonly ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")") +readonly ProtoRootDir="${ScriptDir}/.." + +pushd "${ProtoRootDir}" > /dev/null + +if test ! -e src/google/protobuf/stubs/common.h; then + cat >&2 << __EOF__ +Could not find source code. Make sure you are running this script from the +root of the distribution tree. +__EOF__ + exit 1 +fi + +if test ! -e src/Makefile; then + cat >&2 << __EOF__ +Could not find src/Makefile. You must run ./configure (and perhaps +./autogen.sh) first. +__EOF__ + exit 1 +fi + +# Make sure the compiler is current. +cd src +make $@ protoc + +declare -a RUNTIME_PROTO_FILES=( \ + google/protobuf/any.proto \ + google/protobuf/api.proto \ + google/protobuf/duration.proto \ + google/protobuf/empty.proto \ + google/protobuf/field_mask.proto \ + google/protobuf/source_context.proto \ + google/protobuf/struct.proto \ + google/protobuf/timestamp.proto \ + google/protobuf/type.proto \ + google/protobuf/wrappers.proto) + +./protoc --objc_out="${ProtoRootDir}/objectivec" ${RUNTIME_PROTO_FILES[@]} |