blob: eb731511228a018e06dbdf9d976507d697cd2861 [file] [log] [blame]
C Shapiro367efde2021-05-11 06:56:33 -05001#!/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
9readonly script_dir="$(dirname "$(realpath -e "${BASH_SOURCE[0]}")")"
10
11cd "${script_dir}"
12
C Shapiro77435082021-05-17 12:58:11 -050013source "${script_dir}/bin/common.sh"
14create_venv
C Shapiro367efde2021-05-11 06:56:33 -050015
16echo "Generating proto and grpc bindings"
C Shapiro184ba342021-06-30 15:28:54 -050017find proto/ -type f -name '*_service.proto' | xargs \
C Shapiro367efde2021-05-11 06:56:33 -050018python3 -m grpc_tools.protoc \
19 -Iproto \
20 --python_out=python \
C Shapiro184ba342021-06-30 15:28:54 -050021 --grpc_python_out=python
C Shapiro367efde2021-05-11 06:56:33 -050022
23deactivate