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

Unified Diff: build/android/gyp/util/build_utils.py

Issue 1679623002: Create dist jars only for instrumentation apks; use ijars for them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/util/build_utils.py
diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py
index da6e4cf1b2c945ac6f8f3e46518b0f5c94a032fe..cd62c2fce1c948f92e2b150ee99d8c089709c1f9 100644
--- a/build/android/gyp/util/build_utils.py
+++ b/build/android/gyp/util/build_utils.py
@@ -326,14 +326,18 @@ def MergeZips(output, inputs, exclude_patterns=None, path_transform=None):
with zipfile.ZipFile(output, 'w') as out_zip:
for in_file in inputs:
with zipfile.ZipFile(in_file, 'r') as in_zip:
- for name in in_zip.namelist():
+ in_zip._expected_crc = None
+ for info in in_zip.infolist():
# Ignore directories.
- if name[-1] == '/':
+ if info.filename[-1] == '/':
continue
- dst_name = path_transform(name, in_file)
+ # Don't validate CRCs. ijar sets them all to 0.
+ if hasattr(info, 'CRC'):
jbudorick 2016/02/08 16:24:12 do we only call this function for ijars...?
agrieve 2016/02/08 16:42:01 It's only needed for ijars, but I don't think veri
jbudorick 2016/02/08 16:59:10 sgtm
+ del info.CRC
+ dst_name = path_transform(info.filename, in_file)
already_added = dst_name in added_names
if not already_added and not MatchesGlob(dst_name, exclude_patterns):
- AddToZipHermetic(out_zip, dst_name, data=in_zip.read(name))
+ AddToZipHermetic(out_zip, dst_name, data=in_zip.read(info))
added_names.add(dst_name)

Powered by Google App Engine
This is Rietveld 408576698