mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-03-21 13:43:30 +00:00
*: Switch to a Makefile driven develop/release process
* Add make targets for vendor, docker-image, and tools * Move scripts into the scripts folder
This commit is contained in:
@@ -1,21 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
# USAGE ./scripts/codegen
|
||||
# Generate Go protocol buffer code from proto definitions
|
||||
|
||||
set -eu
|
||||
|
||||
# Add tools to the PATH so binaries are the correct version
|
||||
export PATH=$PWD/tools:$PATH
|
||||
|
||||
# Check location and tools
|
||||
if ! [[ "$0" =~ "scripts/codegen" ]]; then
|
||||
echo "must be run from repository root"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
if ! [[ $(protoc --version) =~ "3.0.0" ]]; then
|
||||
echo "could not find protoc 3.0.0"
|
||||
exit 255
|
||||
fi
|
||||
# Add protoc and protoc-gen-go tools to PATH
|
||||
export PATH=$PWD/bin:$PATH
|
||||
|
||||
# protobuf subpackages end in "pb"
|
||||
PBUFS=$(go list ./... | grep -v /vendor | grep 'pb$')
|
||||
@@ -28,4 +18,5 @@ for pkg in $PBUFS ; do
|
||||
# generate protocol buffers, make other .proto files available to import
|
||||
protoc --go_out=plugins=grpc:. -I=.:"${GOPATH}/src/" *.proto
|
||||
popd > /dev/null
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user