Chromium Code Reviews| 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) |