summaryrefslogtreecommitdiff
path: root/tools/aapt/Main.cpp
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2012-05-07 16:16:46 -0700
committerRaphael Moll <ralf@android.com>2012-05-09 21:16:26 -0700
commit90897ed87bce639bf6bb2ccf15fbabb59b131bab (patch)
tree53b5b28bf5a41e41a35751f12becef9dd94a0dbe /tools/aapt/Main.cpp
parentad3f86a526c49ecd733564771b5c2ce7eade2a96 (diff)
Support a new ANDROID_AAPT_IGNORE env var.
AAPT has a fixed built-in list of files and directories to ignore when parsing resource files. Over the years we always had developers requiring specific patterns. If the env var ANDROID_AAPT_IGNORE is set, it is parsed to find which file/directory patterns to ignore. Otherwise a default is used that matches the current behavior. Added a command-line option for it: aapt di --ignore-assets "foo*:*.blah" SDK Bug: 5343 24067 Change-Id: Ia4caa2a8188c8c1df143f884e459b8182645995f
Diffstat (limited to 'tools/aapt/Main.cpp')
-rw-r--r--tools/aapt/Main.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index d5d22300a0b5..9570c663cbea 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -176,7 +176,11 @@ void usage(void)
" --non-constant-id\n"
" Make the resources ID non constant. This is required to make an R java class\n"
" that does not contain the final value but is used to make reusable compiled\n"
- " libraries that need to access resources.\n");
+ " libraries that need to access resources.\n"
+ " --ignore-assets\n"
+ " Assets to be ignored. Default pattern is:\n"
+ " %s\n",
+ gDefaultIgnoreAssets);
}
/*
@@ -551,7 +555,16 @@ int main(int argc, char* const argv[])
bundle.setNonConstantId(true);
} else if (strcmp(cp, "-no-crunch") == 0) {
bundle.setUseCrunchCache(true);
- }else {
+ } else if (strcmp(cp, "-ignore-assets") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--ignore-assets' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ gUserIgnoreAssets = argv[0];
+ } else {
fprintf(stderr, "ERROR: Unknown option '-%s'\n", cp);
wantUsage = true;
goto bail;