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

Unified Diff: mojo/devtools/common/mojo_run

Issue 1256323011: Devtools: refactor shell configuration logic. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix a typo. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell_config.py ('k') | mojo/devtools/common/mojo_test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/mojo_run
diff --git a/mojo/devtools/common/mojo_run b/mojo/devtools/common/mojo_run
index ee43274f7c7888dd78f1bc02d3427e5efec3c892..f7d30df77c9260e8181b560446db4a0e505af40d 100755
--- a/mojo/devtools/common/mojo_run
+++ b/mojo/devtools/common/mojo_run
@@ -7,8 +7,8 @@ import argparse
import logging
import sys
-from devtoolslib import paths
from devtoolslib import shell_arguments
+from devtoolslib import shell_config
_USAGE = ("mojo_run "
"[--args-for=<mojo-app>] "
@@ -55,23 +55,8 @@ def main():
logging.basicConfig()
parser = argparse.ArgumentParser(usage=_USAGE, description=_DESCRIPTION)
+ shell_config.add_shell_arguments(parser)
- # Arguments allowing to indicate the configuration we are targeting when
- # running within a Chromium-like checkout. These will go away once we have
- # devtools config files, see https://github.com/domokit/devtools/issues/28.
- chromium_config_group = parser.add_argument_group('Chromium configuration',
- 'These arguments allow to infer paths to tools and build results '
- 'when running withing a Chromium-like checkout')
- debug_group = chromium_config_group.add_mutually_exclusive_group()
- debug_group.add_argument('--debug', help='Debug build (default)',
- default=True, action='store_true')
- debug_group.add_argument('--release', help='Release build', default=False,
- dest='debug', action='store_false')
- chromium_config_group.add_argument('--target-cpu',
- help='CPU architecture to run for.',
- choices=['x64', 'x86', 'arm'])
-
- shell_arguments.add_shell_arguments(parser)
parser.add_argument('--no-debugger', action="store_true",
help='Do not spawn mojo:debugger.')
parser.add_argument('--window-manager', default=_DEFAULT_WINDOW_MANAGER,
@@ -80,31 +65,10 @@ def main():
_DEFAULT_WINDOW_MANAGER)
script_args, shell_args = parser.parse_known_args()
-
- # Infer paths based on the config if running within a Chromium-like checkout.
- mojo_paths, _ = paths.infer_mojo_paths(script_args.android,
- script_args.debug,
- script_args.target_cpu)
- if mojo_paths:
- if script_args.android and not script_args.adb_path:
- script_args.adb_path = mojo_paths['adb']
- if script_args.android and not script_args.origin:
- script_args.origin = mojo_paths['build']
- if not script_args.shell_path:
- script_args.shell_path = mojo_paths['shell']
-
- if script_args.verbose:
- print 'Running within a Chromium-style checkout.'
- print ' - using the locally built shell at: ' + script_args.shell_path
- if script_args.origin:
- print ' - using the origin: ' + script_args.origin
- if script_args.android:
- print ' - using the adb path: ' + script_args.adb_path
- elif script_args.verbose:
- print 'Running outside a Chromium-style checkout.'
+ config = shell_config.get_shell_config(script_args)
try:
- shell, shell_args = shell_arguments.configure_shell(script_args, shell_args)
+ shell, shell_args = shell_arguments.get_shell(config, shell_args)
except shell_arguments.ShellConfigurationException as e:
print e
return 1
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell_config.py ('k') | mojo/devtools/common/mojo_test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698