Commit dde6bd20 authored by Alhaad Gokhale's avatar Alhaad Gokhale

Use a common flag for both android and linux.

parent 587f6e27
...@@ -27,8 +27,7 @@ class RunMojoCommand extends Command { ...@@ -27,8 +27,7 @@ class RunMojoCommand extends Command {
argParser.addFlag('mojo-release', negatable: false, help: 'Use Release build of mojo (default)'); argParser.addFlag('mojo-release', negatable: false, help: 'Use Release build of mojo (default)');
argParser.addOption('app', defaultsTo: 'app.flx'); argParser.addOption('app', defaultsTo: 'app.flx');
argParser.addOption('mojo-path', help: 'Path to directory containing mojo_shell and services. This is required for a Linux build.'); argParser.addOption('mojo-path', help: 'Path to directory containing mojo_shell and services for Linux and to mojo devtools from Android.');
argParser.addOption('devtools-path', help: 'Path to the mojo_run script in mojo devtools. This is required for an Android build.');
} }
// TODO(abarth): Why not use path.absolute? // TODO(abarth): Why not use path.absolute?
...@@ -80,15 +79,11 @@ class RunMojoCommand extends Command { ...@@ -80,15 +79,11 @@ class RunMojoCommand extends Command {
@override @override
Future<int> run() async { Future<int> run() async {
if (argResults['mojo-path'] == null && !argResults['android']) { if (argResults['mojo-path'] == null) {
_logging.severe('Must specify --mojo-path for Linux.'); _logging.severe('Must specify --mojo-path.');
return 1; return 1;
} }
if (argResults['devtools-path'] == null && argResults['android']) {
_logging.severe('Must specify --devtools-path for Android.');
return 1;
}
if (argResults['mojo-debug'] && argResults['mojo-release']) { if (argResults['mojo-debug'] && argResults['mojo-release']) {
_logging.severe('Cannot specify both --mojo-debug and --mojo-release'); _logging.severe('Cannot specify both --mojo-debug and --mojo-release');
return 1; return 1;
...@@ -103,7 +98,7 @@ class RunMojoCommand extends Command { ...@@ -103,7 +98,7 @@ class RunMojoCommand extends Command {
args.addAll(argResults.rest); args.addAll(argResults.rest);
if (argResults['android']) { if (argResults['android']) {
return _runAndroid(argResults['devtools-path'], mojoConfig, appPath, args); return _runAndroid(mojoPath, mojoConfig, appPath, args);
} else { } else {
return _runLinux(mojoPath, mojoConfig, appPath, args); return _runLinux(mojoPath, mojoConfig, appPath, args);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment