Unverified Commit 1efb3603 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

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

parent a5519dc7
...@@ -418,7 +418,8 @@ class WindowsStdoutLogger extends StdoutLogger { ...@@ -418,7 +418,8 @@ class WindowsStdoutLogger extends StdoutLogger {
.replaceAll('🖼️', '') .replaceAll('🖼️', '')
.replaceAll('✗', 'X') .replaceAll('✗', 'X')
.replaceAll('✓', '√') .replaceAll('✓', '√')
.replaceAll('🔨', ''); .replaceAll('🔨', '')
.replaceAll('💪', '');
_stdio.stdoutWrite(windowsMessage); _stdio.stdoutWrite(windowsMessage);
} }
} }
......
...@@ -723,7 +723,7 @@ class _ResidentWebRunner extends ResidentWebRunner { ...@@ -723,7 +723,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
?? debuggingOptions.buildInfo.packageConfig, ?? debuggingOptions.buildInfo.packageConfig,
); );
final Status devFSStatus = globals.logger.startProgress( 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( final UpdateFSReport report = await device.devFS.update(
mainUri: await _generateEntrypoint( mainUri: await _generateEntrypoint(
...@@ -833,6 +833,18 @@ class _ResidentWebRunner extends ResidentWebRunner { ...@@ -833,6 +833,18 @@ class _ResidentWebRunner extends ResidentWebRunner {
..writeAsStringSync(websocketUri.toString()); ..writeAsStringSync(websocketUri.toString());
} }
globals.printStatus('Debug service listening on $websocketUri'); 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(); appStartedCompleter?.complete();
connectionInfoCompleter?.complete(DebugConnectionInfo(wsUri: websocketUri)); connectionInfoCompleter?.complete(DebugConnectionInfo(wsUri: websocketUri));
......
...@@ -1219,15 +1219,8 @@ abstract class ResidentRunner { ...@@ -1219,15 +1219,8 @@ abstract class ResidentRunner {
ipv6: ipv6, ipv6: ipv6,
disableServiceAuthCodes: debuggingOptions.disableServiceAuthCodes disableServiceAuthCodes: debuggingOptions.disableServiceAuthCodes
); );
// This will wait for at least one flutter view before returning. await device.vmService.getFlutterViews();
final Status status = globals.logger.startProgress(
'Waiting for ${device.device.name} to report its views...',
);
try {
await device.vmService.getFlutterViews();
} finally {
status.stop();
}
// This hooks up callbacks for when the connection stops in the future. // 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' // 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. // futures either because they just print to logger and is not critical.
......
...@@ -1095,13 +1095,24 @@ class HotRunner extends ResidentRunner { ...@@ -1095,13 +1095,24 @@ class HotRunner extends ResidentRunner {
printHelpDetails(); printHelpDetails();
} }
for (final FlutterDevice device in flutterDevices) { for (final FlutterDevice device in flutterDevices) {
final String dname = device.device.name;
// Caution: This log line is parsed by device lab tests. // Caution: This log line is parsed by device lab tests.
globals.printStatus( 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}', '${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 { Future<void> _evictDirtyAssets() async {
......
...@@ -1510,6 +1510,7 @@ void main() { ...@@ -1510,6 +1510,7 @@ void main() {
commandHelp.P, commandHelp.P,
commandHelp.a, commandHelp.a,
'An Observatory debugger and profiler on null is available at: null', 'An Observatory debugger and profiler on null is available at: null',
'\n💪 Running with sound null safety 💪',
'' ''
].join('\n') ].join('\n')
)); ));
......
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