diff options
author | 2023-09-06 18:52:41 +0000 | |
---|---|---|
committer | 2023-09-06 18:52:41 +0000 | |
commit | 4fb86ec92a08a65e2ab52f8e361edb15b380cfc4 (patch) | |
tree | a5bbde4223f39d17c527fbd38c100d539cf86339 /tools/aapt/Command.cpp | |
parent | 65a02ad0798646eb68c06c2166a2e306fb1b6d1c (diff) | |
parent | 13ab173d417f9b64161b0101d15b63fddf9fc0ee (diff) |
Merge "Move String8 path functions to androidfw and aapt" into main am: 713e3930c4 am: 0cfc1c6ddd am: 9a80e1b70c am: 13ab173d41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2723454
Change-Id: Id68d9725e711288d95290e07d3f656ed848fb69c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r-- | tools/aapt/Command.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index 60f3f2715395..800466aa587f 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -12,6 +12,7 @@ #include "ResourceTable.h" #include "XMLNode.h" +#include <androidfw/PathUtils.h> #include <utils/Errors.h> #include <utils/KeyedVector.h> #include <utils/List.h> @@ -2486,12 +2487,12 @@ int doAdd(Bundle* bundle) for (int i = 1; i < bundle->getFileSpecCount(); i++) { const char* fileName = bundle->getFileSpecEntry(i); - if (strcasecmp(String8(fileName).getPathExtension().c_str(), ".gz") == 0) { + if (strcasecmp(getPathExtension(String8(fileName)).c_str(), ".gz") == 0) { printf(" '%s'... (from gzip)\n", fileName); - result = zip->addGzip(fileName, String8(fileName).getBasePath().c_str(), NULL); + result = zip->addGzip(fileName, getBasePath(String8(fileName)).c_str(), NULL); } else { if (bundle->getJunkPath()) { - String8 storageName = String8(fileName).getPathLeaf(); + String8 storageName = getPathLeaf(String8(fileName)); printf(" '%s' as '%s'...\n", fileName, ResTable::normalizeForOutput(storageName.c_str()).c_str()); result = zip->add(fileName, storageName.c_str(), @@ -2617,10 +2618,10 @@ static String8 buildApkName(const String8& original, const sp<ApkSplit>& split) return original; } - String8 ext(original.getPathExtension()); + String8 ext(getPathExtension(original)); if (ext == String8(".apk")) { return String8::format("%s_%s%s", - original.getBasePath().c_str(), + getBasePath(original).c_str(), split->getDirectorySafeName().c_str(), ext.c_str()); } @@ -2756,7 +2757,7 @@ int doPackage(Bundle* bundle) // generate the dependency file in the R.java package subdirectory // e.g. gen/com/foo/app/R.java.d dependencyFile = String8(bundle->getRClassDir()); - dependencyFile.appendPath("R.java.d"); + appendPath(dependencyFile, "R.java.d"); } // Make sure we have a clean dependency file to start with fp = fopen(dependencyFile, "w"); |