Reland: Show output from pub get in flutter pub get (#110851)

This commit is contained in:
Sigurd Meldgaard
2022-09-08 15:13:23 +02:00
committed by GitHub
parent 1ed2312493
commit d80e994a62
28 changed files with 558 additions and 250 deletions

View File

@@ -980,6 +980,13 @@ class _SnippetChecker {
/// Invokes the analyzer on the given [directory] and returns the stdout (with some lines filtered).
List<String> _runAnalyzer() {
_createConfigurationFiles();
// Run pub get to avoid output from getting dependencies in the analyzer
// output.
Process.runSync(
_flutter,
<String>['pub', 'get'],
workingDirectory: _tempDirectory.absolute.path,
);
final ProcessResult result = Process.runSync(
_flutter,
<String>['--no-wrap', 'analyze', '--no-preamble', '--no-congratulate', '.'],
@@ -1006,7 +1013,7 @@ class _SnippetChecker {
if (stdout.isNotEmpty && stdout.first == 'Building flutter tool...') {
stdout.removeAt(0);
}
if (stdout.isNotEmpty && stdout.first.startsWith('Running "flutter pub get" in ')) {
if (stdout.isNotEmpty && stdout.first.isEmpty) {
stdout.removeAt(0);
}
return stdout;

View File

@@ -42,11 +42,10 @@ TaskFunction createWebDevModeTest(String webDevice, bool enableIncrementalCompil
recursiveCopy(flutterGalleryDir, _editedFlutterGalleryDir);
await inDirectory<void>(_editedFlutterGalleryDir, () async {
{
final Process packagesGet = await startProcess(
await exec(
path.join(flutterDirectory.path, 'bin', 'flutter'),
<String>['packages', 'get'],
);
await packagesGet.exitCode;
final Process process = await startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
flutterCommandArgs('run', options),