blob: 23d9f102a27dc6fdcc1c2c037345e5f851108595 [file] [log] [blame]
Leo Hsub9fda882018-07-20 19:10:30 +08001#!/bin/bash
2set -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
18INPUT_DATA="${INPUT_DIR}/eccdata.txt"
19OUTPUT_DATA="${OUTPUT_DIR}/eccdata"
20PROTOBUF_DIR="${LOCAL_TOOLSET_DIR}/proto"
21PROTOBUF_FILE="${PROTOBUF_DIR}/protobuf_ecc_data.proto"
22RAW_DATA="${INTERMEDIATE_DIR}/eccdata.raw"
23
24read -d "" PYTHON_COMMAND << END || :
25${ANDROID_BUILD_TOP}/prebuilts/python/${KERNEL}-x86/2.7.5/bin/python
26END
27PYTHONPATH="${PYTHONPATH}:${INTERMEDIATE_DIR}"
28PYTHONPATH="${PYTHONPATH}:${ANDROID_BUILD_TOP}/external/nanopb-c/generator/"
29
30if ! [ -x "${PYTHON_COMMAND}" ] ; then
31 echo "Missing ${PYTHON_COMMAND}." 1>&2
32 exit 1
33fi
34
35"${PROTOC_COMMAND}" \
36 --python_out="${INTERMEDIATE_DIR}" \
37 --proto_path="${PROTOBUF_DIR}" \
38 "${PROTOBUF_FILE}"