Change grit whitelist to a string parameter

This CL changes the grit_whitelist parameter to be a string instead of a
part of grit_defines.
This allow user to override the parameter with another file.

The goal of this is to allow creating bundles with their own whitelists.

At the moment, if you want to create a small executable (i.e. an ios extension)
that only uses 3 strings, you are required to include all the strings
whitelisted by the main chrome bundle.
By allowing to override the whitelist argument (instead of only appending the
argument array, it will allow to specify a specific whitelist for a specific
target.

BUG=456837

Review URL: https://codereview.chromium.org/862043002

Cr-Original-Commit-Position: refs/heads/master@{#315324}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2310fc2b85b31504de87ba22d9d14fc406ed3147
This commit is contained in:
olivierrobin 2015-02-09 09:04:57 -08:00 коммит произвёл Commit bot
Родитель 84390759a7
Коммит fd979b62bf
2 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -2065,10 +2065,10 @@
},
'grit_defines': [
'-t', 'ios',
# iOS uses a whitelist to filter resources.
'-w', '<(DEPTH)/build/ios/grit_whitelist.txt',
'--no-output-all-resource-defines',
],
# iOS uses a whitelist to filter resources.
'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
# Enable host builds when generating with ninja-ios.
'conditions': [

Просмотреть файл

@ -21,6 +21,7 @@
# instead of build/common.gypi .
'grit_additional_defines%': [],
'grit_rc_header_format%': [],
'grit_whitelist%': '',
'conditions': [
# These scripts can skip writing generated files if they are identical
@ -36,6 +37,17 @@
}],
],
},
'conditions': [
['"<(grit_whitelist)"==""', {
'variables': {
'grit_whitelist_flag': [],
}
}, {
'variables': {
'grit_whitelist_flag': ['-w', '<(grit_whitelist)'],
}
}]
],
'inputs': [
'<!@pymod_do_main(grit_info <@(grit_defines) <@(grit_additional_defines) '
'--inputs <(grit_grd_file) -f "<(grit_resource_ids)")',
@ -51,6 +63,7 @@
'-o', '<(grit_out_dir)',
'--write-only-new=<(write_only_new)',
'<@(grit_defines)',
'<@(grit_whitelist_flag)',
'<@(grit_additional_defines)',
'<@(grit_rc_header_format)'],
'message': 'Generating resources from <(grit_grd_file)',