File tree 7 files changed +12
-7
lines changed
packages/flutter_tools/lib/src 7 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ class BuildInfo {
119
119
bool get supportsEmulator => isEmulatorBuildMode (mode);
120
120
bool get supportsSimulator => isEmulatorBuildMode (mode);
121
121
String get modeName => getModeName (mode);
122
+ String get friendlyModeName => getFriendlyModeName (mode);
122
123
123
124
BuildInfo withTargetPlatform (TargetPlatform targetPlatform) =>
124
125
BuildInfo (mode, flavor,
@@ -142,6 +143,10 @@ enum BuildMode {
142
143
143
144
String getModeName (BuildMode mode) => getEnumName (mode);
144
145
146
+ String getFriendlyModeName (BuildMode mode) {
147
+ return snakeCase (getModeName (mode)).replaceAll ('_' , ' ' );
148
+ }
149
+
145
150
// Returns true if the selected build mode uses ahead-of-time compilation.
146
151
bool isAotBuildMode (BuildMode mode) {
147
152
return mode == BuildMode .profile || mode == BuildMode .release;
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ Future<void> build({
85
85
86
86
} else if (! fs.file (compilationTraceFilePath).existsSync ()) {
87
87
// Be forgiving if compilation trace file is missing.
88
- printError ( 'Warning: Ignoring missing compilation training file $ compilationTraceFilePath .' );
88
+ printStatus ( 'No compilation trace available. To optimize performance, consider using --train .' );
89
89
final File tmp = fs.systemTempDirectory.childFile ('flutterEmptyCompilationTrace.txt' );
90
90
compilationTraceFilePath = (tmp..createSync (recursive: true )).path;
91
91
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ class BuildAotCommand extends BuildSubCommand {
70
70
if (! argResults['quiet' ]) {
71
71
final String typeName = artifacts.getEngineType (platform, buildMode);
72
72
status = logger.startProgress (
73
- 'Building AOT snapshot in ${getModeName (getBuildMode ())} mode ($typeName )...' ,
73
+ 'Building AOT snapshot in ${getFriendlyModeName (getBuildMode ())} mode ($typeName )...' ,
74
74
expectSlowOperation: true ,
75
75
);
76
76
}
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ class BuildIOSCommand extends BuildSubCommand {
70
70
}
71
71
final BuildInfo buildInfo = getBuildInfo ();
72
72
if (forSimulator && ! buildInfo.supportsSimulator)
73
- throwToolExit ('${toTitleCase (buildInfo .modeName )} mode is not supported for simulators.' );
73
+ throwToolExit ('${toTitleCase (buildInfo .friendlyModeName )} mode is not supported for simulators.' );
74
74
75
75
final String logTarget = forSimulator ? 'simulator' : 'device' ;
76
76
Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ class AppDomain extends Domain {
342
342
String isolateFilter,
343
343
}) async {
344
344
if (await device.isLocalEmulator && ! options.buildInfo.supportsEmulator) {
345
- throw '${toTitleCase (options .buildInfo .modeName )} mode is not supported for emulators.' ;
345
+ throw '${toTitleCase (options .buildInfo .friendlyModeName )} mode is not supported for emulators.' ;
346
346
}
347
347
348
348
// We change the current working directory for the duration of the `start` command.
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ class RunCommand extends RunCommandBase {
303
303
}
304
304
305
305
if (! isEmulatorBuildMode (getBuildMode ())) {
306
- throwToolExit ('${toTitleCase (getModeName (getBuildMode ()))} mode is not supported for emulators.' );
306
+ throwToolExit ('${toTitleCase (getFriendlyModeName (getBuildMode ()))} mode is not supported for emulators.' );
307
307
}
308
308
}
309
309
}
Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ class FlutterDevice {
265
265
bool shouldBuild,
266
266
}) async {
267
267
final bool prebuiltMode = hotRunner.applicationBinary != null ;
268
- final String modeName = hotRunner.debuggingOptions.buildInfo.modeName ;
268
+ final String modeName = hotRunner.debuggingOptions.buildInfo.friendlyModeName ;
269
269
printStatus ('Launching ${getDisplayPath (hotRunner .mainPath )} on ${device .name } in $modeName mode...' );
270
270
271
271
final TargetPlatform targetPlatform = await device.targetPlatform;
@@ -324,7 +324,7 @@ class FlutterDevice {
324
324
applicationBinary: coldRunner.applicationBinary
325
325
);
326
326
327
- final String modeName = coldRunner.debuggingOptions.buildInfo.modeName ;
327
+ final String modeName = coldRunner.debuggingOptions.buildInfo.friendlyModeName ;
328
328
final bool prebuiltMode = coldRunner.applicationBinary != null ;
329
329
if (coldRunner.mainPath == null ) {
330
330
assert (prebuiltMode);
You can’t perform that action at this time.
0 commit comments