Commit ce4a4046 authored by Takuto Ikuta's avatar Takuto Ikuta Committed by Commit Bot

Use AtomicOutput for ZipDir

AtomicOutput does not update file timestamp, and it prevents to invoke additional build steps when the file content is not changed.
This will be affective for some jar related actions. (e.g. mojo/protobuf generator for java)

Bug: 810298
Change-Id: If7b5dd4405214164818b18e49642fb29147667c8
Reviewed-on: https://chromium-review.googlesource.com/1123970Reviewed-by: default avataragrieve <agrieve@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572194}
parent 8438c4f9
......@@ -344,7 +344,9 @@ def ZipDir(output, base_dir, compress_fn=None):
for root, _, files in os.walk(base_dir):
for f in files:
inputs.append(os.path.join(root, f))
DoZip(inputs, output, base_dir, compress_fn=compress_fn)
with AtomicOutput(output) as f:
DoZip(inputs, f, base_dir, compress_fn=compress_fn)
def MatchesGlob(path, filters):
......@@ -591,4 +593,3 @@ def CallAndWriteDepfileIfStale(function, options, record_path=None,
output_paths=output_paths,
force=force,
pass_changes=True)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment