blob: 5cf52dec6860231b48c293394e44cb493987ec22 [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
56# Check compatibility with every previous version
57rm -rf "${INTERMEDIATE_DIR}/*"
58source ${ECC_ROOT}/conversion_toolset_v1/verify_eccdata_compatibility.sh
59#rm -rf "${INTERMEDIATE_DIR}/*"
60#source ${ECC_ROOT}/conversion_toolset_v2/verify_eccdata_compatibility.sh
61#rm -rf "${INTERMEDIATE_DIR}/*"
62#source ${ECC_ROOT}/conversion_toolset_v3/verify_eccdata_compatibility.sh
63#...
64
65echo
66echo "Passed all compatibility verification!"
67