hidl-gen: multiple changes
1. Break up generateMakefileOrSourcesForPackage() into separate
functions for generating C++ and Android.mk files.
2. Add new command-line switch (-L) followed by a string to identify the
code generator. Supported code generators are -Lc++ and -Lmakefile,
like so:
hidl-gen -Lc++ \
-randroid.hardware:hardware/interfaces \
android.hardware.nfc@1.0
3. Remove the -m switch
4. Restore the ability to generate code for individual interfaces within
a package, as well as for entire packages. The following are valid
invokations of hidl-gen:
hidl-gen -o/tmp -Lc++ \
-randroid.hardware:hardware/interfaces \
android.hardware.nfc@1.0
hidl-gen -o /tmp -Lc++ \
-randroid.hardware:hardware/interfaces \
android.hardware.nfc@1.0::INfc
The first invokation will generate the following files under
/tmp/android/hardware/nfc/1.0:
/tmp/android/hardware/nfc/1.0/INfc.h
/tmp/android/hardware/nfc/1.0/BnNfc.h
/tmp/android/hardware/nfc/1.0/NfcAll.cpp
/tmp/android/hardware/nfc/1.0/BpNfc.h
The second invokation will result in:
/tmp/android/hardware/nfc/1.0/types.cpp
/tmp/android/hardware/nfc/1.0/INfc.h
/tmp/android/hardware/nfc/1.0/BnNfc.h
/tmp/android/hardware/nfc/1.0/NfcClientCallbackAll.cpp
/tmp/android/hardware/nfc/1.0/NfcAll.cpp
/tmp/android/hardware/nfc/1.0/BpNfcClientCallback.h
/tmp/android/hardware/nfc/1.0/BpNfc.h
/tmp/android/hardware/nfc/1.0/types.h
/tmp/android/hardware/nfc/1.0/BnNfcClientCallback.h
/tmp/android/hardware/nfc/1.0/INfcClientCallback.h
5. Fixed Android.mk generation to build every .hal file once. To make,
a HIDL interface I${name}.hal now maps to the target ${name}All.cpp
Change-Id: I83f76cbc847536bec03520bcaa39d8f449da67f2
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/AST.h b/AST.h
index 0a1eea6..026d90b 100644
--- a/AST.h
+++ b/AST.h
@@ -55,7 +55,7 @@
status_t generateCpp(const std::string &outputPath) const;
- void addImportedPackages(std::set<FQName> *importSet) const;
+ void getImportedPackages(std::set<FQName> *importSet) const;
private:
Coordinator *mCoordinator;