Fix vts generation in hidl.

* Needs to generate the imported attributes (from types.hal in a
  different package) within an interface.

Test: make hidl-gen
      mma for hardware/interfaces
      successfully build the driver/profiler for
      android.hardware.graphics.allocator@2.0 locally.

Change-Id: I1c149d0fc76d9aaf662d8463a8bf485dc931e128
1 file changed
tree: 786a0eb526b68c191b362af4a5d3a1002b426dab
  1. c2hal/
  2. test/
  3. utils/
  4. Android.bp
  5. Annotation.cpp
  6. Annotation.h
  7. ArrayType.cpp
  8. ArrayType.h
  9. AST.cpp
  10. AST.h
  11. CompoundType.cpp
  12. CompoundType.h
  13. ConstantExpression.cpp
  14. ConstantExpression.h
  15. Coordinator.cpp
  16. Coordinator.h
  17. DeathRecipientType.cpp
  18. DeathRecipientType.h
  19. EnumType.cpp
  20. EnumType.h
  21. FmqType.cpp
  22. FmqType.h
  23. FQName.cpp
  24. FQName.h
  25. generateCpp.cpp
  26. generateCppImpl.cpp
  27. generateJava.cpp
  28. generateVts.cpp
  29. HandleType.cpp
  30. HandleType.h
  31. hidl-gen_l.ll
  32. hidl-gen_y.yy
  33. Interface.cpp
  34. Interface.h
  35. Location.h
  36. main.cpp
  37. MemoryType.cpp
  38. MemoryType.h
  39. Method.cpp
  40. Method.h
  41. MODULE_LICENSE_APACHE2
  42. NamedType.cpp
  43. NamedType.h
  44. NOTICE
  45. PointerType.cpp
  46. PointerType.h
  47. README.md
  48. RefType.cpp
  49. RefType.h
  50. ScalarType.cpp
  51. ScalarType.h
  52. Scope.cpp
  53. Scope.h
  54. StringType.cpp
  55. StringType.h
  56. Type.cpp
  57. Type.h
  58. TypeDef.cpp
  59. TypeDef.h
  60. VectorType.cpp
  61. 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