summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2009-10-13 17:10:01 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-13 17:10:01 -0700
commit98d233606a831717af8af25715512251bf751aaa (patch)
tree8fb8ddb01091864a6de3cebdc95b04ec0c94ac8a /tools
parentd8f81c3bb781096dfdae6c01b534fc31aec51f4d (diff)
parentb80d1d0cc8b75b9e51c94169892f1d03cdcd788a (diff)
downloadframeworks_base-98d233606a831717af8af25715512251bf751aaa.zip
frameworks_base-98d233606a831717af8af25715512251bf751aaa.tar.gz
frameworks_base-98d233606a831717af8af25715512251bf751aaa.tar.bz2
am b80d1d0c: am afbf8afa: Merge change I564b5b00 into eclair-mr2
Merge commit 'b80d1d0cc8b75b9e51c94169892f1d03cdcd788a' * commit 'b80d1d0cc8b75b9e51c94169892f1d03cdcd788a': add "junk path" -k option to aapt
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt/Bundle.h13
-rw-r--r--tools/aapt/Command.cpp13
-rw-r--r--tools/aapt/Main.cpp4
3 files changed, 22 insertions, 8 deletions
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h
index 234e5b2..1ac13f2 100644
--- a/tools/aapt/Bundle.h
+++ b/tools/aapt/Bundle.h
@@ -80,11 +80,13 @@ public:
void setValues(bool val) { mValues = val; }
int getCompressionMethod(void) const { return mCompressionMethod; }
void setCompressionMethod(int val) { mCompressionMethod = val; }
+ bool getJunkPath(void) const { return mJunkPath; }
+ void setJunkPath(bool val) { mJunkPath = val; }
const char* getOutputAPKFile() const { return mOutputAPKFile; }
void setOutputAPKFile(const char* val) { mOutputAPKFile = val; }
- /*
- * Input options.
+ /*
+ * Input options.
*/
const char* getAssetSourceDir() const { return mAssetSourceDir; }
void setAssetSourceDir(const char* dir) { mAssetSourceDir = dir; }
@@ -119,7 +121,7 @@ public:
void setVersionCode(const char* val) { mVersionCode = val; }
const char* getVersionName() const { return mVersionName; }
void setVersionName(const char* val) { mVersionName = val; }
-
+
/*
* Set and get the file specification.
*
@@ -161,6 +163,7 @@ private:
bool mPseudolocalize;
bool mValues;
int mCompressionMethod;
+ bool mJunkPath;
const char* mOutputAPKFile;
const char* mAssetSourceDir;
const char* mProguardFile;
@@ -173,13 +176,13 @@ private:
android::Vector<const char*> mJarFiles;
android::Vector<const char*> mNoCompressExtensions;
android::Vector<const char*> mResourceSourceDirs;
-
+
const char* mMinSdkVersion;
const char* mTargetSdkVersion;
const char* mMaxSdkVersion;
const char* mVersionCode;
const char* mVersionName;
-
+
/* file specification */
int mArgc;
char* const* mArgv;
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 3019bd0..4067735 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);
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index e61010c..98286c0 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -99,6 +99,7 @@ void usage(void)
" -f force overwrite of existing files\n"
" -g specify a pixel tolerance to force images to grayscale, default 0\n"
" -j specify a jar or zip file containing classes to include\n"
+ " -k junk path of file(s) added\n"
" -m make package directories under location specified by -J\n"
#if 0
" -p pseudolocalize the default configuration\n"
@@ -236,6 +237,9 @@ int main(int argc, char* const argv[])
bundle.setGrayscaleTolerance(tolerance);
printf("%s: Images with deviation <= %d will be forced to grayscale.\n", prog, tolerance);
break;
+ case 'k':
+ bundle.setJunkPath(true);
+ break;
case 'm':
bundle.setMakePackageDirs(true);
break;