| Index: mojo/devtools/common/mojo_shell
|
| diff --git a/mojo/devtools/common/mojo_shell b/mojo/devtools/common/mojo_shell
|
| index 3b4d77bef4eecdef657dab5154f4d34a7e76e9f4..edb101221517e60b18847a6bbcc49d016ce3886b 100755
|
| --- a/mojo/devtools/common/mojo_shell
|
| +++ b/mojo/devtools/common/mojo_shell
|
| @@ -74,30 +74,49 @@ def main():
|
| 'for off-screen rendering.')
|
|
|
| launcher_args, args = parser.parse_known_args()
|
| - paths, error_msg = default_paths.infer_default_paths(launcher_args.android,
|
| - launcher_args.debug,
|
| - launcher_args.target_cpu)
|
| - if not paths:
|
| - print error_msg
|
| - return -1
|
| + mojo_paths, _ = default_paths.infer_default_paths(launcher_args.android,
|
| + launcher_args.debug,
|
| + launcher_args.target_cpu)
|
| + if mojo_paths:
|
| + adb_path = mojo_paths['adb']
|
| + shell_binary_path = mojo_paths['shell']
|
| + local_origin_path = mojo_paths['build']
|
| + if launcher_args.verbose:
|
| + print 'Running within a Mojo checkout:'
|
| + print ' - using the locally built shell at ' + shell_binary_path
|
| + print ' - using the default origin of ' + local_origin_path
|
| + else:
|
| + if launcher_args.android:
|
| + adb_path = 'adb'
|
| + shell_binary_path = None
|
| + local_origin_path = '.'
|
| + if launcher_args.verbose:
|
| + print 'Running outside a Mojo checkout:'
|
| + print ' - using the shell already installed on the device'
|
| + print ' - using the current working directory as default origin'
|
| + else:
|
| + print 'Running outside a Mojo checkout is not supported on Linux yet.'
|
| + return 1
|
|
|
| if launcher_args.android:
|
| verbose_pipe = sys.stdout if launcher_args.verbose else None
|
|
|
| - shell = AndroidShell(paths['adb'], launcher_args.target_device,
|
| + shell = AndroidShell(adb_path, launcher_args.target_device,
|
| logcat_tags=launcher_args.logcat_tags,
|
| verbose_pipe=verbose_pipe)
|
| device_status, error = shell.CheckDevice()
|
| if not device_status:
|
| print 'Device check failed: ' + error
|
| return 1
|
| - shell.InstallApk(paths['shell'])
|
| + if shell_binary_path:
|
| + shell.InstallApk(shell_binary_path)
|
|
|
| args = shell_arguments.RewriteMapOriginParameters(shell, args)
|
| if not launcher_args.origin:
|
| - args.extend(shell_arguments.ConfigureLocalOrigin(shell, paths['build']))
|
| + args.extend(shell_arguments.ConfigureLocalOrigin(shell,
|
| + local_origin_path))
|
| else:
|
| - shell = LinuxShell(paths['shell'])
|
| + shell = LinuxShell(shell_binary_path)
|
| if launcher_args.use_osmesa:
|
| args.append('--args-for=mojo:native_viewport_service --use-osmesa')
|
|
|
| @@ -110,8 +129,12 @@ def main():
|
| args.extend(shell_arguments.ConfigureDebugger(shell))
|
|
|
| if launcher_args.sky:
|
| - args.extend(shell_arguments.ConfigureSky(shell, paths['root'],
|
| - paths['sky_packages'],
|
| + if not mojo_paths:
|
| + print 'Running with --sky is not supported outside of the Mojo checkout.'
|
| + # See https://github.com/domokit/devtools/issues/27.
|
| + return 1
|
| + args.extend(shell_arguments.ConfigureSky(shell, mojo_paths['root'],
|
| + mojo_paths['sky_packages'],
|
| launcher_args.sky))
|
|
|
| if launcher_args.verbose:
|
|
|