summaryrefslogtreecommitdiffstats
path: root/tools/aapt/Command.cpp
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2009-10-19 17:04:21 -0700
committerDoug Zongker <dougz@android.com>2009-10-19 17:04:21 -0700
commit37c4157d7cdad71dc9abc93d652e81c33e346d93 (patch)
tree8fbf09577c3882912db555221fc032e73b2e2e43 /tools/aapt/Command.cpp
parent62df88bcc95a714c1d5035471dfe7fe0ddd9d50b (diff)
downloadframeworks_base-37c4157d7cdad71dc9abc93d652e81c33e346d93.zip
frameworks_base-37c4157d7cdad71dc9abc93d652e81c33e346d93.tar.gz
frameworks_base-37c4157d7cdad71dc9abc93d652e81c33e346d93.tar.bz2
add "junk path" -k option to aapt (DO NOT MERGE)
Adds a "junk path" option to aapt so that you can do: aapt add -k archive.zip path/to/some.file and have the file stored in the zip under the name "some.file" (without the path). Needed so that we can use 'aapt add' in place of 'zip -j' when building jar files, which will lead to smaller incremental OTAs. (This is a cherry-pick of a change already submitted to eclair-mr2; the change was approved for mr1.)
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r--tools/aapt/Command.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 4742341..1a536d6 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -848,7 +848,7 @@ int doDump(Bundle* bundle)
printf("uses-feature:'android.hardware.camera'\n");
printf("uses-feature:'android.hardware.camera.autofocus'\n");
}
-
+
if (hasMainActivity) {
printf("main\n");
}
@@ -997,8 +997,15 @@ int doAdd(Bundle* bundle)
printf(" '%s'... (from gzip)\n", fileName);
result = zip->addGzip(fileName, String8(fileName).getBasePath().string(), NULL);
} else {
- printf(" '%s'...\n", fileName);
- result = zip->add(fileName, bundle->getCompressionMethod(), NULL);
+ if (bundle->getJunkPath()) {
+ String8 storageName = String8(fileName).getPathLeaf();
+ printf(" '%s' as '%s'...\n", fileName, storageName.string());
+ result = zip->add(fileName, storageName.string(),
+ bundle->getCompressionMethod(), NULL);
+ } else {
+ printf(" '%s'...\n", fileName);
+ result = zip->add(fileName, bundle->getCompressionMethod(), NULL);
+ }
}
if (result != NO_ERROR) {
fprintf(stderr, "Unable to add '%s' to '%s'", bundle->getFileSpecEntry(i), zipFileName);