| OLD | NEW |
| (Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 # Run this script to regenerate descriptor.pbobjc.{h,m} after the protocol |
| 4 # compiler changes. |
| 5 |
| 6 # HINT: Flags passed to generate_descriptor_proto.sh will be passed directly |
| 7 # to make when building protoc. This is particularly useful for passing |
| 8 # -j4 to run 4 jobs simultaneously. |
| 9 |
| 10 set -eu |
| 11 |
| 12 readonly ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")") |
| 13 readonly ProtoRootDir="${ScriptDir}/.." |
| 14 readonly ProtoC="${ProtoRootDir}/src/protoc" |
| 15 |
| 16 pushd "${ProtoRootDir}" > /dev/null |
| 17 |
| 18 if test ! -e src/google/protobuf/stubs/common.h; then |
| 19 cat >&2 << __EOF__ |
| 20 Could not find source code. Make sure you are running this script from the |
| 21 root of the distribution tree. |
| 22 __EOF__ |
| 23 exit 1 |
| 24 fi |
| 25 |
| 26 if test ! -e src/Makefile; then |
| 27 cat >&2 << __EOF__ |
| 28 Could not find src/Makefile. You must run ./configure (and perhaps |
| 29 ./autogen.sh) first. |
| 30 __EOF__ |
| 31 exit 1 |
| 32 fi |
| 33 |
| 34 # Make sure the compiler is current. |
| 35 cd src |
| 36 make $@ protoc |
| 37 |
| 38 declare -a RUNTIME_PROTO_FILES=(\ |
| 39 google/protobuf/any.proto \ |
| 40 google/protobuf/api.proto \ |
| 41 google/protobuf/descriptor.proto \ |
| 42 google/protobuf/duration.proto \ |
| 43 google/protobuf/empty.proto \ |
| 44 google/protobuf/field_mask.proto \ |
| 45 google/protobuf/source_context.proto \ |
| 46 google/protobuf/struct.proto \ |
| 47 google/protobuf/timestamp.proto \ |
| 48 google/protobuf/type.proto \ |
| 49 google/protobuf/wrappers.proto) |
| 50 |
| 51 ./protoc --objc_out="${ProtoRootDir}/objectivec" ${RUNTIME_PROTO_FILES[@]} |
| 52 |
| 53 popd > /dev/null |
| OLD | NEW |