mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-01-27 18:19:36 +00:00
* Get/build protoc and protoc-gen-go binaries under tools so they do not interfere with any user installations * Ensure protoc and protoc-gen-go versions are pinned
25 lines
627 B
Bash
Executable File
25 lines
627 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Get/build binary tools for protocol buffer code generation
|
|
|
|
set -eu
|
|
|
|
OS=$(uname | tr A-Z a-z)
|
|
if [[ $OS == 'darwin' ]]; then
|
|
OS=osx # protoc names downloads with OSX, not darwin
|
|
fi
|
|
|
|
PROTOC_VERSION=3.0.0-beta-2
|
|
|
|
mkdir -p tools
|
|
|
|
# Get 'protoc' protocol buffer compiler
|
|
curl -L -o tools/protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-$OS-x86_64.zip
|
|
unzip tools/protoc.zip protoc -d tools
|
|
rm -f tools/protoc.zip
|
|
|
|
# Build protoc-gen-go plugin
|
|
pushd vendor/github.com/golang/protobuf/protoc-gen-go
|
|
go build
|
|
mv protoc-gen-go $(dirs -l +1)/tools
|
|
popd
|