X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/e8d920f9f31f6bc817539d87c1a4953e71b86eec..901384222cb775bceec4723c285866bd4617b4bb:/AaptAssets.cpp?ds=sidebyside diff --git a/AaptAssets.cpp b/AaptAssets.cpp index 29d2b87..d66cdf0 100644 --- a/AaptAssets.cpp +++ b/AaptAssets.cpp @@ -1560,10 +1560,10 @@ status_t AaptDir::addLeafFile(const String8& leafName, const sp& file) } ssize_t AaptDir::slurpFullTree(Bundle* bundle, const String8& srcDir, - const AaptGroupEntry& kind, const String8& resType) + const AaptGroupEntry& kind, const String8& resType, + sp& fullResPaths) { Vector fileNames; - { DIR* dir = NULL; @@ -1586,9 +1586,14 @@ ssize_t AaptDir::slurpFullTree(Bundle* bundle, const String8& srcDir, if (isHidden(srcDir.string(), entry->d_name)) continue; - fileNames.add(String8(entry->d_name)); + String8 name(entry->d_name); + fileNames.add(name); + // Add fully qualified path for dependency purposes + // if we're collecting them + if (fullResPaths != NULL) { + fullResPaths->add(srcDir.appendPathCopy(name)); + } } - closedir(dir); } @@ -1615,7 +1620,7 @@ ssize_t AaptDir::slurpFullTree(Bundle* bundle, const String8& srcDir, notAdded = true; } ssize_t res = subdir->slurpFullTree(bundle, pathName, kind, - resType); + resType, fullResPaths); if (res < NO_ERROR) { return res; } @@ -1847,7 +1852,7 @@ ssize_t AaptAssets::slurpFromArgs(Bundle* bundle) sp assetAaptDir = makeDir(String8(kAssetDir)); AaptGroupEntry group; count = assetAaptDir->slurpFullTree(bundle, assetRoot, group, - String8()); + String8(), mFullAssetPaths); if (count < 0) { totalCount = count; goto bail; @@ -1878,6 +1883,7 @@ ssize_t AaptAssets::slurpFromArgs(Bundle* bundle) sp nextOverlay = new AaptAssets(); current->setOverlay(nextOverlay); current = nextOverlay; + current->setFullResPaths(mFullResPaths); } count = current->slurpResourceTree(bundle, String8(res)); @@ -1920,7 +1926,7 @@ ssize_t AaptAssets::slurpFromArgs(Bundle* bundle) * guarantees about ordering, so we're okay with an inorder search * using whatever order the OS happens to hand back to us. */ - count = slurpFullTree(bundle, assetRoot, AaptGroupEntry(), String8()); + count = slurpFullTree(bundle, assetRoot, AaptGroupEntry(), String8(), mFullAssetPaths); if (count < 0) { /* failure; report error and remove archive */ totalCount = count; @@ -1946,9 +1952,10 @@ bail: ssize_t AaptAssets::slurpFullTree(Bundle* bundle, const String8& srcDir, const AaptGroupEntry& kind, - const String8& resType) + const String8& resType, + sp& fullResPaths) { - ssize_t res = AaptDir::slurpFullTree(bundle, srcDir, kind, resType); + ssize_t res = AaptDir::slurpFullTree(bundle, srcDir, kind, resType, fullResPaths); if (res > 0) { mGroupEntries.add(kind); } @@ -2010,7 +2017,7 @@ ssize_t AaptAssets::slurpResourceTree(Bundle* bundle, const String8& srcDir) if (type == kFileTypeDirectory) { sp dir = makeDir(String8(entry->d_name)); ssize_t res = dir->slurpFullTree(bundle, subdirName, group, - resType); + resType, mFullResPaths); if (res < 0) { count = res; goto bail;