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

Side by Side Diff: build/android/gyp/apk_install.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 unified diff | Download patch
« no previous file with comments | « no previous file | build/android/gyp/create_device_library_links.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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))
OLDNEW
« no previous file with comments | « no previous file | build/android/gyp/create_device_library_links.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698