Add text to --analyze-size command output to launch DevTools with size data (#72295)

* Add text to --analyze-size command output to launch DevTools with size data.
This commit is contained in:
Kenzie Schmoll
2020-12-15 11:06:10 -08:00
committed by GitHub
parent c1d3de6086
commit 94a30ddcbb
10 changed files with 67 additions and 6 deletions

View File

@@ -84,6 +84,14 @@ Future<void> buildLinux(
globals.printStatus(
'A summary of your Linux bundle analysis can be found at: ${outputFile.path}',
);
// DevTools expects a file path relative to the .flutter-devtools/ dir.
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'
);
}
}