OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Installs an APK. | 7 """Installs an APK. |
8 | 8 |
9 """ | 9 """ |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 help='Path to touch on success.') | 31 help='Path to touch on success.') |
32 options, _ = parser.parse_args() | 32 options, _ = parser.parse_args() |
33 | 33 |
34 # TODO(cjhopman): Should this install to all devices/be configurable? | 34 # TODO(cjhopman): Should this install to all devices/be configurable? |
35 install_cmd = [ | 35 install_cmd = [ |
36 os.path.join(options.android_sdk_tools, 'adb'), | 36 os.path.join(options.android_sdk_tools, 'adb'), |
37 'install', '-r', | 37 'install', '-r', |
38 options.apk_path] | 38 options.apk_path] |
39 | 39 |
40 serial_number = android_commands.AndroidCommands().Adb().GetSerialNumber() | 40 serial_number = android_commands.AndroidCommands().Adb().GetSerialNumber() |
41 md5_stamp = '%s.%s.md5' % (options.apk_path, serial_number) | 41 record_path = '%s.%s.md5.stamp' % (options.apk_path, serial_number) |
42 | 42 md5_check.CallAndRecordIfStale( |
43 md5_checker = md5_check.Md5Checker( | 43 lambda: build_utils.CheckCallDie(install_cmd), |
44 stamp=md5_stamp, inputs=[options.apk_path], command=install_cmd) | 44 record_path=record_path, |
45 if md5_checker.IsStale(): | 45 input_paths=[options.apk_path], |
46 build_utils.CheckCallDie(install_cmd) | 46 input_strings=install_cmd) |
47 md5_checker.Write() | |
48 | 47 |
49 if options.stamp: | 48 if options.stamp: |
50 build_utils.Touch(options.stamp) | 49 build_utils.Touch(options.stamp) |
51 | 50 |
52 | 51 |
53 if __name__ == '__main__': | 52 if __name__ == '__main__': |
54 sys.exit(main(sys.argv)) | 53 sys.exit(main(sys.argv)) |
OLD | NEW |