[flutter_tools] correctly forward error only stdout in non-verbose modes (#63815)

This commit is contained in:
Jonah Williams
2020-08-18 16:56:05 -07:00
committed by GitHub
parent 2122fe1fa1
commit 39c735f408
4 changed files with 19 additions and 7 deletions

View File

@@ -14,6 +14,10 @@ import '../ios/xcodeproj.dart';
import '../project.dart';
import 'cocoapod_utils.dart';
/// When run in -quiet mode, Xcode only prints from the underlying tasks to stdout.
/// Passing this regexp to trace moves the stdout output to stderr.
final RegExp _anyOutput = RegExp('.*');
/// Builds the macOS project through xcodebuild.
// TODO(jonahwilliams): refactor to share code with the existing iOS code.
Future<void> buildMacOS({
@@ -87,10 +91,15 @@ Future<void> buildMacOS({
'OBJROOT=${globals.fs.path.join(flutterBuildDir.absolute.path, 'Build', 'Intermediates.noindex')}',
'SYMROOT=${globals.fs.path.join(flutterBuildDir.absolute.path, 'Build', 'Products')}',
if (verboseLogging)
'VERBOSE_SCRIPT_LOGGING=YES',
'VERBOSE_SCRIPT_LOGGING=YES'
else
'-quiet',
'COMPILER_INDEX_STORE_ENABLE=NO',
...environmentVariablesAsXcodeBuildSettings(globals.platform)
], trace: true);
],
trace: true,
stdoutErrorMatcher: verboseLogging ? null : _anyOutput,
);
} finally {
status.cancel();
}