Use the protoc from the build, not prebuilts/
The version of protoc in the prebuilts/tools project is ancient (2.5).
Instead, use the aprotoc binary from the build instead.
Test: ./gen_eccdata.sh
Test: creates same output/eccdata as before (ignoring gzip timestamp)
Bug: 136027884
Change-Id: I97cb17ac421126b118d4e053d31fe9210db40dd1
diff --git a/ecc/conversion_toolset_v1/gen_eccdata.sh b/ecc/conversion_toolset_v1/gen_eccdata.sh
index 803f39b..9fc0efc 100644
--- a/ecc/conversion_toolset_v1/gen_eccdata.sh
+++ b/ecc/conversion_toolset_v1/gen_eccdata.sh
@@ -19,8 +19,7 @@
source "${LOCAL_TOOLSET_DIR}/env.sh"
echo "Converting eccdata..."
-${ANDROID_BUILD_TOP}/prebuilts/misc/${KERNEL}-x86/protobuf/aprotoc \
- --encode=ecc.AllInfo proto/protobuf_ecc_data.proto \
+aprotoc --encode=ecc.AllInfo proto/protobuf_ecc_data.proto \
< "${INPUT_DATA}" > "${RAW_DATA}"
echo "Compressing eccdata..."
diff --git a/ecc/gen_eccdata.sh b/ecc/gen_eccdata.sh
index 4c1f616..2888585 100755
--- a/ecc/gen_eccdata.sh
+++ b/ecc/gen_eccdata.sh
@@ -20,24 +20,8 @@
exit 1
fi
-case $(uname -s) in
- Darwin)
- KERNEL=darwin
- ;;
- Linux)
- KERNEL=linux
- ;;
- *)
- echo "Unknown kernel \"`uname -s`\"" 1>&2
- exit 1
- ;;
-esac
-
-read -d "" PROTOC_COMMAND << END || :
-${ANDROID_BUILD_TOP}/prebuilts/misc/${KERNEL}-x86/protobuf/aprotoc
-END
-if ! [ -x "${PROTOC_COMMAND}" ] ; then
- echo "Missing ${PROTOC_COMMAND}." 1>&2
+if ! [ -x "$(which aprotoc)" ] ; then
+ echo "Missing aprotoc, build it with 'm aprotoc'." 1>&2
exit 1
fi