diff options
Diffstat (limited to 'tools/aapt2/ManifestMerger.h')
-rw-r--r-- | tools/aapt2/ManifestMerger.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/aapt2/ManifestMerger.h b/tools/aapt2/ManifestMerger.h new file mode 100644 index 0000000..c6219db --- /dev/null +++ b/tools/aapt2/ManifestMerger.h @@ -0,0 +1,45 @@ +#ifndef AAPT_MANIFEST_MERGER_H +#define AAPT_MANIFEST_MERGER_H + +#include "Logger.h" +#include "Source.h" +#include "XmlDom.h" + +#include <memory> +#include <string> + +namespace aapt { + +class ManifestMerger { +public: + struct Options { + }; + + ManifestMerger(const Options& options); + + bool setAppManifest(const Source& source, const std::u16string& package, + std::unique_ptr<xml::Node> root); + + bool mergeLibraryManifest(const Source& source, const std::u16string& package, + std::unique_ptr<xml::Node> libRoot); + + xml::Node* getMergedXml(); + + bool printMerged(); + +private: + bool mergeNewOrEqual(xml::Element* parentA, xml::Element* elA, xml::Element* elB); + bool mergePreferRequired(xml::Element* parentA, xml::Element* elA, xml::Element* elB); + bool checkEqual(xml::Element* elA, xml::Element* elB); + bool mergeApplication(xml::Element* applicationA, xml::Element* applicationB); + bool mergeUsesSdk(xml::Element* elA, xml::Element* elB); + + Options mOptions; + std::unique_ptr<xml::Node> mRoot; + SourceLogger mAppLogger; + SourceLogger mLogger; +}; + +} // namespace aapt + +#endif // AAPT_MANIFEST_MERGER_H |