Commit 95a2af8b authored by Kris Giesing's avatar Kris Giesing

Fix analyzer errors

parent 57bca7da
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:args/command_runner.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
...@@ -31,6 +30,8 @@ class RunMojoCommand extends FlutterCommand { ...@@ -31,6 +30,8 @@ class RunMojoCommand extends FlutterCommand {
argParser.addOption('devtools-path', help: 'Path to mojo devtools\' mojo_run command.'); argParser.addOption('devtools-path', help: 'Path to mojo devtools\' mojo_run command.');
} }
bool get requiresProjectRoot => false;
// TODO(abarth): Why not use path.absolute? // TODO(abarth): Why not use path.absolute?
String _makePathAbsolute(String relativePath) { String _makePathAbsolute(String relativePath) {
File file = new File(relativePath); File file = new File(relativePath);
...@@ -59,7 +60,7 @@ class RunMojoCommand extends FlutterCommand { ...@@ -59,7 +60,7 @@ class RunMojoCommand extends FlutterCommand {
return _makePathAbsolute(path.join(argResults['mojo-path'], 'out', mojoBuildType, 'mojo_shell')); return _makePathAbsolute(path.join(argResults['mojo-path'], 'out', mojoBuildType, 'mojo_shell'));
} }
BuildConfig _getCurrentHostConfig() { BuildConfiguration _getCurrentHostConfig() {
BuildConfiguration result; BuildConfiguration result;
TargetPlatform target = getCurrentHostPlatformAsTarget(); TargetPlatform target = getCurrentHostPlatformAsTarget();
for (BuildConfiguration config in buildConfigurations) { for (BuildConfiguration config in buildConfigurations) {
...@@ -91,7 +92,7 @@ class RunMojoCommand extends FlutterCommand { ...@@ -91,7 +92,7 @@ class RunMojoCommand extends FlutterCommand {
} else { } else {
final appPath = _makePathAbsolute(argResults['app']); final appPath = _makePathAbsolute(argResults['app']);
String viewerPath; String viewerPath;
BuildConfig config = _getCurrentHostConfig(); BuildConfiguration config = _getCurrentHostConfig();
if (config.type == BuildType.prebuilt) { if (config.type == BuildType.prebuilt) {
Artifact artifact = ArtifactStore.getArtifact(type: ArtifactType.viewer, targetPlatform: TargetPlatform.linux); Artifact artifact = ArtifactStore.getArtifact(type: ArtifactType.viewer, targetPlatform: TargetPlatform.linux);
viewerPath = _makePathAbsolute(await ArtifactStore.getPath(artifact)); viewerPath = _makePathAbsolute(await ArtifactStore.getPath(artifact));
...@@ -124,7 +125,7 @@ class RunMojoCommand extends FlutterCommand { ...@@ -124,7 +125,7 @@ class RunMojoCommand extends FlutterCommand {
} }
@override @override
Future<int> run() async { Future<int> runInProject() async {
if ((argResults['mojo-path'] == null && argResults['devtools-path'] == null) || (argResults['mojo-path'] != null && argResults['devtools-path'] != null)) { if ((argResults['mojo-path'] == null && argResults['devtools-path'] == null) || (argResults['mojo-path'] != null && argResults['devtools-path'] != null)) {
_logging.severe('Must specify either --mojo-path or --devtools-path.'); _logging.severe('Must specify either --mojo-path or --devtools-path.');
return 1; return 1;
...@@ -137,4 +138,5 @@ class RunMojoCommand extends FlutterCommand { ...@@ -137,4 +138,5 @@ class RunMojoCommand extends FlutterCommand {
return await runCommandAndStreamOutput(await _getShellConfig()); return await runCommandAndStreamOutput(await _getShellConfig());
} }
} }
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