• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved.
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14set -e
15SOURCE="${BASH_SOURCE[0]}"
16cd $(dirname ${SOURCE})
17echo "begin to generate proto based files"
18SOURCE=$(dirname ${SOURCE})
19proto_dir="."
20services_dir="$proto_dir/services"
21# kernel_version="5.10.79_aarch64"
22kernel_version="."
23mock_data_dir="$proto_dir/types/plugins/mock_data"
24proto_array=("$mock_data_dir/mock_plugin_result.proto")
25
26export LD_LIBRARY_PATH=../../out/linux
27for ((i = 0; i < ${#proto_array[@]}; i ++))
28do
29   newpath=$(dirname ${proto_array[$i]})
30   newpath=${newpath:2}
31   cppout=../../third_party/protogen/$newpath
32   mkdir -p $cppout
33   ../../../out/linux/protoc --proto_path=$mock_data_dir --cpp_out=$cppout ${proto_array[$i]}
34done
35echo "generate proto based files over"
36