Fix imports.

Allow imports to reference fully qualified names. Remove
recursive call in import lookup. Add test for references
using fully qualified names.

Bug: 65597200
Test: m hidl_test (type tests done statically)
Change-Id: I912f1201bfa2d00cbaf711a7c34b934271ff37f0
2 files changed
tree: 7f334e8ba0b0a98a3fd57bd342087a35613196de
  1. c2hal/
  2. include_hash/
  3. test/
  4. utils/
  5. .clang-format
  6. Android.bp
  7. Annotation.cpp
  8. Annotation.h
  9. ArrayType.cpp
  10. ArrayType.h
  11. AST.cpp
  12. AST.h
  13. CompoundType.cpp
  14. CompoundType.h
  15. ConstantExpression.cpp
  16. ConstantExpression.h
  17. Coordinator.cpp
  18. Coordinator.h
  19. DeathRecipientType.cpp
  20. DeathRecipientType.h
  21. EnumType.cpp
  22. EnumType.h
  23. FmqType.cpp
  24. FmqType.h
  25. generateCpp.cpp
  26. generateCppImpl.cpp
  27. generateJava.cpp
  28. generateVts.cpp
  29. HandleType.cpp
  30. HandleType.h
  31. Hash.cpp
  32. hidl-gen_l.ll
  33. hidl-gen_y.yy
  34. HidlTypeAssertion.cpp
  35. HidlTypeAssertion.h
  36. Interface.cpp
  37. Interface.h
  38. Location.cpp
  39. Location.h
  40. main.cpp
  41. MemoryType.cpp
  42. MemoryType.h
  43. Method.cpp
  44. Method.h
  45. MODULE_LICENSE_APACHE2
  46. NamedType.cpp
  47. NamedType.h
  48. NOTICE
  49. OWNERS
  50. PointerType.cpp
  51. PointerType.h
  52. PREUPLOAD.cfg
  53. README.md
  54. Reference.h
  55. RefType.cpp
  56. RefType.h
  57. ScalarType.cpp
  58. ScalarType.h
  59. Scope.cpp
  60. Scope.h
  61. StringType.cpp
  62. StringType.h
  63. Type.cpp
  64. Type.h
  65. TypeDef.cpp
  66. TypeDef.h
  67. update-all-google-makefiles.sh
  68. update-makefiles-helper.sh
  69. VectorType.cpp
  70. VectorType.h
README.md

hidl-gen user guide

1. Build

croot
make hidl-gen

2. Run

hidl-gen -o output-path -L language (-r interface-root) fqname

output-path: directory to store the output files.
language: output file for given language. e.g.c++, vts..

fqname: fully qualified name of the input files.
For singe file input, follow the format: package@version::fileName
For directory input, follow the format: package@version

interface-root(optional): prefix and root path for fqname.
If not set, use the default prefix: android.hardware and default root path
defined in $TOP.

examples:

croot
hidl-gen -o output -L c++ -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0::INfc.hal
hidl-gen -o output -L vts -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0
hidl-gen -o test -L c++ -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0
hidl-gen -L hash -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0