Watch
1
0
Fork
You've already forked mautrix-signal
0
mirror of https://github.com/mautrix/signal.git synced 2026-11-10 16:19:17 -05:00
mautrix-signal/pkg/signalmeow/protobuf/build-protos.sh
2026-09-05 00:57:28 +03:00

18 lines
701 B
Shell
Executable file

#!/bin/bash
cd $(dirname "$0")
BASE_IMPORT_PATH="go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf"
opts=()
for file in */*.proto; do
opts+=("--go_opt=M${file}=${BASE_IMPORT_PATH}/$(dirname "$file")")
opts+=("--go-grpc_opt=M${file}=${BASE_IMPORT_PATH}/$(dirname "$file")")
done
for file in org/signal/chat/*.proto; do
file_without_ext=$(basename "$file" .proto)
opts+=("--go_opt=M${file}=${BASE_IMPORT_PATH}/rpc/${file_without_ext}")
opts+=("--go-grpc_opt=M${file}=${BASE_IMPORT_PATH}/rpc/${file_without_ext}")
done
protoc --go_out=. --go-grpc_out=. \
--go_opt=module=$BASE_IMPORT_PATH \
--go-grpc_opt=module=$BASE_IMPORT_PATH "${opts[@]}" \
*/*.proto org/signal/chat/*.proto
pre-commit run -a