From e4fdab96e6b0afa5191d594261dc0b6b74af3059 Mon Sep 17 00:00:00 2001 From: "aurimas@chromium.org" Date: Fri, 4 Apr 2014 00:52:22 +0000 Subject: Add whitelist support for grit repack steps. -Adds new repack_options variables -Updates pragma to output numeric_id instead of resource_id -Updates find_used_resources.py to filter for numeric_id To use the existing system you need to do following steps: 1. Remove out directory (we need to do a clean build) 2. Append " enable_resource_whitelist_generation=1" to GYP_DEFINES 3. Run gyp 4. Build your target (e.g. chrome_shell_apk) saving output to a file (e.g. build.txt) 5. cat build.txt | tools/resources/find_used_resources.py > whitelist.txt 6. Append " repack_options='--whitelist /path/to/whitelist.txt'" 7. Run gyp 8. Build your target again. 9. ??? 10. Profit!!! BUG=338759 Review URL: https://codereview.chromium.org/216233012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261611 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/resources/find_used_resources.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/resources/find_used_resources.py') diff --git a/tools/resources/find_used_resources.py b/tools/resources/find_used_resources.py index 60af3e5..3fc3bce 100755 --- a/tools/resources/find_used_resources.py +++ b/tools/resources/find_used_resources.py @@ -18,7 +18,8 @@ script parses out the list of used resource ids. These resource ids show up in the build output after building Chrome with gyp variable enable_resource_whitelist_generation set to 1. This gyp flag causes the compiler to print out a UnknownPragma message every time a resource id is used. E.g.: -foo.cc:22:0: warning: ignoring #pragma IDS_FOO_BAR [-Wunknown-pragmas] +foo.cc:22:0: warning: ignoring #pragma whitelisted_resource_12345 +[-Wunknown-pragmas] """ @@ -29,7 +30,7 @@ def GetResourceIdsInPragmaWarnings(input): """ used_resources = set() unknown_pragma_warning_pattern = re.compile('warning: ignoring #pragma ' - '(?P[A-Z0-9_]*) \[-Wunknown-pragmas\]') + 'whitelisted_resource_(?P[0-9]*) \[-Wunknown-pragmas\]') for ln in input: match = unknown_pragma_warning_pattern.search(ln) if match: -- cgit v1.1