Add check for hidl package root hash.

When compiling a module, say foo.bar.baz@1.0::IBaz, assume the package
root is foo.bar:some/dir/interfaces, then:
- look at the file some/dir/interfaces/current.txt
- read hash from file corresponding from foo.bar.baz@1.0::IBaz
- file supports same-line comments with '#'
- format of file is each line is blank or looks like:
    "<sha-256 hash> <fqName>"
- if the file is misformed or the hal does not match a sha in that file,
    then it is considered build breakage.

Test: build with and without changing frozen files
Bug: 34178341
Change-Id: Ieddbc796ea974ac7c2e8b95ca69009c31e0cfb60
4 files changed
tree: e1266fa3ff7c79de878a998b1f341f8954132996
  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. generateCpp.cpp
  24. generateCppImpl.cpp
  25. generateJava.cpp
  26. generateVts.cpp
  27. HandleType.cpp
  28. HandleType.h
  29. Hash.cpp
  30. Hash.h
  31. hidl-gen_l.ll
  32. hidl-gen_y.yy
  33. HidlTypeAssertion.cpp
  34. HidlTypeAssertion.h
  35. Interface.cpp
  36. Interface.h
  37. Location.h
  38. main.cpp
  39. MemoryType.cpp
  40. MemoryType.h
  41. Method.cpp
  42. Method.h
  43. MODULE_LICENSE_APACHE2
  44. NamedType.cpp
  45. NamedType.h
  46. NOTICE
  47. PointerType.cpp
  48. PointerType.h
  49. README.md
  50. RefType.cpp
  51. RefType.h
  52. ScalarType.cpp
  53. ScalarType.h
  54. Scope.cpp
  55. Scope.h
  56. StringType.cpp
  57. StringType.h
  58. Type.cpp
  59. Type.h
  60. TypeDef.cpp
  61. TypeDef.h
  62. update-makefiles-helper.sh
  63. VectorType.cpp
  64. 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