blob: 4f3a09724b04f78b2e8f0724ff356a786c2c67c2 [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
18if [ -z "${ANDROID_BUILD_TOP}" ] ; then
19 echo "You need to source and lunch before you can use this script" 1>&2
20 exit 1
21fi
22
23case $(uname -s) in
24 Darwin)
25 KERNEL=darwin
26 ;;
27 Linux)
28 KERNEL=linux
29 ;;
30 *)
31 echo "Unknown kernel \"`uname -s`\"" 1>&2
32 exit 1
33 ;;
34esac
35
36read -d "" PROTOC_COMMAND << END || :
37${ANDROID_BUILD_TOP}/prebuilts/tools/${KERNEL}-x86_64/protoc/bin/protoc
38END
39if ! [ -x "${PROTOC_COMMAND}" ] ; then
40 echo "Missing ${PROTOC_COMMAND}." 1>&2
41 exit 1
42fi
43
44ECC_ROOT=`realpath \`dirname $0\``
45TOOLSET_DIR="${ECC_ROOT}/conversion_toolset_v1"
46INPUT_DIR="${ECC_ROOT}/input"
47OUTPUT_DIR="${ECC_ROOT}/output"
48INTERMEDIATE_DIR="${ECC_ROOT}/.intermediate"
49
50rm -rf "${INTERMEDIATE_DIR}" "${OUTPUT_DIR}/*"
51mkdir -p "${INTERMEDIATE_DIR}"
52
53source "${TOOLSET_DIR}/gen_eccdata.sh"
54echo
55
Leo Hsu7dd2abd2018-11-13 14:25:57 +080056echo "To verify data compatibility:"
57echo " 1. make TeleService"
58echo " 2. push TeleService.apk to system/priv-app/TeleService"
59echo " 3. reboot device"
60echo " 4. run 'atest TeleServiceTests:IsoToEccProtobufRepositoryTest#testEccDataContent'"