From 2d47481f1e48d744bcbd7d4b33ab9cc5ef2de8e1 Mon Sep 17 00:00:00 2001 From: Mikkel Nygaard Ravn Date: Mon, 12 Feb 2018 15:15:51 +0100 Subject: [PATCH] Revert "Reduce xcodebuild noise #2" (#14641) Merging to get back to a green tree. --- packages/flutter_tools/bin/xcode_backend.sh | 4 +- packages/flutter_tools/lib/src/ios/mac.dart | 50 +++++---------------- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/packages/flutter_tools/bin/xcode_backend.sh b/packages/flutter_tools/bin/xcode_backend.sh index fc1539aedaa..6f526695fd7 100755 --- a/packages/flutter_tools/bin/xcode_backend.sh +++ b/packages/flutter_tools/bin/xcode_backend.sh @@ -4,9 +4,7 @@ # found in the LICENSE file. RunCommand() { - if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then - echo "♦ $*" - fi + echo "♦ $*" "$@" return $? } diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index 29390bb6c1d..fb08fc3e1cc 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -277,41 +277,16 @@ Future buildXcodeProject({ ); } - final Status cleanStatus = - logger.startProgress('Running Xcode clean...', expectSlowOperation: true); - final RunResult cleanResult = await runAsync( - [ - '/usr/bin/env', - 'xcrun', - 'xcodebuild', - 'clean', - '-configuration', configuration, - ], - workingDirectory: app.appDirectory, - ); - cleanStatus.stop(); - if (cleanResult.exitCode != 0) { - throwToolExit('Xcode failed to clean\n${cleanResult.stderr}'); - } - final List commands = [ '/usr/bin/env', 'xcrun', 'xcodebuild', + 'clean', 'build', '-configuration', configuration, 'ONLY_ACTIVE_ARCH=YES', ]; - if (logger.isVerbose) { - // An environment variable to be passed to xcode_backend.sh determining - // whether to echo back executed commands. - commands.add('VERBOSE_SCRIPT_LOGGING=YES'); - } else { - // This will print warnings and errors only. - commands.add('-quiet'); - } - if (developmentTeam != null) commands.add('DEVELOPMENT_TEAM=$developmentTeam'); @@ -343,28 +318,27 @@ Future buildXcodeProject({ ); } - final Status buildStatus = - logger.startProgress('Running Xcode build...', expectSlowOperation: true); - final RunResult buildResult = await runAsync( + final Status status = logger.startProgress('Running Xcode build...', expectSlowOperation: true); + final RunResult result = await runAsync( commands, workingDirectory: app.appDirectory, allowReentrantFlutter: true ); - buildStatus.stop(); - if (buildResult.exitCode != 0) { + status.stop(); + if (result.exitCode != 0) { printStatus('Failed to build iOS app'); - if (buildResult.stderr.isNotEmpty) { + if (result.stderr.isNotEmpty) { printStatus('Error output from Xcode build:\n↳'); - printStatus(buildResult.stderr, indent: 4); + printStatus(result.stderr, indent: 4); } - if (buildResult.stdout.isNotEmpty) { + if (result.stdout.isNotEmpty) { printStatus('Xcode\'s output:\n↳'); - printStatus(buildResult.stdout, indent: 4); + printStatus(result.stdout, indent: 4); } return new XcodeBuildResult( success: false, - stdout: buildResult.stdout, - stderr: buildResult.stderr, + stdout: result.stdout, + stderr: result.stderr, xcodeBuildExecution: new XcodeBuildExecution( commands, app.appDirectory, @@ -374,7 +348,7 @@ Future buildXcodeProject({ } else { // Look for 'clean build/-/Runner.app'. final RegExp regexp = new RegExp(r' clean (.*\.app)$', multiLine: true); - final Match match = regexp.firstMatch(buildResult.stdout); + final Match match = regexp.firstMatch(result.stdout); String outputDir; if (match != null) { final String actualOutputDir = match.group(1).replaceAll('\\ ', ' ');