Files
fn-serverless/vendor/github.com/golang/protobuf/regenerate.sh
Reed Allman 51ff7caeb2 Bye bye openapi (#1081)
* add DateTime sans mgo

* change all uses of strfmt.DateTime to common.DateTime, remove test strfmt usage

* remove api tests, system-test dep on api test

multiple reasons to remove the api tests:

* awkward dependency with fn_go meant generating bindings on a branched fn to
vendor those to test new stuff. this is at a minimum not at all intuitive,
worth it, nor a fun way to spend the finite amount of time we have to live.
* api tests only tested a subset of functionality that the server/ api tests
already test, and we risk having tests where one tests some thing and the
other doesn't. let's not. we have too many test suites as it is, and these
pretty much only test that we updated the fn_go bindings, which is actually a
hassle as noted above and the cli will pretty quickly figure out anyway.
* fn_go relies on openapi, which relies on mgo, which is deprecated and we'd
like to remove as a dependency. openapi is a _huge_ dep built in a NIH
fashion, that cannot simply remove the mgo dep as users may be using it.
we've now stolen their date time and otherwise killed usage of it in fn core,
for fn_go it still exists but that's less of a problem.

* update deps

removals:

* easyjson
* mgo
* go-openapi
* mapstructure
* fn_go
* purell
* go-validator

also, had to lock docker. we shouldn't use docker on master anyway, they
strongly advise against that. had no luck with latest version rev, so i locked
it to what we were using before. until next time.

the rest is just playing dep roulette, those end up removing a ton tho

* fix exec test to work

* account for john le cache
2018-06-21 11:09:16 -07:00

54 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