forked from firka/flutter
Skip printing rendered error text in machine mode (#61684)
This commit is contained in:
@@ -53,6 +53,7 @@ class DwdsWebRunnerFactory extends WebRunnerFactory {
|
||||
@required bool ipv6,
|
||||
@required DebuggingOptions debuggingOptions,
|
||||
@required UrlTunneller urlTunneller,
|
||||
bool machine = false,
|
||||
}) {
|
||||
return _ResidentWebRunner(
|
||||
device,
|
||||
@@ -62,6 +63,7 @@ class DwdsWebRunnerFactory extends WebRunnerFactory {
|
||||
ipv6: ipv6,
|
||||
stayResident: stayResident,
|
||||
urlTunneller: urlTunneller,
|
||||
machine: machine,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -79,12 +81,14 @@ abstract class ResidentWebRunner extends ResidentRunner {
|
||||
@required bool ipv6,
|
||||
@required DebuggingOptions debuggingOptions,
|
||||
bool stayResident = true,
|
||||
bool machine = false,
|
||||
}) : super(
|
||||
<FlutterDevice>[device],
|
||||
target: target ?? globals.fs.path.join('lib', 'main.dart'),
|
||||
debuggingOptions: debuggingOptions,
|
||||
ipv6: ipv6,
|
||||
stayResident: stayResident,
|
||||
machine: machine,
|
||||
);
|
||||
|
||||
FlutterDevice get device => flutterDevices.first;
|
||||
@@ -390,6 +394,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
|
||||
@required DebuggingOptions debuggingOptions,
|
||||
bool stayResident = true,
|
||||
@required this.urlTunneller,
|
||||
bool machine = false,
|
||||
}) : super(
|
||||
device,
|
||||
flutterProject: flutterProject,
|
||||
@@ -397,6 +402,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
|
||||
debuggingOptions: debuggingOptions,
|
||||
ipv6: ipv6,
|
||||
stayResident: stayResident,
|
||||
machine: machine,
|
||||
);
|
||||
|
||||
final UrlTunneller urlTunneller;
|
||||
|
||||
@@ -448,6 +448,7 @@ class AppDomain extends Domain {
|
||||
String dillOutputPath,
|
||||
bool ipv6 = false,
|
||||
String isolateFilter,
|
||||
bool machine = true,
|
||||
}) async {
|
||||
if (!await device.supportsRuntimeMode(options.buildInfo.mode)) {
|
||||
throw Exception(
|
||||
@@ -480,6 +481,7 @@ class AppDomain extends Domain {
|
||||
ipv6: ipv6,
|
||||
stayResident: true,
|
||||
urlTunneller: options.webEnableExposeUrl ? daemon.daemonDomain.exposeUrl : null,
|
||||
machine: machine,
|
||||
);
|
||||
} else if (enableHotReload) {
|
||||
runner = HotRunner(
|
||||
@@ -491,6 +493,7 @@ class AppDomain extends Domain {
|
||||
dillOutputPath: dillOutputPath,
|
||||
ipv6: ipv6,
|
||||
hostIsIde: true,
|
||||
machine: machine,
|
||||
);
|
||||
} else {
|
||||
runner = ColdRunner(
|
||||
@@ -499,6 +502,7 @@ class AppDomain extends Domain {
|
||||
debuggingOptions: options,
|
||||
applicationBinary: applicationBinary,
|
||||
ipv6: ipv6,
|
||||
machine: machine,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -450,6 +450,7 @@ class RunCommand extends RunCommandBase {
|
||||
packagesFilePath: globalResults['packages'] as String,
|
||||
dillOutputPath: stringArg('output-dill'),
|
||||
ipv6: ipv6,
|
||||
machine: true,
|
||||
);
|
||||
} on Exception catch (error) {
|
||||
throwToolExit(error.toString());
|
||||
|
||||
@@ -705,6 +705,7 @@ abstract class ResidentRunner {
|
||||
this.stayResident = true,
|
||||
this.hotMode = true,
|
||||
String dillOutputPath,
|
||||
this.machine = false,
|
||||
}) : mainPath = findMainDartFile(target),
|
||||
packagesFilePath = debuggingOptions.buildInfo.packagesPath,
|
||||
projectRootPath = projectRootPath ?? globals.fs.currentDirectory.path,
|
||||
@@ -741,6 +742,7 @@ abstract class ResidentRunner {
|
||||
final AssetBundle assetBundle;
|
||||
|
||||
final CommandHelp commandHelp;
|
||||
final bool machine;
|
||||
|
||||
io.HttpServer _devtoolsServer;
|
||||
|
||||
@@ -1141,7 +1143,7 @@ abstract class ResidentRunner {
|
||||
}
|
||||
|
||||
void printStructuredErrorLog(vm_service.Event event) {
|
||||
if (event.extensionKind == 'Flutter.Error') {
|
||||
if (event.extensionKind == 'Flutter.Error' && !machine) {
|
||||
final Map<dynamic, dynamic> json = event.extensionData?.data;
|
||||
if (json != null && json.containsKey('renderedErrorText')) {
|
||||
globals.printStatus('\n${json['renderedErrorText']}');
|
||||
|
||||
@@ -23,12 +23,16 @@ class ColdRunner extends ResidentRunner {
|
||||
this.applicationBinary,
|
||||
bool ipv6 = false,
|
||||
bool stayResident = true,
|
||||
}) : super(devices,
|
||||
target: target,
|
||||
debuggingOptions: debuggingOptions,
|
||||
hotMode: false,
|
||||
stayResident: stayResident,
|
||||
ipv6: ipv6);
|
||||
bool machine = false,
|
||||
}) : super(
|
||||
devices,
|
||||
target: target,
|
||||
debuggingOptions: debuggingOptions,
|
||||
hotMode: false,
|
||||
stayResident: stayResident,
|
||||
ipv6: ipv6,
|
||||
machine: machine,
|
||||
);
|
||||
|
||||
final bool traceStartup;
|
||||
final bool awaitFirstFrameWhenTracing;
|
||||
|
||||
@@ -74,14 +74,18 @@ class HotRunner extends ResidentRunner {
|
||||
String dillOutputPath,
|
||||
bool stayResident = true,
|
||||
bool ipv6 = false,
|
||||
}) : super(devices,
|
||||
target: target,
|
||||
debuggingOptions: debuggingOptions,
|
||||
projectRootPath: projectRootPath,
|
||||
stayResident: stayResident,
|
||||
hotMode: true,
|
||||
dillOutputPath: dillOutputPath,
|
||||
ipv6: ipv6);
|
||||
bool machine = false,
|
||||
}) : super(
|
||||
devices,
|
||||
target: target,
|
||||
debuggingOptions: debuggingOptions,
|
||||
projectRootPath: projectRootPath,
|
||||
stayResident: stayResident,
|
||||
hotMode: true,
|
||||
dillOutputPath: dillOutputPath,
|
||||
ipv6: ipv6,
|
||||
machine: machine,
|
||||
);
|
||||
|
||||
final bool benchmarkMode;
|
||||
final File applicationBinary;
|
||||
|
||||
@@ -25,5 +25,6 @@ abstract class WebRunnerFactory {
|
||||
@required bool ipv6,
|
||||
@required DebuggingOptions debuggingOptions,
|
||||
@required UrlTunneller urlTunneller,
|
||||
bool machine = false,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user