Commit 2310fc2b authored by olivierrobin's avatar olivierrobin Committed by Commit bot

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-Commit-Position: refs/heads/master@{#315324}
parent 8a822d0b
......@@ -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)',
......
......@@ -7,10 +7,8 @@
'chromium_code': 1,
'grit_base_dir': '<(SHARED_INTERMEDIATE_DIR)',
'grit_out_dir': '<(grit_base_dir)/ios/chrome',
'grit_defines': [
# TODO(lliabraa): Remove this whitelist.
'-w', '<(DEPTH)/ios/build/grit_whitelist.txt',
],
# TODO(lliabraa): Remove this whitelist.
'grit_whitelist': '<(DEPTH)/ios/build/grit_whitelist.txt',
},
'targets': [
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment