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

Side by Side Diff: build/android/gyp/apk_install.py

Issue 197693002: [Android] Lint build/android/gyp/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: now using extra_paths_list to avoid F0401s Created 6 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 unified diff | Download patch
« no previous file with comments | « build/android/gyp/ant.py ('k') | 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
11 import optparse 11 import optparse
12 import os 12 import os
13 import re 13 import re
14 import subprocess
15 import sys 14 import sys
16 15
17 from util import build_device 16 from util import build_device
18 from util import build_utils 17 from util import build_utils
19 from util import md5_check 18 from util import md5_check
20 19
21 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..') 20 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
22 sys.path.append(BUILD_ANDROID_DIR) 21 sys.path.append(BUILD_ANDROID_DIR)
23 22
24 from pylib import constants 23 from pylib import constants
(...skipping 23 matching lines...) Expand all
48 def RecordInstallMetadata(device, apk_package, metadata_path): 47 def RecordInstallMetadata(device, apk_package, metadata_path):
49 """Records the metadata from the device for apk_package.""" 48 """Records the metadata from the device for apk_package."""
50 metadata = GetNewMetadata(device, apk_package) 49 metadata = GetNewMetadata(device, apk_package)
51 if not metadata: 50 if not metadata:
52 raise Exception('APK install failed unexpectedly.') 51 raise Exception('APK install failed unexpectedly.')
53 52
54 with open(metadata_path, 'w') as outfile: 53 with open(metadata_path, 'w') as outfile:
55 outfile.write(metadata) 54 outfile.write(metadata)
56 55
57 56
58 def main(argv): 57 def main():
59 parser = optparse.OptionParser() 58 parser = optparse.OptionParser()
60 parser.add_option('--apk-path', 59 parser.add_option('--apk-path',
61 help='Path to .apk to install.') 60 help='Path to .apk to install.')
62 parser.add_option('--install-record', 61 parser.add_option('--install-record',
63 help='Path to install record (touched only when APK is installed).') 62 help='Path to install record (touched only when APK is installed).')
64 parser.add_option('--build-device-configuration', 63 parser.add_option('--build-device-configuration',
65 help='Path to build device configuration.') 64 help='Path to build device configuration.')
66 parser.add_option('--stamp', 65 parser.add_option('--stamp',
67 help='Path to touch on success.') 66 help='Path to touch on success.')
68 parser.add_option('--configuration-name', 67 parser.add_option('--configuration-name',
(...skipping 27 matching lines...) Expand all
96 Install, 95 Install,
97 record_path=record_path, 96 record_path=record_path,
98 input_paths=[options.apk_path], 97 input_paths=[options.apk_path],
99 force=force_install) 98 force=force_install)
100 99
101 if options.stamp: 100 if options.stamp:
102 build_utils.Touch(options.stamp) 101 build_utils.Touch(options.stamp)
103 102
104 103
105 if __name__ == '__main__': 104 if __name__ == '__main__':
106 sys.exit(main(sys.argv)) 105 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/gyp/ant.py ('k') | build/android/gyp/create_device_library_links.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698