Commit 59bc0a0f authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

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

* Move host build check until it's actually used

* Elaborate diagnostic message
parent 7ee0b6a5
......@@ -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');
}
......
......@@ -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);
}
......
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