Warn about missing host build binaries when compiling with a local engine (#15626)

Fixes https://github.com/flutter/flutter/issues/15361
This commit is contained in:
Jason Simmons
2018-03-19 11:29:20 -07:00
committed by GitHub
parent 6acf76f7be
commit 1c04f951c8
2 changed files with 8 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import 'dart:convert';
import 'package:usage/uuid/uuid.dart';
import 'artifacts.dart';
import 'base/common.dart';
import 'base/io.dart';
import 'base/process_manager.dart';
import 'globals.dart';
@@ -65,8 +66,12 @@ Future<String> compile(
// This is a URI, not a file path, so the forward slash is correct even on Windows.
if (!sdkRoot.endsWith('/'))
sdkRoot = '$sdkRoot/';
final String engineDartPath = artifacts.getArtifactPath(Artifact.engineDartBinary);
if (!processManager.canRun(engineDartPath)) {
throwToolExit('Unable to find Dart binary at $engineDartPath');
}
final List<String> command = <String>[
artifacts.getArtifactPath(Artifact.engineDartBinary),
engineDartPath,
frontendServer,
'--sdk-root',
sdkRoot,

View File

@@ -32,6 +32,7 @@ void main() {
final StreamController<String> stdErrStreamController = new StreamController<String>();
when(mockFrontendServerStdErr.transform<String>(any)).thenReturn(stdErrStreamController.stream);
when(mockFrontendServer.stdin).thenReturn(mockFrontendServerStdIn);
when(mockProcessManager.canRun(any)).thenReturn(true);
when(mockProcessManager.start(any)).thenAnswer(
(Invocation invocation) => new Future<Process>.value(mockFrontendServer));
when(mockFrontendServer.exitCode).thenReturn(0);
@@ -120,6 +121,7 @@ void main() {
when(mockFrontendServerStdErr.transform<String>(any))
.thenAnswer((Invocation invocation) => stdErrStreamController.stream);
when(mockProcessManager.canRun(any)).thenReturn(true);
when(mockProcessManager.start(any)).thenAnswer(
(Invocation invocation) => new Future<Process>.value(mockFrontendServer)
);