Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1676)

Unified Diff: build/android/gyp/write_build_config.py

Issue 2396073002: Store only locale paks rather than all assets within BuildConfig.java (Closed)
Patch Set: remove unused constant Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/java/templates/BuildConfig.template ('k') | build/config/android/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/write_build_config.py
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py
index 50379f2947c54df13a2c23213c2d92b4176d783b..8f4580eaa6d113fd86683fbd2a8dcdda9aabacf8 100755
--- a/build/android/gyp/write_build_config.py
+++ b/build/android/gyp/write_build_config.py
@@ -217,9 +217,11 @@ def _CreateJavaLibrariesList(library_paths):
return ('{%s}' % ','.join(['"%s"' % s[3:-3] for s in library_paths]))
-def _CreateJavaAssetList(assets):
+def _CreateLocalePaksAssetJavaList(assets):
"""Returns a java literal array from a list of assets in the form src:dst."""
- return '{%s}' % ','.join(sorted(['"%s"' % a.split(':')[1] for a in assets]))
+ names_only = (a.split(':')[1][:-4] for a in assets if a.endswith('.pak'))
+ locales_only = (a for a in names_only if '-' in a or len(a) == 2)
+ return '{%s}' % ','.join(sorted('"%s"' % a for a in locales_only))
def main(argv):
@@ -644,10 +646,10 @@ def main(argv):
}
config['assets'], config['uncompressed_assets'] = (
_MergeAssets(deps.All('android_assets')))
- config['compressed_assets_java_list'] = (
- _CreateJavaAssetList(config['assets']))
- config['uncompressed_assets_java_list'] = (
- _CreateJavaAssetList(config['uncompressed_assets']))
+ config['compressed_locales_java_list'] = (
+ _CreateLocalePaksAssetJavaList(config['assets']))
+ config['uncompressed_locales_java_list'] = (
+ _CreateLocalePaksAssetJavaList(config['uncompressed_assets']))
build_utils.WriteJson(config, options.build_config, only_if_changed=True)
« no previous file with comments | « base/android/java/templates/BuildConfig.template ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698