| OLD | NEW |
| 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 logging | 7 import logging |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from devtoolslib import paths | 10 from devtoolslib import paths |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 help='CPU architecture to run for.', | 70 help='CPU architecture to run for.', |
| 71 choices=['x64', 'x86', 'arm']) | 71 choices=['x64', 'x86', 'arm']) |
| 72 | 72 |
| 73 shell_arguments.add_shell_arguments(parser) | 73 shell_arguments.add_shell_arguments(parser) |
| 74 parser.add_argument('--no-debugger', action="store_true", | 74 parser.add_argument('--no-debugger', action="store_true", |
| 75 help='Do not spawn mojo:debugger.') | 75 help='Do not spawn mojo:debugger.') |
| 76 parser.add_argument('--window-manager', default=_DEFAULT_WINDOW_MANAGER, | 76 parser.add_argument('--window-manager', default=_DEFAULT_WINDOW_MANAGER, |
| 77 help='Window manager app to be mapped as ' | 77 help='Window manager app to be mapped as ' |
| 78 'mojo:window_manager. By default it is ' + | 78 'mojo:window_manager. By default it is ' + |
| 79 _DEFAULT_WINDOW_MANAGER) | 79 _DEFAULT_WINDOW_MANAGER) |
| 80 parser.add_argument('--sky', | |
| 81 help='Loads the given Sky file.') | |
| 82 | 80 |
| 83 script_args, shell_args = parser.parse_known_args() | 81 script_args, shell_args = parser.parse_known_args() |
| 84 | 82 |
| 85 # Infer paths based on the config if running within a Chromium-like checkout. | 83 # Infer paths based on the config if running within a Chromium-like checkout. |
| 86 mojo_paths, _ = paths.infer_mojo_paths(script_args.android, | 84 mojo_paths, _ = paths.infer_mojo_paths(script_args.android, |
| 87 script_args.debug, | 85 script_args.debug, |
| 88 script_args.target_cpu) | 86 script_args.target_cpu) |
| 89 if mojo_paths: | 87 if mojo_paths: |
| 90 if script_args.android and not script_args.adb_path: | 88 if script_args.android and not script_args.adb_path: |
| 91 script_args.adb_path = mojo_paths['adb'] | 89 script_args.adb_path = mojo_paths['adb'] |
| (...skipping 22 matching lines...) Expand all Loading... |
| 114 if script_args.verbose: | 112 if script_args.verbose: |
| 115 print 'Spawning mojo:debugger, use `mojo_debug` to inspect the shell.' | 113 print 'Spawning mojo:debugger, use `mojo_debug` to inspect the shell.' |
| 116 print 'Note that mojo:debugger will prevent the shell from terminating,' | 114 print 'Note that mojo:debugger will prevent the shell from terminating,' |
| 117 print ' pass --no-debugger to skip spawning mojo:debugger.' | 115 print ' pass --no-debugger to skip spawning mojo:debugger.' |
| 118 shell_args.extend(_configure_debugger(shell)) | 116 shell_args.extend(_configure_debugger(shell)) |
| 119 | 117 |
| 120 shell_args = shell_arguments.append_to_argument(shell_args, '--url-mappings=', | 118 shell_args = shell_arguments.append_to_argument(shell_args, '--url-mappings=', |
| 121 'mojo:window_manager=%s' % | 119 'mojo:window_manager=%s' % |
| 122 script_args.window_manager) | 120 script_args.window_manager) |
| 123 | 121 |
| 124 if script_args.sky: | |
| 125 if not mojo_paths: | |
| 126 print 'Running with --sky is not supported outside of the Mojo checkout.' | |
| 127 # See https://github.com/domokit/devtools/issues/27. | |
| 128 return 1 | |
| 129 shell_args.extend(shell_arguments._configure_sky(shell, mojo_paths['root'], | |
| 130 mojo_paths['sky_packages'], | |
| 131 script_args.sky)) | |
| 132 | |
| 133 if script_args.verbose: | 122 if script_args.verbose: |
| 134 print "Shell arguments: " + str(shell_args) | 123 print "Shell arguments: " + str(shell_args) |
| 135 | 124 |
| 136 shell.Run(shell_args) | 125 shell.Run(shell_args) |
| 137 return 0 | 126 return 0 |
| 138 | 127 |
| 139 | 128 |
| 140 if __name__ == "__main__": | 129 if __name__ == "__main__": |
| 141 sys.exit(main()) | 130 sys.exit(main()) |
| OLD | NEW |