commit | d410a62fd5df26ba2ef9e1c09485ff501841aa4c | [log] [tgz] |
---|---|---|
author | Steven Moreland <smoreland@google.com> | Fri Feb 26 02:38:43 2021 +0000 |
committer | Steven Moreland <smoreland@google.com> | Fri Feb 26 02:43:24 2021 +0000 |
tree | d3f6670e0ec1c3292308a3ea407e789a08598c4f | |
parent | ba23144b0b04c4cd7eaf49fb8f1aa2671cacdef3 [diff] |
hidl-gen: don't format if it'll destroy comments hidl-gen has a limited capacity to handle comments, since it always tries to put them in the right place. Ideally, it could still handle these (large reworking of the AST/formatter/etc, it seems) or it would have had these restrictions on comment placement from the beginning (it's an interface file! how about we always know what thing a human wants to say something about, so that what the human wants to say about can be transformed when the source is transformed). Because of this, frequently when running the formatter, comments can get destroyed, and it can be easy to miss these. Now, a user must manually remove/fixup these comments before we destroy any information. Test: hidl-gen -Lformat android.hardware.neuralnetworks@1.2::IDevice (succeeds for one file) Test: hidl-gen -Lformat android.hardware.neuralnetworks@1.2::types (and you get warnings from one file) Test: hidl-gen -Lformat android.hardware.neuralnetworks@1.2 (and you get warnings from the whole package) Fixes: 180899879 Change-Id: Icce1262425fa70006fe5dea5ce0271ffb2b9492f
Full documentation can be found here: https://source.android.com/devices/architecture/hidl/
hidl-gen is a compiler for the HIDL (HAL Interface Design Language) which generates C++ and Java endpoints for RPC mechanisms. The main userspace libraries which this compiler uses can be found at system/libhidl.
m hidl-gen
Note that options for hidl-gen expected to be invoked by the build system are marked with ‘internal’ in the help menu.
hidl-gen -h hidl-gen -o output -L c++-impl -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0
Some defaults for package roots are also provided
hidl-gen -o output -L c++-impl android.hardware.nfc@1.0 hidl-gen -o output -L vts android.hardware.nfc@1.0 hidl-gen -L hash android.hardware.nfc@1.0
Example command for vendor project
hidl-gen -L c++-impl -r vendor.foo:vendor/foo/interfaces vendor.foo.nfc@1.0
See update-makefiles-helper.sh and update-all-google-makefiles.sh for examples of how to generate HIDL makefiles (using the -Landroidbp option).
NOTE: When using the -Landroidbp option, you can force generated modules to be installed in
/system_ext
rather than other partition by putting a marker file.hidl_for_system_ext
alongside*.hal
files.
NOTE: You can also install the vendor variant of the generated modules to be installed in
/odm
rather than/vendor
by putting a marker file.hidl_for_odm
alongside*.hal
files.
This is a helper tool to convert C headers to valid .hal files.
m c2hal && c2hal -h