Skip to content

Commit 2d47481

Browse files
authored
Revert "Reduce xcodebuild noise flutter#2" (flutter#14641)
Merging to get back to a green tree.
1 parent ce82cc6 commit 2d47481

File tree

2 files changed

+13
-41
lines changed

2 files changed

+13
-41
lines changed

packages/flutter_tools/bin/xcode_backend.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
# found in the LICENSE file.
55

66
RunCommand() {
7-
if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then
8-
echo "$*"
9-
fi
7+
echo "$*"
108
"$@"
119
return $?
1210
}

packages/flutter_tools/lib/src/ios/mac.dart

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -277,41 +277,16 @@ Future<XcodeBuildResult> buildXcodeProject({
277277
);
278278
}
279279

280-
final Status cleanStatus =
281-
logger.startProgress('Running Xcode clean...', expectSlowOperation: true);
282-
final RunResult cleanResult = await runAsync(
283-
<String>[
284-
'/usr/bin/env',
285-
'xcrun',
286-
'xcodebuild',
287-
'clean',
288-
'-configuration', configuration,
289-
],
290-
workingDirectory: app.appDirectory,
291-
);
292-
cleanStatus.stop();
293-
if (cleanResult.exitCode != 0) {
294-
throwToolExit('Xcode failed to clean\n${cleanResult.stderr}');
295-
}
296-
297280
final List<String> commands = <String>[
298281
'/usr/bin/env',
299282
'xcrun',
300283
'xcodebuild',
284+
'clean',
301285
'build',
302286
'-configuration', configuration,
303287
'ONLY_ACTIVE_ARCH=YES',
304288
];
305289

306-
if (logger.isVerbose) {
307-
// An environment variable to be passed to xcode_backend.sh determining
308-
// whether to echo back executed commands.
309-
commands.add('VERBOSE_SCRIPT_LOGGING=YES');
310-
} else {
311-
// This will print warnings and errors only.
312-
commands.add('-quiet');
313-
}
314-
315290
if (developmentTeam != null)
316291
commands.add('DEVELOPMENT_TEAM=$developmentTeam');
317292

@@ -343,28 +318,27 @@ Future<XcodeBuildResult> buildXcodeProject({
343318
);
344319
}
345320

346-
final Status buildStatus =
347-
logger.startProgress('Running Xcode build...', expectSlowOperation: true);
348-
final RunResult buildResult = await runAsync(
321+
final Status status = logger.startProgress('Running Xcode build...', expectSlowOperation: true);
322+
final RunResult result = await runAsync(
349323
commands,
350324
workingDirectory: app.appDirectory,
351325
allowReentrantFlutter: true
352326
);
353-
buildStatus.stop();
354-
if (buildResult.exitCode != 0) {
327+
status.stop();
328+
if (result.exitCode != 0) {
355329
printStatus('Failed to build iOS app');
356-
if (buildResult.stderr.isNotEmpty) {
330+
if (result.stderr.isNotEmpty) {
357331
printStatus('Error output from Xcode build:\n↳');
358-
printStatus(buildResult.stderr, indent: 4);
332+
printStatus(result.stderr, indent: 4);
359333
}
360-
if (buildResult.stdout.isNotEmpty) {
334+
if (result.stdout.isNotEmpty) {
361335
printStatus('Xcode\'s output:\n↳');
362-
printStatus(buildResult.stdout, indent: 4);
336+
printStatus(result.stdout, indent: 4);
363337
}
364338
return new XcodeBuildResult(
365339
success: false,
366-
stdout: buildResult.stdout,
367-
stderr: buildResult.stderr,
340+
stdout: result.stdout,
341+
stderr: result.stderr,
368342
xcodeBuildExecution: new XcodeBuildExecution(
369343
commands,
370344
app.appDirectory,
@@ -374,7 +348,7 @@ Future<XcodeBuildResult> buildXcodeProject({
374348
} else {
375349
// Look for 'clean build/<configuration>-<sdk>/Runner.app'.
376350
final RegExp regexp = new RegExp(r' clean (.*\.app)$', multiLine: true);
377-
final Match match = regexp.firstMatch(buildResult.stdout);
351+
final Match match = regexp.firstMatch(result.stdout);
378352
String outputDir;
379353
if (match != null) {
380354
final String actualOutputDir = match.group(1).replaceAll('\\ ', ' ');

0 commit comments

Comments
 (0)