[flutter_tools] display message for current null safety mode (#70718)

This commit is contained in:
Jonah Williams 2020-11-20 11:53:02 -08:00 committed by GitHub
parent a5519dc75e
commit 1efb36035e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 13 deletions

View file

@ -418,7 +418,8 @@ class WindowsStdoutLogger extends StdoutLogger {
.replaceAll('🖼️', '')
.replaceAll('', 'X')
.replaceAll('', '')
.replaceAll('🔨', '');
.replaceAll('🔨', '')
.replaceAll('💪', '');
_stdio.stdoutWrite(windowsMessage);
}
}

View file

@ -723,7 +723,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
?? debuggingOptions.buildInfo.packageConfig,
);
final Status devFSStatus = globals.logger.startProgress(
'Syncing files to device ${device.device.name}...',
'Waiting for connection from debug service on ${device.device.name}...',
);
final UpdateFSReport report = await device.devFS.update(
mainUri: await _generateEntrypoint(
@ -833,6 +833,18 @@ class _ResidentWebRunner extends ResidentWebRunner {
..writeAsStringSync(websocketUri.toString());
}
globals.printStatus('Debug service listening on $websocketUri');
globals.printStatus('');
if (debuggingOptions.buildInfo.nullSafetyMode == NullSafetyMode.sound) {
globals.printStatus('💪 Running with sound null safety 💪', emphasis: true);
} else {
globals.printStatus(
'Running with unsound null safety',
emphasis: true,
);
globals.printStatus(
'For more information see https://dart.dev/null-safety/unsound-null-safety',
);
}
}
appStartedCompleter?.complete();
connectionInfoCompleter?.complete(DebugConnectionInfo(wsUri: websocketUri));

View file

@ -1219,15 +1219,8 @@ abstract class ResidentRunner {
ipv6: ipv6,
disableServiceAuthCodes: debuggingOptions.disableServiceAuthCodes
);
// This will wait for at least one flutter view before returning.
final Status status = globals.logger.startProgress(
'Waiting for ${device.device.name} to report its views...',
);
try {
await device.vmService.getFlutterViews();
} finally {
status.stop();
}
await device.vmService.getFlutterViews();
// This hooks up callbacks for when the connection stops in the future.
// We don't want to wait for them. We don't handle errors in those callbacks'
// futures either because they just print to logger and is not critical.

View file

@ -1095,13 +1095,24 @@ class HotRunner extends ResidentRunner {
printHelpDetails();
}
for (final FlutterDevice device in flutterDevices) {
final String dname = device.device.name;
// Caution: This log line is parsed by device lab tests.
globals.printStatus(
'An Observatory debugger and profiler on $dname is available at: '
'An Observatory debugger and profiler on ${device.device.name} is available at: '
'${device.vmService.httpAddress}',
);
}
globals.printStatus('');
if (debuggingOptions.buildInfo.nullSafetyMode == NullSafetyMode.sound) {
globals.printStatus('💪 Running with sound null safety 💪', emphasis: true);
} else {
globals.printStatus(
'Running with unsound null safety',
emphasis: true,
);
globals.printStatus(
'For more information see https://dart.dev/null-safety/unsound-null-safety',
);
}
}
Future<void> _evictDirtyAssets() async {

View file

@ -1510,6 +1510,7 @@ void main() {
commandHelp.P,
commandHelp.a,
'An Observatory debugger and profiler on null is available at: null',
'\n💪 Running with sound null safety 💪',
''
].join('\n')
));