aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Protos/build-protos.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Protos/build-protos.sh')
-rwxr-xr-xFirestore/Protos/build-protos.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/Firestore/Protos/build-protos.sh b/Firestore/Protos/build-protos.sh
index 4cfb12e..5c3aa53 100755
--- a/Firestore/Protos/build-protos.sh
+++ b/Firestore/Protos/build-protos.sh
@@ -20,7 +20,17 @@ rm Podfile.lock
pod update
# Generate the objective C files from the protos.
-./Pods/!ProtoCompiler/protoc --plugin=protoc-gen-grpc=Pods/\!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin -I protos --objc_out=objc --grpc_out=objc `find protos -name *.proto -print | xargs`
+./Pods/!ProtoCompiler/protoc \
+ --plugin=protoc-gen-grpc=Pods/\!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin \
+ --plugin=../../build/external/nanopb/src/nanopb-build/generator/protoc-gen-nanopb \
+ -I protos --objc_out=objc --grpc_out=objc \
+ --nanopb_out="--options-file=protos/%s.options:nanopb" \
+ `find protos -name *.proto -print | xargs`
+
+# If a proto uses a field named 'delete', nanopb happily uses that in the
+# message definition. Works fine for C; not so much for C++. Rename uses of this
+# to delete_ (which is how protoc does it for c++ files.)
+perl -i -pe 's/\bdelete\b/delete_/g' `find nanopb -type f`
# CocoaPods does not like paths in library imports, flatten them.