Move host build check until it's actually used. (#11926)

* Move host build check until it's actually used

* Elaborate diagnostic message
This commit is contained in:
Alexander Aprelev 2017-09-05 11:12:15 -07:00 committed by GitHub
parent 7ee0b6a574
commit 59bc0a0fce
2 changed files with 6 additions and 3 deletions

View File

@ -5,6 +5,7 @@
import 'dart:async';
import 'dart:convert';
import 'package:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/base/process_manager.dart';
import 'package:usage/uuid/uuid.dart';
@ -18,6 +19,11 @@ String _dartExecutable() {
final String engineDartSdkPath = artifacts.getArtifactPath(
Artifact.engineDartSdkPath
);
if (!fs.isDirectorySync(engineDartSdkPath)) {
throwToolExit('No dart sdk Flutter host engine build found at $engineDartSdkPath.\n'
'Note that corresponding host engine build is required even when targeting particular device platforms.',
exitCode: 2);
}
return fs.path.join(engineDartSdkPath, 'bin', 'dart');
}

View File

@ -336,9 +336,6 @@ class FlutterCommandRunner extends CommandRunner<Null> {
final String hostLocalEngine = 'host_' + localEngine.substring(localEngine.indexOf('_') + 1);
final String engineHostBuildPath = fs.path.normalize(fs.path.join(enginePath, 'out', hostLocalEngine));
if (!fs.isDirectorySync(engineHostBuildPath)) {
throwToolExit('No Flutter host engine build found at $engineHostBuildPath.', exitCode: 2);
}
return new EngineBuildPaths(targetEngine: engineBuildPath, hostEngine: engineHostBuildPath);
}