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

Side by Side Diff: mandoline/tools/android/run_mandoline.py

Issue 1257793004: Support --build-dir commandline flag for {run,install}_mandoline.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « mandoline/tools/android/install_mandoline.py ('k') | no next file » | 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 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import atexit 7 import atexit
8 import logging 8 import logging
9 import os 9 import os
10 import shutil 10 import shutil
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 def main(): 48 def main():
49 logging.basicConfig() 49 logging.basicConfig()
50 50
51 parser = argparse.ArgumentParser(usage=USAGE) 51 parser = argparse.ArgumentParser(usage=USAGE)
52 52
53 debug_group = parser.add_mutually_exclusive_group() 53 debug_group = parser.add_mutually_exclusive_group()
54 debug_group.add_argument('--debug', help='Debug build (default)', 54 debug_group.add_argument('--debug', help='Debug build (default)',
55 default=True, action='store_true') 55 default=True, action='store_true')
56 debug_group.add_argument('--release', help='Release build', default=False, 56 debug_group.add_argument('--release', help='Release build', default=False,
57 dest='debug', action='store_false') 57 dest='debug', action='store_false')
58 parser.add_argument('--build-dir', help='Build directory')
58 parser.add_argument('--target-cpu', help='CPU architecture to run for.', 59 parser.add_argument('--target-cpu', help='CPU architecture to run for.',
59 choices=['x64', 'x86', 'arm'], default='arm') 60 choices=['x64', 'x86', 'arm'], default='arm')
60 parser.add_argument('--device', help='Serial number of the target device.') 61 parser.add_argument('--device', help='Serial number of the target device.')
61 parser.add_argument('--gdb', help='Run gdb', 62 parser.add_argument('--gdb', help='Run gdb',
62 default=False, action='store_true') 63 default=False, action='store_true')
63 runner_args, args = parser.parse_known_args() 64 runner_args, args = parser.parse_known_args()
64 65
65 config = Config(target_os=Config.OS_ANDROID, 66 config = Config(build_dir=runner_args.build_dir,
67 target_os=Config.OS_ANDROID,
66 target_cpu=runner_args.target_cpu, 68 target_cpu=runner_args.target_cpu,
67 is_debug=runner_args.debug, 69 is_debug=runner_args.debug,
68 apk_name='Mandoline.apk') 70 apk_name='Mandoline.apk')
69 shell = AndroidShell(config) 71 shell = AndroidShell(config)
70 shell.InitShell(None, runner_args.device) 72 shell.InitShell(None, runner_args.device)
71 p = shell.ShowLogs() 73 p = shell.ShowLogs()
72 74
73 temp_gdb_dir = None 75 temp_gdb_dir = None
74 if runner_args.gdb: 76 if runner_args.gdb:
75 temp_gdb_dir = tempfile.mkdtemp() 77 temp_gdb_dir = tempfile.mkdtemp()
76 atexit.register(shutil.rmtree, temp_gdb_dir, True) 78 atexit.register(shutil.rmtree, temp_gdb_dir, True)
77 _CreateSOLinks(temp_gdb_dir) 79 _CreateSOLinks(temp_gdb_dir)
78 80
79 shell.StartActivity('MandolineActivity', 81 shell.StartActivity('MandolineActivity',
80 args, 82 args,
81 sys.stdout, 83 sys.stdout,
82 p.terminate, 84 p.terminate,
83 temp_gdb_dir) 85 temp_gdb_dir)
84 return 0 86 return 0
85 87
86 88
87 if __name__ == '__main__': 89 if __name__ == '__main__':
88 sys.exit(main()) 90 sys.exit(main())
OLDNEW
« no previous file with comments | « mandoline/tools/android/install_mandoline.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698