aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec/DevTools/generate_descriptors_proto.sh
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2015-05-01 08:57:16 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2015-05-06 13:19:14 -0400
commit30650d81d9baa446dbc8deb784ba53794cafda5b (patch)
tree993f42cbfc871dd25d9273606f48d7c3b520df27 /objectivec/DevTools/generate_descriptors_proto.sh
parentefa666cf0ad77827ac0b15a159e2c85e9991d77c (diff)
Alpha 1 drop of Google's Objective C plugin and runtime support for protobufs.
Diffstat (limited to 'objectivec/DevTools/generate_descriptors_proto.sh')
-rwxr-xr-xobjectivec/DevTools/generate_descriptors_proto.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/objectivec/DevTools/generate_descriptors_proto.sh b/objectivec/DevTools/generate_descriptors_proto.sh
new file mode 100755
index 00000000..42502bfe
--- /dev/null
+++ b/objectivec/DevTools/generate_descriptors_proto.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# This script will generate the common descriptors needed by the Objective C
+# runtime.
+
+# HINT: Flags passed to generate_descriptor_proto.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}/../.."
+readonly ProtoC="${ProtoRootDir}/src/protoc"
+
+pushd "${ProtoRootDir}" > /dev/null
+
+# Compiler build fails if config.h hasn't been made yet (even if configure/etc.
+# have been run, so get that made first).
+make $@ config.h
+
+# Make sure the compiler is current.
+cd src
+make $@ protoc
+
+# These really should only be run when the inputs or compiler are newer than
+# the outputs.
+
+# Needed by the runtime.
+./protoc --objc_out="${ProtoRootDir}/objectivec" google/protobuf/descriptor.proto
+
+# Well known types that the library provides helpers for.
+./protoc --objc_out="${ProtoRootDir}/objectivec" google/protobuf/timestamp.proto
+./protoc --objc_out="${ProtoRootDir}/objectivec" google/protobuf/duration.proto
+
+popd > /dev/null