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

Unified Diff: build/android/gyp/push_libraries.py

Issue 14263006: [Android] Refactor md5_check + add tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@java_toc
Patch Set: Rebase Created 7 years, 8 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
« no previous file with comments | « build/android/gyp/javac.py ('k') | build/android/gyp/util/md5_check.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/push_libraries.py
diff --git a/build/android/gyp/push_libraries.py b/build/android/gyp/push_libraries.py
index e586d0be6d577e19a0ba585d10df73702b0e9aeb..70a1fcb4f82f7e9d8f44de91f53c4e6a0cc2be3e 100755
--- a/build/android/gyp/push_libraries.py
+++ b/build/android/gyp/push_libraries.py
@@ -27,19 +27,21 @@ def DoPush(options):
adb = android_commands.AndroidCommands()
serial_number = adb.Adb().GetSerialNumber()
- needs_directory = True
+ # A list so that it is modifiable in Push below.
+ needs_directory = [True]
for lib in libraries:
device_path = os.path.join(options.device_dir, lib)
host_path = os.path.join(options.libraries_dir, lib)
- md5_stamp = '%s.%s.push.md5' % (host_path, serial_number)
- md5_checker = md5_check.Md5Checker(stamp=md5_stamp, inputs=[host_path])
- if md5_checker.IsStale():
+ def Push():
if needs_directory:
adb.RunShellCommand('mkdir ' + options.device_dir)
- needs_directory = False
+ needs_directory[:] = [] # = False
adb.PushIfNeeded(host_path, device_path)
- md5_checker.Write()
+
+ record_path = '%s.%s.push.md5.stamp' % (host_path, serial_number)
+ md5_check.CallAndRecordIfStale(
+ Push, record_path=record_path, input_paths=[host_path])
def main(argv):
« no previous file with comments | « build/android/gyp/javac.py ('k') | build/android/gyp/util/md5_check.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698