Filter out some stray Xcode logging during macOS builds (#100707)
This commit is contained in:
parent
6335345e67
commit
12da4a2aff
@ -16,9 +16,13 @@ import '../project.dart';
|
|||||||
import 'cocoapod_utils.dart';
|
import 'cocoapod_utils.dart';
|
||||||
import 'migrations/remove_macos_framework_link_and_embedding_migration.dart';
|
import 'migrations/remove_macos_framework_link_and_embedding_migration.dart';
|
||||||
|
|
||||||
/// When run in -quiet mode, Xcode only prints from the underlying tasks to stdout.
|
/// When run in -quiet mode, Xcode should only print from the underlying tasks to stdout.
|
||||||
/// Passing this regexp to trace moves the stdout output to stderr.
|
/// Passing this regexp to trace moves the stdout output to stderr.
|
||||||
final RegExp _anyOutput = RegExp('.*');
|
///
|
||||||
|
/// Filter out xcodebuild logging unrelated to macOS builds:
|
||||||
|
/// xcodebuild[2096:1927385] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
|
||||||
|
/// note: Using new build system
|
||||||
|
final RegExp _filteredOutput = RegExp(r'^((?!Requested but did not find extension point with identifier|note\:).)*$');
|
||||||
|
|
||||||
/// Builds the macOS project through xcodebuild.
|
/// Builds the macOS project through xcodebuild.
|
||||||
// TODO(zanderso): refactor to share code with the existing iOS code.
|
// TODO(zanderso): refactor to share code with the existing iOS code.
|
||||||
@ -113,7 +117,8 @@ Future<void> buildMacOS({
|
|||||||
...environmentVariablesAsXcodeBuildSettings(globals.platform)
|
...environmentVariablesAsXcodeBuildSettings(globals.platform)
|
||||||
],
|
],
|
||||||
trace: true,
|
trace: true,
|
||||||
stdoutErrorMatcher: verboseLogging ? null : _anyOutput,
|
stdoutErrorMatcher: verboseLogging ? null : _filteredOutput,
|
||||||
|
mapFunction: verboseLogging ? null : (String line) => _filteredOutput.hasMatch(line) ? line : null,
|
||||||
);
|
);
|
||||||
} finally {
|
} finally {
|
||||||
status.cancel();
|
status.cancel();
|
||||||
|
@ -113,7 +113,18 @@ void main() {
|
|||||||
'-quiet',
|
'-quiet',
|
||||||
'COMPILER_INDEX_STORE_ENABLE=NO',
|
'COMPILER_INDEX_STORE_ENABLE=NO',
|
||||||
],
|
],
|
||||||
stdout: 'STDOUT STUFF',
|
stdout: '''
|
||||||
|
STDOUT STUFF
|
||||||
|
note: Using new build system
|
||||||
|
note: Planning
|
||||||
|
note: Build preparation complete
|
||||||
|
note: Building targets in dependency order
|
||||||
|
''',
|
||||||
|
stderr: '''
|
||||||
|
2022-03-24 10:07:21.954 xcodebuild[2096:1927385] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
|
||||||
|
2022-03-24 10:07:21.954 xcodebuild[2096:1927385] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
|
||||||
|
STDERR STUFF
|
||||||
|
''',
|
||||||
onRun: () {
|
onRun: () {
|
||||||
fileSystem.file(fileSystem.path.join('macos', 'Flutter', 'ephemeral', '.app_filename'))
|
fileSystem.file(fileSystem.path.join('macos', 'Flutter', 'ephemeral', '.app_filename'))
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
@ -183,6 +194,11 @@ void main() {
|
|||||||
expect(testLogger.statusText, isNot(contains('STDOUT STUFF')));
|
expect(testLogger.statusText, isNot(contains('STDOUT STUFF')));
|
||||||
expect(testLogger.traceText, isNot(contains('STDOUT STUFF')));
|
expect(testLogger.traceText, isNot(contains('STDOUT STUFF')));
|
||||||
expect(testLogger.errorText, contains('STDOUT STUFF'));
|
expect(testLogger.errorText, contains('STDOUT STUFF'));
|
||||||
|
expect(testLogger.errorText, contains('STDERR STUFF'));
|
||||||
|
// Filters out some xcodebuild logging spew.
|
||||||
|
expect(testLogger.errorText, isNot(contains('xcodebuild[2096:1927385]')));
|
||||||
|
expect(testLogger.errorText, isNot(contains('Using new build system')));
|
||||||
|
expect(testLogger.errorText, isNot(contains('Building targets in dependency order')));
|
||||||
}, overrides: <Type, Generator>{
|
}, overrides: <Type, Generator>{
|
||||||
FileSystem: () => fileSystem,
|
FileSystem: () => fileSystem,
|
||||||
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user