AAPT2: Implement density stripping and initial Split support
When a preferred density is supplied, the closest matching densities
will be selected, the rest stripped from the APK.
Split support will be enabled in a later CL. Command line support is still
needed, but the foundation is ready.
Bug:25958912
Change-Id: I56d599806b4ec4ffa24e17aad48d47130ca05c08
diff --git a/tools/aapt2/link/TableMerger.h b/tools/aapt2/link/TableMerger.h
index 4539679..b3c22dd 100644
--- a/tools/aapt2/link/TableMerger.h
+++ b/tools/aapt2/link/TableMerger.h
@@ -30,33 +30,11 @@
namespace aapt {
-struct FileToMerge {
- /**
- * The compiled file from which to read the data.
- */
- io::IFile* file;
-
- /**
- * Where the original, uncompiled file came from.
- */
- Source originalSource;
-
- /**
- * The destination path within the APK/archive.
- */
- std::string dstPath;
-};
-
struct TableMergerOptions {
/**
* If true, resources in overlays can be added without previously having existed.
*/
bool autoAddOverlay = false;
-
- /**
- * A filter that removes resources whose configurations don't match.
- */
- IConfigFilter* filter = nullptr;
};
/**
@@ -81,10 +59,6 @@
*/
TableMerger(IAaptContext* context, ResourceTable* outTable, const TableMergerOptions& options);
- const std::map<ResourceKeyRef, FileToMerge>& getFilesToMerge() {
- return mFilesToMerge;
- }
-
const std::set<std::u16string>& getMergedPackages() const {
return mMergedPackages;
}
@@ -119,8 +93,7 @@
private:
using FileMergeCallback = std::function<bool(const ResourceNameRef&,
const ConfigDescription& config,
- FileReference*,
- FileReference*)>;
+ FileReference*, FileReference*)>;
IAaptContext* mContext;
ResourceTable* mMasterTable;
@@ -128,7 +101,6 @@
ResourceTablePackage* mMasterPackage;
std::set<std::u16string> mMergedPackages;
- std::map<ResourceKeyRef, FileToMerge> mFilesToMerge;
bool mergeFileImpl(const ResourceFile& fileDesc, io::IFile* file, bool overlay);