diff options
author | aurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-04 00:52:22 +0000 |
---|---|---|
committer | aurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-04 00:52:22 +0000 |
commit | e4fdab96e6b0afa5191d594261dc0b6b74af3059 (patch) | |
tree | f089d7338b0241587889349989b5d9172861bd47 /tools/resources/find_used_resources.py | |
parent | 52b947706a2dfb230fe098daceddd0ca0b7fbb7d (diff) | |
download | chromium_src-e4fdab96e6b0afa5191d594261dc0b6b74af3059.zip chromium_src-e4fdab96e6b0afa5191d594261dc0b6b74af3059.tar.gz chromium_src-e4fdab96e6b0afa5191d594261dc0b6b74af3059.tar.bz2 |
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
Diffstat (limited to 'tools/resources/find_used_resources.py')
-rwxr-xr-x | tools/resources/find_used_resources.py | 5 |
1 files changed, 3 insertions, 2 deletions
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<resource_id>[A-Z0-9_]*) \[-Wunknown-pragmas\]') + 'whitelisted_resource_(?P<resource_id>[0-9]*) \[-Wunknown-pragmas\]') for ln in input: match = unknown_pragma_warning_pattern.search(ln) if match: |