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

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

Issue 13432002: Add input content checking to some build scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/push_libraries.py
diff --git a/build/android/gyp/push_libraries.py b/build/android/gyp/push_libraries.py
index 9c7366e5e7b23d6f34e78b475dc3f71d34e6fc42..9a32760d55704de96096975d39cc113060aebde5 100755
--- a/build/android/gyp/push_libraries.py
+++ b/build/android/gyp/push_libraries.py
@@ -13,6 +13,8 @@ import optparse
import os
import sys
+from util import md5_check
+
BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(BUILD_ANDROID_DIR)
@@ -24,11 +26,19 @@ def DoPush(options):
libraries = build_utils.ReadJson(options.libraries_json)
adb = android_commands.AndroidCommands()
- adb.RunShellCommand('mkdir ' + options.device_dir)
+ 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)
- adb.PushIfNeeded(host_path, device_path)
+
+ md5_stamp = '%s.%s.md5' % (host_path, adb.Adb().GetSerialNumber())
+ md5_checker = md5_check.Md5Checker(stamp=md5_stamp, inputs=[host_path])
+ if md5_checker.IsStale():
+ if needs_directory:
+ adb.RunShellCommand('mkdir ' + options.device_dir)
+ needs_directory = False
+ adb.PushIfNeeded(host_path, device_path)
+ md5_checker.Write()
def main(argv):

Powered by Google App Engine
This is Rietveld 408576698