[flutter_tools] make verbose macOS builds actually verbose (#54320)

This commit is contained in:
Jonah Williams
2020-04-09 09:00:44 -07:00
committed by GitHub
parent 4451ffca23
commit 74a1b9b33e
4 changed files with 27 additions and 1 deletions

View File

@@ -69,7 +69,7 @@ void main() {
// Creates a FakeCommand for the xcodebuild call to build the app
// in the given configuration.
FakeCommand setUpMockXcodeBuildHandler(String configuration) {
FakeCommand setUpMockXcodeBuildHandler(String configuration, { bool verbose = false }) {
final FlutterProject flutterProject = FlutterProject.fromDirectory(fileSystem.currentDirectory);
final Directory flutterBuildDir = fileSystem.directory(getMacOSBuildDirectory());
return FakeCommand(
@@ -83,6 +83,8 @@ void main() {
'-derivedDataPath', flutterBuildDir.absolute.path,
'OBJROOT=${fileSystem.path.join(flutterBuildDir.absolute.path, 'Build', 'Intermediates.noindex')}',
'SYMROOT=${fileSystem.path.join(flutterBuildDir.absolute.path, 'Build', 'Products')}',
if (verbose)
'VERBOSE_SCRIPT_LOGGING=YES',
'COMPILER_INDEX_STORE_ENABLE=NO',
],
stdout: 'STDOUT STUFF',
@@ -159,6 +161,23 @@ void main() {
FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true),
});
testUsingContext('macOS build invokes xcode build (debug) with verbosity', () async {
final BuildCommand command = BuildCommand();
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'macos', '--debug', '-v']
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
setUpMockXcodeBuildHandler('Debug', verbose: true)
]),
Platform: () => macosPlatform,
FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true),
});
testUsingContext('macOS build invokes xcode build (profile)', () async {
final BuildCommand command = BuildCommand();
createMinimalMockProjectFiles();