diff options
author | gfeher@chromium.org <gfeher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 09:31:10 +0000 |
---|---|---|
committer | gfeher@chromium.org <gfeher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 09:31:10 +0000 |
commit | acd5f4fb681dc1ebc3052b83cc481b7a19bacc1c (patch) | |
tree | e69b7f249ec54c3e54ef35219e364518b1e9bf63 | |
parent | d416e88937ff06a55c50a094dc3fde634813fa61 (diff) | |
download | chromium_src-acd5f4fb681dc1ebc3052b83cc481b7a19bacc1c.zip chromium_src-acd5f4fb681dc1ebc3052b83cc481b7a19bacc1c.tar.gz chromium_src-acd5f4fb681dc1ebc3052b83cc481b7a19bacc1c.tar.bz2 |
Refactor: move all the policy-template related targets into one gypi file
BUG=none
TEST=build completes on all platforms
Review URL: http://codereview.chromium.org/4644002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65510 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/policy/policy_templates.gypi | 180 | ||||
-rw-r--r-- | chrome/chrome.gyp | 96 | ||||
-rw-r--r-- | chrome/chrome_exe.gypi | 70 |
3 files changed, 181 insertions, 165 deletions
diff --git a/chrome/app/policy/policy_templates.gypi b/chrome/app/policy/policy_templates.gypi new file mode 100644 index 0000000..4f41c3a --- /dev/null +++ b/chrome/app/policy/policy_templates.gypi @@ -0,0 +1,180 @@ +# Copyright (c) 2010 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. + +{ + 'conditions': [ + ['OS=="win" or OS=="mac" or OS=="linux"', { + 'targets': [ + { + # policy_templates has different inputs and outputs, so it can't use + # the rules of chrome_strings + 'target_name': 'policy_templates', + 'type': 'none', + 'variables': { + 'grd_path': 'policy_templates.grd', + 'template_files': [ + '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(grd_path))' + ], + }, + 'actions': [ + { + 'action_name': 'policy_templates', + 'variables': { + 'conditions': [ + ['branding=="Chrome"', { + # TODO(mmoss) The .grd files look for _google_chrome, but + # for consistency they should look for GOOGLE_CHROME_BUILD + # like C++. + # Clean this up when Windows moves to gyp. + 'chrome_build': '_google_chrome', + }, { # else: branding!="Chrome" + 'chrome_build': '_chromium', + }], + ], + }, + 'inputs': [ + '<!@(<(grit_info_cmd) --inputs <(grd_path))', + ], + 'outputs': [ + '<@(template_files)' + ], + 'action': [ + '<@(grit_cmd)', + '-i', '<(grd_path)', 'build', + '-o', '<(grit_out_dir)', + '-D', '<(chrome_build)' + ], + 'conditions': [ + ['chromeos==1', { + 'action': ['-D', 'chromeos'], + }], + ['use_titlecase_in_grd_files==1', { + 'action': ['-D', 'use_titlecase'], + }], + ['OS == "mac"', { + 'action': ['-D', 'mac_bundle_id=<(mac_bundle_id)'], + }], + ], + 'message': 'Generating policy templates from <(grd_path)', + }, + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '<(grit_out_dir)', + ], + }, + 'conditions': [ + ['OS=="win"', { + 'actions': [ + { + # Add all the templates generated at the previous step into + # a zip archive. + 'action_name': 'pack_templates', + 'variables': { + 'zip_script': + 'tools/build/win/make_zip_with_relative_entries.py' + }, + 'inputs': [ + '<@(template_files)', + '<(zip_script)' + ], + 'outputs': [ + '<(PRODUCT_DIR)/policy_templates.zip' + ], + 'action': [ + 'python', + '<(zip_script)', + '<@(_outputs)', + '<(grit_out_dir)/app/policy', + '<@(template_files)' + ], + 'message': 'Packing generated templates into <(_outputs)', + } + ] + }], + ['OS=="win"', { + 'dependencies': ['../build/win/system.gyp:cygwin'], + }], + ], + }, + ], # 'targets' + }], # OS=="win" or OS=="mac" or OS=="linux" + ['OS=="mac"', { + 'targets': [ + { + # This is the bundle of the manifest file of Chrome. + # It contains the manifest file and its string tables. + 'target_name': 'chrome_manifest_bundle', + 'type': 'loadable_module', + 'mac_bundle': 1, + 'product_extension': 'manifest', + 'product_name': '<(mac_bundle_id)', + 'variables': { + # This avoids stripping debugging symbols from the target, which + # would fail because there is no binary code here. + 'mac_strip': 0, + }, + 'dependencies': [ + # Provides app-Manifest.plist and its string tables: + 'policy_templates', + ], + 'actions': [ + { + 'action_name': 'Copy MCX manifest file to manifest bundle', + 'inputs': [ + '<(grit_out_dir)/app/policy/mac/app-Manifest.plist', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest', + ], + 'action': [ + 'cp', + '<@(_inputs)', + '<@(_outputs)', + ], + 'message': + 'Copying the MCX policy manifest file to the manifest bundle', + 'process_outputs_as_mac_bundle_resources': 1, + }, + { + 'action_name': + 'Copy Localizable.strings files to manifest bundle', + 'variables': { + 'input_path': '<(grit_out_dir)/app/policy/mac/strings', + # Directory to collect the Localizable.strings files before + # they are copied to the bundle. + 'output_path': '<(INTERMEDIATE_DIR)/app_manifest', + # TODO(gfeher): replace this with <(locales) when we have real + # translations + 'available_locales': 'en', + }, + 'inputs': [ + # TODO: remove this helper when we have loops in GYP + '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))', + ], + 'outputs': [ + # TODO: remove this helper when we have loops in GYP + '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))', + ], + 'action': [ + 'cp', '-R', + '<(input_path)/', + '<(output_path)', + ], + 'message': + 'Copy the Localizable.strings files to the manifest bundle', + 'process_outputs_as_mac_bundle_resources': 1, + }, + ], + }, + ] + }] + ], # 'conditions' +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 7df1243..135dde4 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -136,6 +136,7 @@ # Note on Win64 targets: targets that end with win64 be used # on 64-bit Windows only. Targets that end with nacl_win64 should be used # by Native Client only. + 'app/policy/policy_templates.gypi', 'chrome_browser.gypi', 'chrome_common.gypi', 'chrome_dll.gypi', @@ -1818,101 +1819,6 @@ }, ]}, # 'targets' ], # OS=="win" - ['OS=="win" or OS=="mac" or OS=="linux"', - { 'targets': [ - { - # policy_templates has different inputs and outputs, so it can't use - # the rules of chrome_strings - 'target_name': 'policy_templates', - 'type': 'none', - 'variables': { - 'grd_path': 'app/policy/policy_templates.grd', - 'template_files': [ - '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(grd_path))' - ] - }, - 'actions': [ - { - 'action_name': 'policy_templates', - 'variables': { - 'conditions': [ - ['branding=="Chrome"', { - # TODO(mmoss) The .grd files look for _google_chrome, but for - # consistency they should look for GOOGLE_CHROME_BUILD like C++. - # Clean this up when Windows moves to gyp. - 'chrome_build': '_google_chrome', - }, { # else: branding!="Chrome" - 'chrome_build': '_chromium', - }], - ], - }, - 'inputs': [ - '<!@(<(grit_info_cmd) --inputs <(grd_path))', - ], - 'outputs': [ - '<@(template_files)' - ], - 'action': [ - '<@(grit_cmd)', - '-i', '<(grd_path)', 'build', - '-o', '<(grit_out_dir)', - '-D', '<(chrome_build)' - ], - 'conditions': [ - ['chromeos==1', { - 'action': ['-D', 'chromeos'], - }], - ['use_titlecase_in_grd_files==1', { - 'action': ['-D', 'use_titlecase'], - }], - ['OS == "mac"', { - 'action': ['-D', 'mac_bundle_id=<(mac_bundle_id)'], - }], - ], - 'message': 'Generating policy templates from <(grd_path)', - }, - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '<(grit_out_dir)', - ], - }, - 'conditions': [ - ['OS=="win"', { - 'actions': [ - { - # Add all the templates generated at the previous step into - # a zip archive. - 'action_name': 'pack_templates', - 'variables': { - 'zip_script': - 'tools/build/win/make_zip_with_relative_entries.py' - }, - 'inputs': [ - '<@(template_files)', - '<(zip_script)' - ], - 'outputs': [ - '<(PRODUCT_DIR)/policy_templates.zip' - ], - 'action': [ - 'python', - '<(zip_script)', - '<@(_outputs)', - '<(grit_out_dir)/app/policy', - '<@(template_files)' - ], - 'message': 'Packing generated templates into <(_outputs)', - } - ] - }], - ['OS=="win"', { - 'dependencies': ['../build/win/system.gyp:cygwin'], - }], - ], - }, - ]}, # 'targets' - ], # OS=="win" or OS=="mac" or OS=="linux" ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { 'targets': [{ 'target_name': 'packed_resources', diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi index 424ae78..6cd7011 100644 --- a/chrome/chrome_exe.gypi +++ b/chrome/chrome_exe.gypi @@ -519,75 +519,5 @@ }, ], }], - ['OS=="mac"', { - 'targets': [ - { - # This is the bundle of the manifest file of Chrome. - # It contains the manifest file and its string tables. - 'target_name': 'chrome_manifest_bundle', - 'type': 'loadable_module', - 'mac_bundle': 1, - 'product_extension': 'manifest', - 'product_name': '<(mac_bundle_id)', - 'variables': { - # This avoids stripping debugging symbols from the target, which - # would fail because there is no binary code here. - 'mac_strip': 0, - }, - 'dependencies': [ - # Provides app-Manifest.plist and its string tables: - 'policy_templates', - ], - 'actions': [ - { - 'action_name': 'Copy MCX manifest file to manifest bundle', - 'inputs': [ - '<(grit_out_dir)/app/policy/mac/app-Manifest.plist', - ], - 'outputs': [ - '<(INTERMEDIATE_DIR)/app_manifest/<(mac_bundle_id).manifest', - ], - 'action': [ - 'cp', - '<@(_inputs)', - '<@(_outputs)', - ], - 'message': - 'Copying the MCX policy manifest file to the manifest bundle', - 'process_outputs_as_mac_bundle_resources': 1, - }, - { - 'action_name': - 'Copy Localizable.strings files to manifest bundle', - 'variables': { - 'input_path': '<(grit_out_dir)/app/policy/mac/strings', - # Directory to collect the Localizable.strings files before - # they are copied to the bundle. - 'output_path': '<(INTERMEDIATE_DIR)/app_manifest', - # TODO(gfeher): replace this with <(locales) when we have real - # translations - 'available_locales': 'en', - }, - 'inputs': [ - # TODO: remove this helper when we have loops in GYP - '>!@(<(apply_locales_cmd) -d \'<(input_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))', - ], - 'outputs': [ - # TODO: remove this helper when we have loops in GYP - '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/Localizable.strings\' <(available_locales))', - ], - 'action': [ - 'cp', '-R', - '<(input_path)/', - '<(output_path)', - ], - 'message': - 'Copy the Localizable.strings files to the manifest bundle', - 'process_outputs_as_mac_bundle_resources': 1, - }, - ], - }, - ] - }] ], } |