Skip to content

Commit

Permalink
Revert "Reduce noise in xcodebuild stdout (flutter#14586)" (flutter#1…
Browse files Browse the repository at this point in the history
…4605)

This reverts commit 74ddda5.
  • Loading branch information
xster authored Feb 9, 2018
1 parent e11e442 commit 8e2278b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 40 deletions.
4 changes: 1 addition & 3 deletions packages/flutter_tools/bin/xcode_backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
# found in the LICENSE file.

RunCommand() {
if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then
echo "$*"
fi
echo "$*"
"$@"
return $?
}
Expand Down
49 changes: 12 additions & 37 deletions packages/flutter_tools/lib/src/ios/mac.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,40 +277,16 @@ Future<XcodeBuildResult> buildXcodeProject({
);
}

final Status cleanStatus =
logger.startProgress('Running Xcode clean...', expectSlowOperation: true);
final RunResult cleanResult = await runAsync(
<String>[
'/usr/bin/env',
'xcrun',
'xcodebuild',
'clean',
],
workingDirectory: app.appDirectory,
);
cleanStatus.stop();
if (cleanResult.exitCode != 0) {
throwToolExit('Xcode failed to clean\n${cleanResult.stderr}');
}

final List<String> commands = <String>[
'/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');

Expand Down Expand Up @@ -342,28 +318,27 @@ Future<XcodeBuildResult> 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,
Expand All @@ -373,7 +348,7 @@ Future<XcodeBuildResult> buildXcodeProject({
} else {
// Look for 'clean build/<configuration>-<sdk>/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('\\ ', ' ');
Expand Down

0 comments on commit 8e2278b

Please sign in to comment.