Skip to content

Commit

Permalink
Do not build device/bluetooth strings when extensions are disabled.
Browse files Browse the repository at this point in the history
BUG=334407

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

Cr-Commit-Position: refs/heads/master@{#288953}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288953 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
thestig@chromium.org committed Aug 12, 2014
1 parent d154b3f commit f3fc594
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
3 changes: 2 additions & 1 deletion chrome/chrome_repack_locales.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
'inputs': [
'<(repack_locales_path)',
'<!@pymod_do_main(repack_locales -i -p <(OS) <(branding_flag) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) --use-ash <(use_ash) <(chromeos_flag) --enable-autofill-dialog <(enable_autofill_dialog) <(pak_locales))'
'<!@pymod_do_main(repack_locales -i -p <(OS) <(branding_flag) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) --use-ash <(use_ash) <(chromeos_flag) --enable-autofill-dialog <(enable_autofill_dialog) --enable-extensions <(enable_extensions) <(pak_locales))'
],
'outputs': [
'<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(pak_locales))'
Expand All @@ -39,6 +39,7 @@
'--use-ash=<(use_ash)',
'<@(chromeos_flag)',
'--enable-autofill-dialog=<(enable_autofill_dialog)',
'--enable-extensions=<(enable_extensions)',
'<@(repack_options)',
'<@(pak_locales)',
],
Expand Down
8 changes: 6 additions & 2 deletions chrome/chrome_resources.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,6 @@
'dependencies': [
'<(DEPTH)/content/app/strings/content_strings.gyp:content_strings',
'<(DEPTH)/content/content_resources.gyp:content_resources',
'<(DEPTH)/device/bluetooth/bluetooth_strings.gyp:device_bluetooth_strings',
'<(DEPTH)/extensions/extensions_strings.gyp:extensions_strings',
'<(DEPTH)/third_party/WebKit/public/blink_resources.gyp:blink_resources',
'<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
],
Expand All @@ -466,6 +464,12 @@
'<(DEPTH)/third_party/libaddressinput/libaddressinput.gyp:libaddressinput_strings',
],
}],
['enable_extensions==1', {
'dependencies': [
'<(DEPTH)/device/bluetooth/bluetooth_strings.gyp:device_bluetooth_strings',
'<(DEPTH)/extensions/extensions_strings.gyp:extensions_strings',
],
}],
['OS != "mac" and OS != "ios"', {
# Copy pak files to the product directory. These files will be picked
# up by the following installer scripts:
Expand Down
27 changes: 17 additions & 10 deletions chrome/tools/build/repack_locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

USE_ASH = False
ENABLE_AUTOFILL_DIALOG = False
ENABLE_EXTENSIONS = False

WHITELIST = None

Expand Down Expand Up @@ -101,28 +102,29 @@ def calc_inputs(locale):
inputs.append(os.path.join(SHARE_INT_DIR, 'ui', 'strings',
'ui_strings_%s.pak' % locale))

#e.g. '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_da.pak',
inputs.append(os.path.join(SHARE_INT_DIR, 'ui', 'strings',
'app_locale_settings_%s.pak' % locale))

if ENABLE_AUTOFILL_DIALOG and OS != 'ios' and OS != 'android':
#e.g. '<(SHARED_INTERMEDIATE_DIR)/third_party/libaddressinput/
# address_input_strings_da.pak',
inputs.append(os.path.join(SHARE_INT_DIR, 'third_party', 'libaddressinput',
'address_input_strings_%s.pak' % locale))

if ENABLE_EXTENSIONS:
#e.g. '<(SHARED_INTERMEDIATE_DIR)/device/bluetooth/strings/
# device_bluetooth_strings_da.pak',
inputs.append(os.path.join(SHARE_INT_DIR, 'device', 'bluetooth', 'strings',
'device_bluetooth_strings_%s.pak' % locale))

#e.g. '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_da.pak',
inputs.append(os.path.join(SHARE_INT_DIR, 'ui', 'strings',
'app_locale_settings_%s.pak' % locale))

# For example:
# '<(SHARED_INTERMEDIATE_DIR)/extensions/strings/extensions_strings_da.pak
# TODO(jamescook): When Android stops building extensions code move this
# to the OS != 'ios' and OS != 'android' section below.
inputs.append(os.path.join(SHARE_INT_DIR, 'extensions', 'strings',
'extensions_strings_%s.pak' % locale))

if ENABLE_AUTOFILL_DIALOG and OS != 'ios' and OS != 'android':
#e.g. '<(SHARED_INTERMEDIATE_DIR)/third_party/libaddressinput/
# address_input_strings_da.pak',
inputs.append(os.path.join(SHARE_INT_DIR, 'third_party', 'libaddressinput',
'address_input_strings_%s.pak' % locale))

#e.g. '<(grit_out_dir)/google_chrome_strings_da.pak'
# or
# '<(grit_out_dir)/chromium_strings_da.pak'
Expand Down Expand Up @@ -183,6 +185,7 @@ def DoMain(argv):
global USE_ASH
global WHITELIST
global ENABLE_AUTOFILL_DIALOG
global ENABLE_EXTENSIONS
global EXTRA_INPUT_FILES

parser = optparse.OptionParser("usage: %prog [options] locales")
Expand Down Expand Up @@ -212,6 +215,9 @@ def DoMain(argv):
parser.add_option("--enable-autofill-dialog", action="store",
dest="enable_autofill_dialog",
help="Whether to include strings for autofill dialog")
parser.add_option("--enable-extensions", action="store",
dest="enable_extensions",
help="Whether to include strings for extensions")
options, locales = parser.parse_args(argv)

if not locales:
Expand All @@ -229,6 +235,7 @@ def DoMain(argv):
USE_ASH = options.use_ash == '1'
WHITELIST = options.whitelist
ENABLE_AUTOFILL_DIALOG = options.enable_autofill_dialog == '1'
ENABLE_EXTENSIONS = options.enable_extensions == '1'

if not OS:
if sys.platform == 'darwin':
Expand Down

0 comments on commit f3fc594

Please sign in to comment.