summaryrefslogtreecommitdiffstats
path: root/update-base-files.sh
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2016-12-12 09:44:30 -0800
committerSteven Moreland <smoreland@google.com>2016-12-12 09:48:00 -0800
commit4e84644ddc966ce7b5f063f0311aca3ce0096ba5 (patch)
tree9c944db6a7e6732da0f799f5579e072ca4cad195 /update-base-files.sh
parent30f4ad6b149c63897e0758e572f9d52ea2535817 (diff)
downloadandroid_hardware_interfaces-4e84644ddc966ce7b5f063f0311aca3ce0096ba5.tar.gz
android_hardware_interfaces-4e84644ddc966ce7b5f063f0311aca3ce0096ba5.tar.bz2
android_hardware_interfaces-4e84644ddc966ce7b5f063f0311aca3ce0096ba5.zip
Add script to generate all *-base.h's.
In order to resolve b/31800672, we added a target to hidl, -Lexport-headers, which creates a C compatible header file that targets can link against to get access to hidl constants without having to link against the hidl code directly. However, these files are (for some reason) not generated at build time. Until they are, this file can be used to update and keep track of them. Bug: 32883144 Test: ran script Change-Id: Ib07433f98c4152ca34b48789dcb117eb262241cb
Diffstat (limited to 'update-base-files.sh')
-rwxr-xr-xupdate-base-files.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/update-base-files.sh b/update-base-files.sh
new file mode 100755
index 000000000..e2331f5da
--- /dev/null
+++ b/update-base-files.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+if [ ! -d hardware/interfaces ] ; then
+ echo "Where is hardware/interfaces?";
+ exit 1;
+fi
+
+if [ ! -d system/libhidl/transport ] ; then
+ echo "Where is system/libhidl/transport?";
+ exit 1;
+fi
+
+echo "WARNING: This script changes files in many places."
+
+# These files only exist to facilitate the easy transition to hidl.
+
+options="-Lexport-header \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport"
+
+# hardware/libhardware
+hidl-gen $options \
+ -o hardware/libhardware/include/hardware/sensors-base.h \
+ android.hardware.sensors@1.0
+hidl-gen $options \
+ -o hardware/libhardware/include/hardware/nfc-base.h \
+ android.hardware.nfc@1.0
+
+# system/core
+hidl-gen $options \
+ -o system/core/include/system/graphics-base.h \
+ android.hardware.graphics.common@1.0
+
+# system/media
+hidl-gen $options \
+ -o system/media/audio/include/system/audio-base.h \
+ android.hardware.audio.common@2.0
+hidl-gen $options \
+ -o system/media/audio/include/system/audio_effect-base.h \
+ android.hardware.audio.effect@2.0