blob: ce7216001b2f4808b1892b0ff2baf0046a79c28a [file] [log] [blame]
Devin Moore32ca32b2023-01-12 19:28:46 +00001#!/bin/bash
Devin Moore3511c732023-02-22 00:37:12 +00002#
3# Create two CLs for the given HIDL interface to see the diff between the
4# hidl2aidl output and the source at the tip-of-tree.
5# The first CL contains the hidl2aidl output after removing all existing AIDL
6# files.
7# The second CL contains all of the changes on top of the raw hidl2aidl output
8# that can be used for review.
Devin Moore32ca32b2023-01-12 19:28:46 +00009
10if [[ $# -ne 1 ]]; then
11 echo "Usage: $0 INTERFACE_NAME"
12 echo "- INTERFACE_NAME fully qualified HIDL interface name with version"
13 echo "example of creating the diffs for android.hardware.boot@1.2"
14 echo "$ ./anapic_hidl2aidl_review.sh android.hardware.boot@1.2"
15 exit 1
16fi
17
18# for pathmod
19source ${ANDROID_BUILD_TOP}/build/make/envsetup.sh
20
21set -ex
22type hidl2aidl 2>/dev/null || m hidl2aidl
23
24INTERFACE_NAME_NO_VER=${1%@*}
25pushd $(pathmod $INTERFACE_NAME_NO_VER)
26rm -rf android
27hidl2aidl -o . "$1"
28rm -rf conversion.log translate include
29git add -A
30git commit -am "convert $1" --no-edit
31git revert HEAD --no-edit
32git commit --amend --no-edit
Devin Moore3511c732023-02-22 00:37:12 +000033git diff HEAD~1 --stat
Devin Moorefc9a7222023-02-22 01:01:52 +000034repo upload . --no-verify --wip --hashtag=anapic_release_review
Devin Moore32ca32b2023-01-12 19:28:46 +000035popd