Commit 01bdc920 authored by aurimas@google.com's avatar aurimas@google.com

Clean up repack.py and repack_locale.py usage.

- Creates repack_pack.gypi action
- Updates all the call-sites of repack.py
- Removes chrome_repack_pseudo_locales.gypi to instead use
  chrome_repack_locales.gypi
- Remove unused repack_locales_cmd list

BUG=338759
R=tfarina@chromium.org, thakis@chromium.org
TBR=asargent@chromium.org, benm@chromium.org, blundell@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260279 0039d316-1c4b-4281-b951-d872f2087c98
parent 65486ad7
...@@ -51,9 +51,6 @@ ...@@ -51,9 +51,6 @@
'<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources', '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
'<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources', '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
], ],
'variables': {
'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
},
'actions': [ 'actions': [
{ {
'action_name': 'repack_android_webview_pack', 'action_name': 'repack_android_webview_pack',
...@@ -65,16 +62,9 @@ ...@@ -65,16 +62,9 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
], ],
'pak_output': '<(PRODUCT_DIR)/android_webview_apk/assets/webviewchromium.pak',
}, },
'inputs': [ 'includes': [ '../build/repack_action.gypi' ],
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(PRODUCT_DIR)/android_webview_apk/assets/webviewchromium.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)',
'<@(pak_inputs)'],
} }
], ],
}, },
......
...@@ -117,9 +117,6 @@ ...@@ -117,9 +117,6 @@
'../ui/base/strings/ui_strings.gyp:ui_strings', '../ui/base/strings/ui_strings.gyp:ui_strings',
'../ui/resources/ui_resources.gyp:ui_resources', '../ui/resources/ui_resources.gyp:ui_resources',
], ],
'variables': {
'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
},
'actions': [ 'actions': [
{ {
'action_name': 'repack_app_shell_pack', 'action_name': 'repack_app_shell_pack',
...@@ -139,16 +136,9 @@ ...@@ -139,16 +136,9 @@
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings/ui_strings_en-US.pak', '<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings/ui_strings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
], ],
'pak_output': '<(PRODUCT_DIR)/app_shell.pak',
}, },
'inputs': [ 'includes': [ '../build/repack_action.gypi' ],
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(PRODUCT_DIR)/app_shell.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)',
'<@(pak_inputs)'],
}, },
], ],
}, },
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included into an action to invoke grit repack in a
# consistent manner. To use this the following variables need to be
# defined:
# pak_inputs: list: paths of pak files that need to be combined.
# pak_output: string: the output pak file path.
{
'variables': {
'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
},
'inputs': [
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(pak_output)'
],
'action': ['python', '<(repack_path)', '<(pak_output)', '<@(pak_inputs)'],
}
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
'allocator_target': '../base/allocator/allocator.gyp:allocator', 'allocator_target': '../base/allocator/allocator.gyp:allocator',
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome', 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out', 'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
'repack_locales_cmd': ['python', 'tools/build/repack_locales.py'],
'conditions': [ 'conditions': [
['OS!="ios"', { ['OS!="ios"', {
'chromium_browser_dependencies': [ 'chromium_browser_dependencies': [
......
...@@ -108,7 +108,6 @@ ...@@ -108,7 +108,6 @@
}], }],
], ],
'libpeer_target_type%': 'static_library', 'libpeer_target_type%': 'static_library',
'repack_path': '../tools/grit/grit/format/repack.py',
}, },
'postbuilds': [ 'postbuilds': [
{ {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
'<(grit_out_dir)/renderer_resources_100_percent.pak', '<(grit_out_dir)/renderer_resources_100_percent.pak',
'<(grit_out_dir)/theme_resources_100_percent.pak', '<(grit_out_dir)/theme_resources_100_percent.pak',
], ],
'pak_output': '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak',
'conditions': [ 'conditions': [
['OS != "ios"', { ['OS != "ios"', {
'pak_inputs': [ 'pak_inputs': [
...@@ -23,12 +24,5 @@ ...@@ -23,12 +24,5 @@
}], }],
], ],
}, },
'inputs': [ 'includes': [ '../build/repack_action.gypi' ],
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
} }
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
'<(grit_out_dir)/renderer_resources_200_percent.pak', '<(grit_out_dir)/renderer_resources_200_percent.pak',
'<(grit_out_dir)/theme_resources_200_percent.pak', '<(grit_out_dir)/theme_resources_200_percent.pak',
], ],
'pak_output': '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_200_percent.pak',
'conditions': [ 'conditions': [
['OS != "ios"', { ['OS != "ios"', {
'pak_inputs': [ 'pak_inputs': [
...@@ -23,12 +24,5 @@ ...@@ -23,12 +24,5 @@
}], }],
], ],
}, },
'inputs': [ 'includes': [ '../build/repack_action.gypi' ],
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome_200_percent.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
} }
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# To use this the following variables need to be defined:
# pak_locales: string: the list of all the locales that need repacking
{ {
'action_name': 'repack_locales',
'variables': { 'variables': {
'repack_locales_path': 'tools/build/repack_locales.py',
'conditions': [ 'conditions': [
['branding=="Chrome"', { ['branding=="Chrome"', {
'branding_flag': ['-b', 'google_chrome',], 'branding_flag': ['-b', 'google_chrome',],
...@@ -11,25 +14,23 @@ ...@@ -11,25 +14,23 @@
'branding_flag': ['-b', 'chromium',], 'branding_flag': ['-b', 'chromium',],
}], }],
], ],
'repack_extra_flags%': [],
'repack_output_dir%': '<(SHARED_INTERMEDIATE_DIR)',
}, },
'inputs': [ 'inputs': [
'tools/build/repack_locales.py', '<(repack_locales_path)',
'<!@pymod_do_main(repack_locales -i -p <(OS) <(branding_flag) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(repack_output_dir) --use-ash <(use_ash) <(repack_extra_flags) <(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) <(pak_locales))'
], ],
'outputs': [ 'outputs': [
'<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(repack_output_dir) <(locales))' '<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(pak_locales))'
], ],
'action': [ 'action': [
'<@(repack_locales_cmd)', 'python',
'<(repack_locales_path)',
'<@(branding_flag)', '<@(branding_flag)',
'-p', '<(OS)', '-p', '<(OS)',
'-g', '<(grit_out_dir)', '-g', '<(grit_out_dir)',
'-s', '<(SHARED_INTERMEDIATE_DIR)', '-s', '<(SHARED_INTERMEDIATE_DIR)',
'-x', '<(repack_output_dir)/.', '-x', '<(SHARED_INTERMEDIATE_DIR)/.',
'--use-ash', '<(use_ash)', '--use-ash', '<(use_ash)',
'<@(repack_extra_flags)', '<@(pak_locales)',
'<@(locales)',
], ],
} }
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'action_name': 'repack_pseudo_locales',
'variables': {
'conditions': [
['branding=="Chrome"', {
'branding_flag': ['-b', 'google_chrome',],
}, { # else: branding!="Chrome"
'branding_flag': ['-b', 'chromium',],
}],
],
},
'inputs': [
'tools/build/repack_locales.py',
'<!@pymod_do_main(repack_locales -i -p <(OS) <(branding_flag) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(INTERMEDIATE_DIR) --use-ash <(use_ash) <(pseudo_locales))'
],
'conditions': [
['OS == "mac" or OS == "ios"', {
'outputs': [
'<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(pseudo_locales))'
],
}, { # else 'OS != "mac"'
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(pseudo_locales).pak'
],
}],
],
'action': [
'<@(repack_locales_cmd)',
'<@(branding_flag)',
'-p', '<(OS)',
'-g', '<(grit_out_dir)',
'-s', '<(SHARED_INTERMEDIATE_DIR)',
'-x', '<(SHARED_INTERMEDIATE_DIR)/.',
'--use-ash', '<(use_ash)',
'<@(pseudo_locales)',
],
}
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
'<(grit_out_dir)/sync_internals_resources.pak', '<(grit_out_dir)/sync_internals_resources.pak',
'<(grit_out_dir)/translate_internals_resources.pak', '<(grit_out_dir)/translate_internals_resources.pak',
], ],
'pak_output': '<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak',
'conditions': [ 'conditions': [
['OS != "ios"', { ['OS != "ios"', {
'pak_inputs': [ 'pak_inputs': [
...@@ -44,12 +45,5 @@ ...@@ -44,12 +45,5 @@
}], }],
], ],
}, },
'inputs': [ 'includes': [ '../build/repack_action.gypi' ],
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome', 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
'about_credits_file': '<(SHARED_INTERMEDIATE_DIR)/about_credits.html', 'about_credits_file': '<(SHARED_INTERMEDIATE_DIR)/about_credits.html',
'additional_modules_list_file': '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/internal/additional_modules_list.txt', 'additional_modules_list_file': '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/internal/additional_modules_list.txt',
'repack_locales_cmd': ['python', 'tools/build/repack_locales.py'],
}, },
'targets': [ 'targets': [
{ {
...@@ -320,9 +319,6 @@ ...@@ -320,9 +319,6 @@
{ {
'target_name': 'packed_extra_resources', 'target_name': 'packed_extra_resources',
'type': 'none', 'type': 'none',
'variables': {
'repack_path': '../tools/grit/grit/format/repack.py',
},
'dependencies': [ 'dependencies': [
'chrome_extra_resources', 'chrome_extra_resources',
'packed_resources', 'packed_resources',
...@@ -350,9 +346,6 @@ ...@@ -350,9 +346,6 @@
{ {
'target_name': 'packed_resources', 'target_name': 'packed_resources',
'type': 'none', 'type': 'none',
'variables': {
'repack_path': '../tools/grit/grit/format/repack.py',
},
'dependencies': [ 'dependencies': [
# MSVS needs the dependencies explictly named, Make is able to # MSVS needs the dependencies explictly named, Make is able to
# derive the dependencies from the output files. # derive the dependencies from the output files.
...@@ -367,10 +360,18 @@ ...@@ -367,10 +360,18 @@
], ],
'actions': [ 'actions': [
{ {
'action_name': 'repack_locales_pack',
'variables': {
'pak_locales': '<(locales)',
},
'includes': ['chrome_repack_locales.gypi'] 'includes': ['chrome_repack_locales.gypi']
}, },
{ {
'includes': ['chrome_repack_pseudo_locales.gypi'] 'action_name': 'repack_pseudo_locales_pack',
'variables': {
'pak_locales': '<(pseudo_locales)',
},
'includes': ['chrome_repack_locales.gypi']
}, },
{ {
'includes': ['chrome_repack_chrome_100_percent.gypi'] 'includes': ['chrome_repack_chrome_100_percent.gypi']
......
...@@ -561,21 +561,13 @@ ...@@ -561,21 +561,13 @@
{ {
'action_name': 'repack_components_pack', 'action_name': 'repack_components_pack',
'variables': { 'variables': {
'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
'pak_inputs': [ 'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/components/component_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/components/component_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/components/strings/component_strings_en-US.pak', '<(SHARED_INTERMEDIATE_DIR)/components/strings/component_strings_en-US.pak',
], ],
'pak_output': '<(PRODUCT_DIR)/components_resources.pak',
}, },
'inputs': [ 'includes': [ '../build/repack_action.gypi' ],
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(PRODUCT_DIR)/components_resources.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)',
'<@(pak_inputs)'],
}, },
], ],
'conditions': [ 'conditions': [
......
...@@ -473,9 +473,6 @@ ...@@ -473,9 +473,6 @@
], ],
}], }],
], ],
'variables': {
'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
},
'actions': [ 'actions': [
{ {
'action_name': 'repack_content_shell_pack', 'action_name': 'repack_content_shell_pack',
...@@ -493,13 +490,6 @@ ...@@ -493,13 +490,6 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
], ],
},
'inputs': [
'<(repack_path)',
'<@(pak_inputs)',
],
'action': ['python', '<(repack_path)', '<@(_outputs)',
'<@(pak_inputs)'],
'conditions': [ 'conditions': [
['OS!="android"', { ['OS!="android"', {
'variables': { 'variables': {
...@@ -507,16 +497,14 @@ ...@@ -507,16 +497,14 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
], ],
}, },
'outputs': [ 'pak_output': '<(PRODUCT_DIR)/content_shell.pak',
'<(PRODUCT_DIR)/content_shell.pak',
],
}, { }, {
'outputs': [ 'pak_output': '<(PRODUCT_DIR)/content_shell/assets/content_shell.pak',
'<(PRODUCT_DIR)/content_shell/assets/content_shell.pak',
],
}], }],
], ],
}, },
'includes': [ '../build/repack_action.gypi' ],
},
], ],
}, },
{ {
......
...@@ -44,9 +44,6 @@ ...@@ -44,9 +44,6 @@
'../base/strings/ui_strings.gyp:ui_strings', '../base/strings/ui_strings.gyp:ui_strings',
'ui_resources', 'ui_resources',
], ],
'variables': {
'repack_path': '../../tools/grit/grit/format/repack.py',
},
'actions': [ 'actions': [
{ {
'action_name': 'repack_ui_test_pack', 'action_name': 'repack_ui_test_pack',
...@@ -57,20 +54,9 @@ ...@@ -57,20 +54,9 @@
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/webui_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/webui_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings/ui_strings_en-US.pak', '<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings/ui_strings_en-US.pak',
], ],
'pak_output': '<(PRODUCT_DIR)/ui_test.pak',
}, },
'inputs': [ 'includes': [ '../../build/repack_action.gypi' ],
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(PRODUCT_DIR)/ui_test.pak',
],
'action': [
'python',
'<(repack_path)',
'<@(_outputs)',
'<@(pak_inputs)'
],
}, },
], ],
'conditions': [ 'conditions': [
......
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