Leo Hsu | b9fda88 | 2018-07-20 19:10:30 +0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | set -o errexit |
| 3 | |
| 4 | # Copyright 2018 The Android Open Source Project |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | |
| 18 | INPUT_DATA="${INPUT_DIR}/eccdata.txt" |
| 19 | OUTPUT_DATA="${OUTPUT_DIR}/eccdata" |
| 20 | PROTOBUF_DIR="${LOCAL_TOOLSET_DIR}/proto" |
| 21 | PROTOBUF_FILE="${PROTOBUF_DIR}/protobuf_ecc_data.proto" |
| 22 | RAW_DATA="${INTERMEDIATE_DIR}/eccdata.raw" |
| 23 | |
| 24 | read -d "" PYTHON_COMMAND << END || : |
| 25 | ${ANDROID_BUILD_TOP}/prebuilts/python/${KERNEL}-x86/2.7.5/bin/python |
| 26 | END |
| 27 | PYTHONPATH="${PYTHONPATH}:${INTERMEDIATE_DIR}" |
| 28 | PYTHONPATH="${PYTHONPATH}:${ANDROID_BUILD_TOP}/external/nanopb-c/generator/" |
| 29 | |
| 30 | if ! [ -x "${PYTHON_COMMAND}" ] ; then |
| 31 | echo "Missing ${PYTHON_COMMAND}." 1>&2 |
| 32 | exit 1 |
| 33 | fi |
| 34 | |
| 35 | "${PROTOC_COMMAND}" \ |
| 36 | --python_out="${INTERMEDIATE_DIR}" \ |
| 37 | --proto_path="${PROTOBUF_DIR}" \ |
| 38 | "${PROTOBUF_FILE}" |