1
1
mirror of https://github.com/github/semantic.git synced 2024-12-02 11:23:05 +03:00
semantic/script/protoc

22 lines
612 B
Bash
Executable File

#!/usr/bin/env bash
#/ Usage: script/protoc
#/
#/ Generate code from .proto files
set -ex
cd "$(dirname "$0")/.."
docker build -t semantic-protoc --target protoc .
PARENT_DIR=$(dirname $(pwd))
export PROJECT="github.com/github/semantic"
# Generate Haskell for semantic's protobuf types. See the entrypoint in
# Dockerfile for where the protoc pluggins are configured.
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/go/src/$PROJECT -w /go/src/$PROJECT \
semantic-protoc --proto_path=proto \
--haskell_out=./semantic-proto/src \
--jsonpb_haskell_out=./semantic-proto/src \
semantic.proto