Skip to content

Commit

Permalink
Update build proto to generate new mesg struct - PR #1318 - original …
Browse files Browse the repository at this point in the history
…commit 9a6eee5
  • Loading branch information
NicolasMahe committed Sep 11, 2019
1 parent 236d30b commit b7f7d06
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions scripts/build-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,26 @@
# make sure script is running inside mesg/tools container.
source $(dirname $0)/require-mesg-tools.sh


PROJECT_PATH=/project
TYPES_PATH=/project/protobuf/types/
APIS_PATH=/project/protobuf/api/
CORE_APIS_PATH=/project/protobuf/coreapi/
TYPES_PATH=protobuf/types
APIS_PATH=protobuf/api
CORE_APIS_PATH=protobuf/coreapi

# generate type
for t in "${TYPES_PATH}"/{event,execution,instance,service,process}.proto
for file in "${TYPES_PATH}"/{event,execution,instance,service,process}.proto
do
file="$(basename ${t})"
file=$(basename ${file})
dir="${file%.*}"
protoc --gogo_out=Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:./"${dir}"/ \
--proto_path=/project/protobuf/types \
"${file}"

protoc --gogo_out=paths=source_relative:"${dir}" --proto_path . --proto_path "${TYPES_PATH}" "${file}"
done

# generate google type
protoc --gogo_out=paths=source_relative:. protobuf/types/struct.proto

# generate services
for t in "${APIS_PATH}"/{event,execution,instance,service,process}.proto
for file in "${APIS_PATH}"/{event,execution,instance,service,process}.proto
do
protoc --gogo_out=Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:. \
--proto_path=${PROJECT_PATH} \
"${t}"
protoc --gogo_out=plugins=grpc:. --proto_path . "${file}"
done

protoc --go_out=plugins=grpc,paths=source_relative:. \
--proto_path=${PROJECT_PATH} \
"${CORE_APIS_PATH}"/api.proto
protoc --go_out=plugins=grpc:. "${CORE_APIS_PATH}"/api.proto

0 comments on commit b7f7d06

Please sign in to comment.