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

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

Issue 1428173002: GN: Remove "outputs" parameter for java_cpp_enum() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/java_cpp_enum_tests.py ('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/util/build_utils.py
diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py
index dcaa7e9ddbb23555b011aa7b3e67a82b9afa056d..94935d2d490dddbb91e175cd396c24e51117f046 100644
--- a/build/android/gyp/util/build_utils.py
+++ b/build/android/gyp/util/build_utils.py
@@ -224,6 +224,14 @@ def ExtractAll(zip_path, path=None, no_clobber=True, pattern=None,
z.extract(name, path)
+def CreateHermeticZipInfo(zip_path):
+ """Creates a ZipInfo with a zero'ed out timestamp."""
+ CheckZipPath(zip_path)
+ zipinfo = zipfile.ZipInfo(filename=zip_path, date_time=HERMETIC_TIMESTAMP)
+ zipinfo.external_attr = HERMETIC_FILE_ATTR
+ return zipinfo
+
+
def DoZip(inputs, output, base_dir=None):
"""Creates a zip file from a list of files.
@@ -242,12 +250,9 @@ def DoZip(inputs, output, base_dir=None):
input_tuples.sort(key=lambda tup: tup[0])
with zipfile.ZipFile(output, 'w') as outfile:
for zip_path, fs_path in input_tuples:
- CheckZipPath(zip_path)
- zipinfo = zipfile.ZipInfo(filename=zip_path, date_time=HERMETIC_TIMESTAMP)
- zipinfo.external_attr = HERMETIC_FILE_ATTR
with file(fs_path) as f:
contents = f.read()
- outfile.writestr(zipinfo, contents)
+ outfile.writestr(CreateHermeticZipInfo(zip_path), contents)
def ZipDir(output, base_dir):
@@ -272,13 +277,13 @@ def MergeZips(output, inputs, exclude_patterns=None, path_transform=None):
for in_file in inputs:
with zipfile.ZipFile(in_file, 'r') as in_zip:
for name in in_zip.namelist():
+ # Ignore directories.
+ if name[-1] == '/':
+ continue
dst_name = path_transform(name, in_file)
already_added = dst_name in added_names
if not already_added and not MatchesGlob(dst_name, exclude_patterns):
- zipinfo = zipfile.ZipInfo(filename=dst_name,
- date_time=HERMETIC_TIMESTAMP)
- zipinfo.external_attr = HERMETIC_FILE_ATTR
- out_zip.writestr(zipinfo, in_zip.read(name))
+ out_zip.writestr(CreateHermeticZipInfo(dst_name), in_zip.read(name))
added_names.add(dst_name)
« no previous file with comments | « build/android/gyp/java_cpp_enum_tests.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698