C Shapiro | 367efde | 2021-05-11 06:56:33 -0500 | [diff] [blame] | 1 | #!/bin/bash -e |
| 2 | # |
| 3 | # Copyright 2021 The Chromium OS Authors. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | # |
| 7 | # Generates python proto bindings that include the grpc bindings. |
| 8 | |
| 9 | readonly script_dir="$(dirname "$(realpath -e "${BASH_SOURCE[0]}")")" |
| 10 | |
| 11 | cd "${script_dir}" |
| 12 | |
C Shapiro | 7743508 | 2021-05-17 12:58:11 -0500 | [diff] [blame] | 13 | source "${script_dir}/bin/common.sh" |
| 14 | create_venv |
C Shapiro | 367efde | 2021-05-11 06:56:33 -0500 | [diff] [blame] | 15 | |
| 16 | echo "Generating proto and grpc bindings" |
C Shapiro | 184ba34 | 2021-06-30 15:28:54 -0500 | [diff] [blame^] | 17 | find proto/ -type f -name '*_service.proto' | xargs \ |
C Shapiro | 367efde | 2021-05-11 06:56:33 -0500 | [diff] [blame] | 18 | python3 -m grpc_tools.protoc \ |
| 19 | -Iproto \ |
| 20 | --python_out=python \ |
C Shapiro | 184ba34 | 2021-06-30 15:28:54 -0500 | [diff] [blame^] | 21 | --grpc_python_out=python |
C Shapiro | 367efde | 2021-05-11 06:56:33 -0500 | [diff] [blame] | 22 | |
| 23 | deactivate |