Commit 287196ba authored by knn's avatar knn Committed by Commit bot

Remove localized App Restrictions resources.

This is causing a ~1.46 mb increase in the binary size of chrome on android.
Preemptively reverting this to facilitate further discussion.

This change introduces a dummy target in gyp that deletes existing localized resources. The target as well as the python script can be removed once all buildbots have run this once (~ a day).
Thankfully this is is not required in gn.

BUG=450548

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

Cr-Commit-Position: refs/heads/master@{#324432}
parent 5ad72c5d
......@@ -357,12 +357,31 @@
},
],
'actions': [
{
'action_name': 'remove_localized_resources',
'outputs': [
'<(input_resources_dir)/remove_localized_resources.d.stamp'
],
'inputs': [
'policy/tools/remove_localized_app_restrictions.py',
],
'action': [
'python',
'policy/tools/remove_localized_app_restrictions.py',
'<(input_resources_dir)',
],
},
{
'action_name': 'create_resources_zip',
'inputs': [
'<(create_zip_script)',
'<(input_resources_dir)/xml-v21/app_restrictions.xml',
'<(input_resources_dir)/values-v21/restriction_values.xml',
# A dummy stamp file to remove localized resources without
# clobbering the build.
# TODO(475515): Remove after all build bots have run
# 'remove_localized_resources' target.
'<(input_resources_dir)/remove_localized_resources.d.stamp',
],
'outputs': [
'<(resources_zip)'
......
......@@ -7,61 +7,8 @@
policy_templates_base_dir = "$root_gen_dir/chrome/app/policy"
policy_templates_android_outputs = [
"$policy_templates_base_dir/android/values-am-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-ar-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-bg-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-bn-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-ca-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-cs-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-da-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-de-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-el-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-en-rGB-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-es-rES-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-es-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-et-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-fa-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-fi-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-fil-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-fr-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-gu-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-he-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-hi-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-hr-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-hu-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-id-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-it-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-ja-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-kn-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-ko-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-lt-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-lv-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-ml-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-mr-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-ms-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-nb-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-nl-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-pl-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-pt-rBR-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-pt-rPT-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-ro-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-ru-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-sk-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-sl-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-sr-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-sv-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-sw-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-ta-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-te-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-th-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-tr-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-uk-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-vi-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-zh-rCN-v21/restriction_values.xml",
"$policy_templates_base_dir/android/values-zh-rTW-v21/restriction_values.xml",
]
policy_templates_android_outputs =
[ "$policy_templates_base_dir/android/values-v21/restriction_values.xml" ]
policy_templates_doc_outputs = [
"$policy_templates_base_dir/common/html/am/chrome_policy_list.html",
......
......@@ -178,60 +178,7 @@ templates and will be translated for each locale. -->
<output filename="app/policy/linux/examples/chrome.json" type="json" lang="en" />
</if>
<if expr="is_android">
<output filename="app/policy/android/values-am-v21/restriction_values.xml" type="android_policy" lang="am" />
<output filename="app/policy/android/values-ar-v21/restriction_values.xml" type="android_policy" lang="ar" />
<output filename="app/policy/android/values-bg-v21/restriction_values.xml" type="android_policy" lang="bg" />
<output filename="app/policy/android/values-bn-v21/restriction_values.xml" type="android_policy" lang="bn" />
<output filename="app/policy/android/values-ca-v21/restriction_values.xml" type="android_policy" lang="ca" />
<output filename="app/policy/android/values-cs-v21/restriction_values.xml" type="android_policy" lang="cs" />
<output filename="app/policy/android/values-da-v21/restriction_values.xml" type="android_policy" lang="da" />
<output filename="app/policy/android/values-de-v21/restriction_values.xml" type="android_policy" lang="de" />
<output filename="app/policy/android/values-el-v21/restriction_values.xml" type="android_policy" lang="el" />
<output filename="app/policy/android/values-en-rGB-v21/restriction_values.xml" type="android_policy" lang="en-GB" />
<output filename="app/policy/android/values-v21/restriction_values.xml" type="android_policy" lang="en" />
<output filename="app/policy/android/values-es-rES-v21/restriction_values.xml" type="android_policy" lang="es" />
<output filename="app/policy/android/values-es-v21/restriction_values.xml" type="android_policy" lang="es-419" />
<output filename="app/policy/android/values-et-v21/restriction_values.xml" type="android_policy" lang="et" />
<output filename="app/policy/android/values-fa-v21/restriction_values.xml" type="android_policy" lang="fa" />
<output filename="app/policy/android/values-fi-v21/restriction_values.xml" type="android_policy" lang="fi" />
<output filename="app/policy/android/values-fil-v21/restriction_values.xml" type="android_policy" lang="fil" />
<output filename="app/policy/android/values-fr-v21/restriction_values.xml" type="android_policy" lang="fr" />
<output filename="app/policy/android/values-gu-v21/restriction_values.xml" type="android_policy" lang="gu" />
<output filename="app/policy/android/values-he-v21/restriction_values.xml" type="android_policy" lang="he" />
<output filename="app/policy/android/values-hi-v21/restriction_values.xml" type="android_policy" lang="hi" />
<output filename="app/policy/android/values-hr-v21/restriction_values.xml" type="android_policy" lang="hr" />
<output filename="app/policy/android/values-hu-v21/restriction_values.xml" type="android_policy" lang="hu" />
<output filename="app/policy/android/values-id-v21/restriction_values.xml" type="android_policy" lang="id" />
<output filename="app/policy/android/values-it-v21/restriction_values.xml" type="android_policy" lang="it" />
<output filename="app/policy/android/values-ja-v21/restriction_values.xml" type="android_policy" lang="ja" />
<output filename="app/policy/android/values-kn-v21/restriction_values.xml" type="android_policy" lang="kn" />
<output filename="app/policy/android/values-ko-v21/restriction_values.xml" type="android_policy" lang="ko" />
<output filename="app/policy/android/values-lt-v21/restriction_values.xml" type="android_policy" lang="lt" />
<output filename="app/policy/android/values-lv-v21/restriction_values.xml" type="android_policy" lang="lv" />
<output filename="app/policy/android/values-ml-v21/restriction_values.xml" type="android_policy" lang="ml" />
<output filename="app/policy/android/values-mr-v21/restriction_values.xml" type="android_policy" lang="mr" />
<output filename="app/policy/android/values-ms-v21/restriction_values.xml" type="android_policy" lang="ms" />
<output filename="app/policy/android/values-nl-v21/restriction_values.xml" type="android_policy" lang="nl" />
<output filename="app/policy/android/values-nb-v21/restriction_values.xml" type="android_policy" lang="no" />
<!-- 'no' for Norwegian Bokmål. It should be 'nb'. -->
<output filename="app/policy/android/values-pl-v21/restriction_values.xml" type="android_policy" lang="pl" />
<output filename="app/policy/android/values-pt-rBR-v21/restriction_values.xml" type="android_policy" lang="pt-BR" />
<output filename="app/policy/android/values-pt-rPT-v21/restriction_values.xml" type="android_policy" lang="pt-PT" />
<output filename="app/policy/android/values-ro-v21/restriction_values.xml" type="android_policy" lang="ro" />
<output filename="app/policy/android/values-ru-v21/restriction_values.xml" type="android_policy" lang="ru" />
<output filename="app/policy/android/values-sk-v21/restriction_values.xml" type="android_policy" lang="sk" />
<output filename="app/policy/android/values-sl-v21/restriction_values.xml" type="android_policy" lang="sl" />
<output filename="app/policy/android/values-sr-v21/restriction_values.xml" type="android_policy" lang="sr" />
<output filename="app/policy/android/values-sv-v21/restriction_values.xml" type="android_policy" lang="sv" />
<output filename="app/policy/android/values-sw-v21/restriction_values.xml" type="android_policy" lang="sw" />
<output filename="app/policy/android/values-ta-v21/restriction_values.xml" type="android_policy" lang="ta" />
<output filename="app/policy/android/values-te-v21/restriction_values.xml" type="android_policy" lang="te" />
<output filename="app/policy/android/values-th-v21/restriction_values.xml" type="android_policy" lang="th" />
<output filename="app/policy/android/values-tr-v21/restriction_values.xml" type="android_policy" lang="tr" />
<output filename="app/policy/android/values-uk-v21/restriction_values.xml" type="android_policy" lang="uk" />
<output filename="app/policy/android/values-vi-v21/restriction_values.xml" type="android_policy" lang="vi" />
<output filename="app/policy/android/values-zh-rCN-v21/restriction_values.xml" type="android_policy" lang="zh-CN" />
<output filename="app/policy/android/values-zh-rTW-v21/restriction_values.xml" type="android_policy" lang="zh-TW" />
</if>
<if expr="is_macosx">
<output filename="app/policy/mac/app-Manifest.plist" type="plist" lang="en" />
......
#!/usr/bin/env python
# Copyright 2015 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.
'''python %prog resources_dir
resources_dir specifies the root directory of the localized app restrictions
resources to purge'''
import os
import re
import sys
def main(resources_dir):
match = re.compile('^values-.*-v21$')
for dir in os.listdir(resources_dir):
if match.search(dir):
path = os.path.join(resources_dir, dir)
os.remove(os.path.join(path, 'restriction_values.xml'))
os.rmdir(path)
open(os.path.join(resources_dir, 'remove_localized_resources.d.stamp'), 'w')
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv[1]))
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