summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2017-03-21 01:47:05 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-21 01:47:05 +0000
commit98d9315d9bfa6f7e3b3d24f2a222ea2926a9f179 (patch)
tree2c8e0537c008105644eb99d04faa49e3e4c8f462
parent452fd91e78340ecb569e4a73fc9daff23d396b5c (diff)
parent4dc19f7050814d0e73885795a069182ea3b49cc4 (diff)
downloadinterfaces-98d9315d9bfa6f7e3b3d24f2a222ea2926a9f179.tar.gz
Use simplified update-makefiles.sh script. am: 208a4b70ea
am: 4dc19f7050 Change-Id: Icd01dc75d245ed3c7f3dcc66cf30f7b19b53f3f4
-rwxr-xr-xupdate-makefiles.sh53
1 files changed, 4 insertions, 49 deletions
diff --git a/update-makefiles.sh b/update-makefiles.sh
index acc593a..39b9006 100755
--- a/update-makefiles.sh
+++ b/update-makefiles.sh
@@ -1,53 +1,8 @@
#!/bin/bash
-#TODO(b/35916648) : Cleanup script to have a common implementation
-if [ ! -d system/hardware/interfaces ] ; then
- echo "Where is system/hardware/interfaces?";
- exit 1;
-fi
+source system/tools/hidl/update-makefiles-helper.sh
-if [ ! -d system/libhidl/transport ] ; then
- echo "Where is system/libhidl/transport?";
- exit 1;
-fi
+do_makefiles_update \
+ "android.system:system/hardware/interfaces" \
+ "android.hidl:system/libhidl/transport"
-packages=$(pushd system/hardware/interfaces > /dev/null; \
- find . -type f -name \*.hal -exec dirname {} \; | sort -u | \
- cut -c3- | \
- awk -F'/' \
- '{printf("android.system"); for(i=1;i<NF;i++){printf(".%s", $i);}; printf("@%s\n", $NF);}'; \
- popd > /dev/null)
-
-for p in $packages; do
- echo "Updating $p";
- hidl-gen -Lmakefile -r android.system:system/hardware/interfaces -r android.hidl:system/libhidl/transport $p;
- rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
- hidl-gen -Landroidbp -r android.system:system/hardware/interfaces -r android.hidl:system/libhidl/transport $p;
- rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
-done
-
-# subdirectories of system/hardware/interfaces which contain an Android.bp file
-android_dirs=$(find system/hardware/interfaces/*/ \
- -name "Android.bp" \
- -printf "%h\n" \
- | cut -d "/" -f1-3 \
- | sort | uniq)
-
-echo "Updating Android.bp files."
-
-for bp_dir in $android_dirs; do
- bp="$bp_dir/Android.bp"
- # locations of Android.bp files in specific subdirectory of system/hardware/interfaces
- android_bps=$(find $bp_dir \
- -name "Android.bp" \
- ! -path $bp_dir/Android.bp \
- -printf "%h\n" \
- | sort)
-
- echo "// This is an autogenerated file, do not edit." > "$bp";
- echo "subdirs = [" >> "$bp";
- for a in $android_bps; do
- echo " \"${a#$bp_dir/}\"," >> "$bp";
- done
- echo "]" >> "$bp";
-done