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 13877025: [Android] With gyp_managed_install no device is only a warning (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 """Records the metadata from the device for apk_package.""" 49 """Records the metadata from the device for apk_package."""
50 metadata = GetMetadata(apk_package) 50 metadata = GetMetadata(apk_package)
51 if not metadata: 51 if not metadata:
52 raise 'APK install failed unexpectedly.' 52 raise 'APK install failed unexpectedly.'
53 53
54 with open(metadata_path, 'w') as outfile: 54 with open(metadata_path, 'w') as outfile:
55 outfile.write(metadata) 55 outfile.write(metadata)
56 56
57 57
58 def main(argv): 58 def main(argv):
59 if not build_utils.IsDeviceReady():
60 build_utils.PrintBigWarning(
61 'Zero (or multiple) devices attached. Skipping APK install.')
62 return
63
59 parser = optparse.OptionParser() 64 parser = optparse.OptionParser()
60 parser.add_option('--android-sdk-tools', 65 parser.add_option('--android-sdk-tools',
61 help='Path to Android SDK tools.') 66 help='Path to Android SDK tools.')
62 parser.add_option('--apk-path', 67 parser.add_option('--apk-path',
63 help='Path to .apk to install.') 68 help='Path to .apk to install.')
64 parser.add_option('--install-record', 69 parser.add_option('--install-record',
65 help='Path to install record (touched only when APK is installed).') 70 help='Path to install record (touched only when APK is installed).')
66 parser.add_option('--stamp', 71 parser.add_option('--stamp',
67 help='Path to touch on success.') 72 help='Path to touch on success.')
68 options, _ = parser.parse_args() 73 options, _ = parser.parse_args()
(...skipping 26 matching lines...) Expand all
95 input_paths=[options.apk_path], 100 input_paths=[options.apk_path],
96 input_strings=install_cmd, 101 input_strings=install_cmd,
97 force=force_install) 102 force=force_install)
98 103
99 if options.stamp: 104 if options.stamp:
100 build_utils.Touch(options.stamp) 105 build_utils.Touch(options.stamp)
101 106
102 107
103 if __name__ == '__main__': 108 if __name__ == '__main__':
104 sys.exit(main(sys.argv)) 109 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