3 if [ ! -d hardware/interfaces ] ; then
4 echo "Where is hardware/interfaces?";
8 if [ ! -d system/libhidl/transport ] ; then
9 echo "Where is system/libhidl/transport?";
13 packages=$(pushd hardware/interfaces > /dev/null; \
14 find . -type f -name \*.hal -exec dirname {} \; | sort -u | \
17 '{printf("android.hardware"); for(i=1;i<NF;i++){printf(".%s", $i);}; printf("@%s\n", $NF);}'; \
20 for p in $packages; do
22 hidl-gen -Lmakefile -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport $p;
23 rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
24 hidl-gen -Landroidbp -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport $p;
25 rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
28 # subdirectories of hardware/interfaces which contain an Android.bp file
29 android_dirs=$(find hardware/interfaces/*/ \
35 echo "Updating Android.bp files."
37 for bp_dir in $android_dirs; do
38 bp="$bp_dir/Android.bp"
39 # locations of Android.bp files in specific subdirectory of hardware/interfaces
40 android_bps=$(find $bp_dir \
42 ! -path $bp_dir/Android.bp \
46 echo "// This is an autogenerated file, do not edit." > "$bp";
47 echo "subdirs = [" >> "$bp";
48 for a in $android_bps; do
49 echo " \"${a#$bp_dir/}\"," >> "$bp";