From 32ca32b4435297c9c5d162db202ae296ed7f2a8e Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Thu, 12 Jan 2023 19:28:46 +0000 Subject: [PATCH] Add anapic script to upload diffs for review These diffs are between the hidl2aidl tool output and the existing interface definition. It generates 2 CLs, the second one is more readable and shows going from the hidl2aidl output TO the existing definition today. example: anapic_hidl2aidl_review.sh android.hardware.boot@1.2 Test: run example command and verify output Bug: none Change-Id: I18ab248de7d5f0832ba0d2f749d97f96a1b06f8b --- scripts/anapic_hidl2aidl_review.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 scripts/anapic_hidl2aidl_review.sh diff --git a/scripts/anapic_hidl2aidl_review.sh b/scripts/anapic_hidl2aidl_review.sh new file mode 100755 index 0000000000..330ae32220 --- /dev/null +++ b/scripts/anapic_hidl2aidl_review.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if [[ $# -ne 1 ]]; then + echo "Usage: $0 INTERFACE_NAME" + echo "- INTERFACE_NAME fully qualified HIDL interface name with version" + echo "example of creating the diffs for android.hardware.boot@1.2" + echo "$ ./anapic_hidl2aidl_review.sh android.hardware.boot@1.2" + exit 1 +fi + +# for pathmod +source ${ANDROID_BUILD_TOP}/build/make/envsetup.sh + +set -ex +type hidl2aidl 2>/dev/null || m hidl2aidl + +INTERFACE_NAME_NO_VER=${1%@*} +pushd $(pathmod $INTERFACE_NAME_NO_VER) +rm -rf android +hidl2aidl -o . "$1" +rm -rf conversion.log translate include +git add -A +git commit -am "convert $1" --no-edit +git revert HEAD --no-edit +git commit --amend --no-edit +repo upload . --no-verify +popd