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

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

Issue 507523002: Add content_shell_apk target (and a bunch of its dependencies) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix PageTransitionTypes.template path Created 6 years, 3 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 | « build/android/gyp/package_resources.py ('k') | build/android/gyp/util/build_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/process_resources.py
diff --git a/build/android/gyp/process_resources.py b/build/android/gyp/process_resources.py
index 0fe02dfa84877a41a354526da0eaf635ecf3774b..a31d00072812f43680894fa343f2d315ce933c71 100755
--- a/build/android/gyp/process_resources.py
+++ b/build/android/gyp/process_resources.py
@@ -155,6 +155,20 @@ def ZipResources(resource_dirs, zip_path):
outzip.write(path, archive_path)
+def CombineZips(zip_files, output_path):
+ # When packaging resources, if the top-level directories in the zip file are
+ # of the form 0, 1, ..., then each subdirectory will be passed to aapt as a
+ # resources directory. While some resources just clobber others (image files,
+ # etc), other resources (particularly .xml files) need to be more
+ # intelligently merged. That merging is left up to aapt.
+ with zipfile.ZipFile(output_path, 'w') as outzip:
+ for i, z in enumerate(zip_files):
+ with zipfile.ZipFile(z, 'r') as inzip:
+ for name in inzip.namelist():
+ new_name = '%d/%s' % (i, name)
+ outzip.writestr(new_name, inzip.read(name))
+
+
def main():
args = build_utils.ExpandFileArgs(sys.argv[1:])
@@ -248,8 +262,8 @@ def main():
ZipResources(zip_resource_dirs, options.resource_zip_out)
if options.all_resources_zip_out:
- ZipResources(
- zip_resource_dirs + dep_subdirs, options.all_resources_zip_out)
+ CombineZips([options.resource_zip_out] + dep_zips,
+ options.all_resources_zip_out)
if options.R_dir:
build_utils.DeleteDirectory(options.R_dir)
« no previous file with comments | « build/android/gyp/package_resources.py ('k') | build/android/gyp/util/build_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698