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): |