From 90897ed87bce639bf6bb2ccf15fbabb59b131bab Mon Sep 17 00:00:00 2001 From: Raphael Moll Date: Mon, 7 May 2012 16:16:46 -0700 Subject: 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 --- tools/aapt/Main.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tools/aapt/Main.cpp') 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; -- cgit v1.2.3-59-g8ed1b