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

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: Rebase 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
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..a14eed9bf6e729ffe7964c3d394c27f590b8cf3a 100755
--- a/build/android/gyp/process_resources.py
+++ b/build/android/gyp/process_resources.py
@@ -154,6 +154,14 @@ def ZipResources(resource_dirs, zip_path):
for archive_path, path in files_to_zip.iteritems():
outzip.write(path, archive_path)
+def CombineZips(zip_files, output_path):
newt (away) 2014/09/02 23:41:30 A short comment here would be nice
cjhopman 2014/09/04 01:14:58 Done.
+ 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 +256,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)

Powered by Google App Engine
This is Rietveld 408576698