ADD: added new version of protobuf

This commit is contained in:
Henry Winkel
2022-12-20 10:09:28 +01:00
parent 4a79559129
commit 1e2b3dda7b
1513 changed files with 123720 additions and 83381 deletions

View File

@@ -2,17 +2,19 @@
set -ex
cd `dirname $0`/..
cd `dirname $0`
if [[ -z "${PROTOC}" ]]; then
PROTOC=$(pwd)/protoc
fi
if [ ! -f $PROTOC ]; then
bazel build -c opt //:protoc
PROTOC=$(pwd)/bazel-bin/protoc
if ../src/protoc --help > /dev/null; then
PROTOC=src/protoc
else
# Bazel seems to be creating a problematic symlink in
# _build/out/external/com_google_protobuf, so we remove the _build directory
# before building protoc.
(cd .. && bazel build -c opt :protoc)
PROTOC=bazel-bin/protoc
fi
if [[ -d php/tmp && -z $(find php/tests/proto $PROTOC -newer php/tmp) ]]; then
if [[ -d tmp && -z $(find tests/proto ../$PROTOC -newer tmp) ]]; then
# Generated protos are already present and up to date, so we can skip protoc.
#
# Protoc is very fast, but sometimes it is not available (like if we haven't
@@ -21,9 +23,10 @@ if [[ -d php/tmp && -z $(find php/tests/proto $PROTOC -newer php/tmp) ]]; then
exit 0
fi
rm -rf php/tmp
mkdir -p php/tmp
rm -rf tmp
mkdir -p tmp
cd ..
find php/tests/proto -type f -name "*.proto"| xargs $PROTOC --php_out=php/tmp -Isrc -Iphp/tests
if [ "$1" = "--aggregate_metadata" ]; then