aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/scripts/separate-yql-proto-compile.sh
blob: 9a7a4042a2042476f5c8100b1c81f7842822a6bc (plain) (blame)
1
2
3
4
5
6
7
8
# The script takes the content of your Protocol Buffer (.proto) file and processes it to generate a compressed and encoded message meta info. 
# This meta info needs to be passed to the config.
# 1. Run the script in your terminal.
# 2. Paste your .proto file content when prompted.
# 3. Press Ctrl+D to signal the end of input.
# 4. Receive the Base64-encoded, gzipped descriptor set as output and paste to "meta" field of your config.

ya make contrib/tools/protoc && tmp=$(mktemp --suffix=.proto) && cat > "$tmp" && ./contrib/tools/protoc/protoc -I "$(dirname "$tmp")" --include_imports --descriptor_set_out=/dev/stdout "$tmp" | gzip | base64 -w 0 && rm "$tmp"