Skip to content

Commit

Permalink
fix devtool instructional messages after `flutter build ... --analyze…
Browse files Browse the repository at this point in the history
…-size `. Fixes #122229 (#122230)

fix devtool instructional messages after `flutter build ... --analyze-size `.  Fixes #122229
  • Loading branch information
timmaffett authored Mar 9, 2023
1 parent 01367d5 commit 2e8c346
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 16 deletions.
3 changes: 1 addition & 2 deletions packages/flutter_tools/lib/src/android/gradle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
.trim();
_logger.printStatus(
'\nTo analyze your app size in Dart DevTools, run the following command:\n'
'flutter pub global activate devtools; flutter pub global run devtools '
'--appSizeBase=$relativeAppSizePath'
'dart devtools --appSizeBase=$relativeAppSizePath'
);
}

Expand Down
3 changes: 1 addition & 2 deletions packages/flutter_tools/lib/src/commands/build_ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
final String relativeAppSizePath = outputFile.path.split('.flutter-devtools/').last.trim();
globals.printStatus(
'\nTo analyze your app size in Dart DevTools, run the following command:\n'
'flutter pub global activate devtools; flutter pub global run devtools '
'--appSizeBase=$relativeAppSizePath'
'dart devtools --appSizeBase=$relativeAppSizePath'
);
}

Expand Down
3 changes: 1 addition & 2 deletions packages/flutter_tools/lib/src/linux/build_linux.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ Future<void> buildLinux(
final String relativeAppSizePath = outputFile.path.split('.flutter-devtools/').last.trim();
globals.printStatus(
'\nTo analyze your app size in Dart DevTools, run the following command:\n'
'flutter pub global activate devtools; flutter pub global run devtools '
'--appSizeBase=$relativeAppSizePath'
'dart devtools --appSizeBase=$relativeAppSizePath'
);
}
}
Expand Down
3 changes: 1 addition & 2 deletions packages/flutter_tools/lib/src/macos/build_macos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ Future<void> buildMacOS({
final String relativeAppSizePath = outputFile.path.split('.flutter-devtools/').last.trim();
globals.printStatus(
'\nTo analyze your app size in Dart DevTools, run the following command:\n'
'flutter pub global activate devtools; flutter pub global run devtools '
'--appSizeBase=$relativeAppSizePath'
'dart devtools --appSizeBase=$relativeAppSizePath'
);
}
globals.flutterUsage.sendTiming('build', 'xcode-macos', Duration(milliseconds: sw.elapsedMilliseconds));
Expand Down
3 changes: 1 addition & 2 deletions packages/flutter_tools/lib/src/windows/build_windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {
final String relativeAppSizePath = outputFile.path.split('.flutter-devtools/').last.trim();
globals.printStatus(
'\nTo analyze your app size in Dart DevTools, run the following command:\n'
'flutter pub global activate devtools; flutter pub global run devtools '
'--appSizeBase=$relativeAppSizePath'
'dart devtools --appSizeBase=$relativeAppSizePath'
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ void main() {
);

expect(testLogger.statusText, contains('A summary of your iOS bundle analysis can be found at'));
expect(testLogger.statusText, contains('flutter pub global activate devtools; flutter pub global run devtools --appSizeBase='));
expect(testLogger.statusText, contains('dart devtools --appSizeBase='));
expect(usage.events, contains(
const TestUsageEvent('code-size-analysis', 'ios'),
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ void main() {
);

expect(testLogger.statusText, contains('A summary of your iOS bundle analysis can be found at'));
expect(testLogger.statusText, contains('flutter pub global activate devtools; flutter pub global run devtools --appSizeBase='));
expect(testLogger.statusText, contains('dart devtools --appSizeBase='));
expect(usage.events, contains(
const TestUsageEvent('code-size-analysis', 'ios'),
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ set(BINARY_NAME "fizz_bar")
);

expect(testLogger.statusText, contains('A summary of your Linux bundle analysis can be found at'));
expect(testLogger.statusText, contains('flutter pub global activate devtools; flutter pub global run devtools --appSizeBase='));
expect(testLogger.statusText, contains('dart devtools --appSizeBase='));
expect(usage.events, contains(
const TestUsageEvent('code-size-analysis', 'linux'),
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ STDERR STUFF
);

expect(testLogger.statusText, contains('A summary of your macOS bundle analysis can be found at'));
expect(testLogger.statusText, contains('flutter pub global activate devtools; flutter pub global run devtools --appSizeBase='));
expect(testLogger.statusText, contains('dart devtools --appSizeBase='));
expect(usage.events, contains(
const TestUsageEvent('code-size-analysis', 'macos'),
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
);

expect(testLogger.statusText, contains('A summary of your Windows bundle analysis can be found at'));
expect(testLogger.statusText, contains('flutter pub global activate devtools; flutter pub global run devtools --appSizeBase='));
expect(testLogger.statusText, contains('dart devtools --appSizeBase='));
expect(usage.events, contains(
const TestUsageEvent('code-size-analysis', 'windows'),
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'test_utils.dart';
const String apkDebugMessage = 'A summary of your APK analysis can be found at: ';
const String iosDebugMessage = 'A summary of your iOS bundle analysis can be found at: ';
const String macOSDebugMessage = 'A summary of your macOS bundle analysis can be found at: ';
const String runDevToolsMessage = 'flutter pub global activate devtools; flutter pub global run devtools ';
const String runDevToolsMessage = 'dart devtools ';

void main() {
testWithoutContext('--analyze-size flag produces expected output on hello_world for Android', () async {
Expand Down

0 comments on commit 2e8c346

Please sign in to comment.