1
0
Fork 0
mirror of https://github.com/Luzifer/cloudkeys-go.git synced 2024-11-14 00:42:44 +00:00
cloudkeys-go/vendor/github.com/golang/protobuf/regenerate.sh
Martin Thielecke 9c6e3c89a5 JS bugfixes (#18)
* fix js scoping issue

* add external libraries (they were offline too often)

* new compiled scripts and css

* new fixes in the binary

* vendor update

* change js source

* remove needless variable

* removed more needless variables
2019-01-21 15:27:20 +01:00

53 lines
1.6 KiB
Bash
Executable file

#!/bin/bash
set -e
# Install the working tree's protoc-gen-gen in a tempdir.
tmpdir=$(mktemp -d -t regen-wkt.XXXXXX)
trap 'rm -rf $tmpdir' EXIT
mkdir -p $tmpdir/bin
PATH=$tmpdir/bin:$PATH
GOBIN=$tmpdir/bin go install ./protoc-gen-go
# Public imports require at least Go 1.9.
supportTypeAliases=""
if go list -f '{{context.ReleaseTags}}' runtime | grep -q go1.9; then
supportTypeAliases=1
fi
# Generate various test protos.
PROTO_DIRS=(
conformance/internal/conformance_proto
jsonpb/jsonpb_test_proto
proto
protoc-gen-go/testdata
)
for dir in ${PROTO_DIRS[@]}; do
for p in `find $dir -name "*.proto"`; do
if [[ $p == */import_public/* && ! $supportTypeAliases ]]; then
echo "# $p (skipped)"
continue;
fi
echo "# $p"
protoc -I$dir --go_out=plugins=grpc,paths=source_relative:$dir $p
done
done
# Deriving the location of the source protos from the path to the
# protoc binary may be a bit odd, but this is what protoc itself does.
PROTO_INCLUDE=$(dirname $(dirname $(which protoc)))/include
# Well-known types.
WKT_PROTOS=(any duration empty struct timestamp wrappers)
for p in ${WKT_PROTOS[@]}; do
echo "# google/protobuf/$p.proto"
protoc --go_out=paths=source_relative:$tmpdir google/protobuf/$p.proto
cp $tmpdir/google/protobuf/$p.pb.go ptypes/$p
cp $PROTO_INCLUDE/google/protobuf/$p.proto ptypes/$p
done
# descriptor.proto.
echo "# google/protobuf/descriptor.proto"
protoc --go_out=paths=source_relative:$tmpdir google/protobuf/descriptor.proto
cp $tmpdir/google/protobuf/descriptor.pb.go protoc-gen-go/descriptor
cp $PROTO_INCLUDE/google/protobuf/descriptor.proto protoc-gen-go/descriptor