@@ -277,41 +277,16 @@ Future<XcodeBuildResult> buildXcodeProject({
277
277
);
278
278
}
279
279
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
-
297
280
final List <String > commands = < String > [
298
281
'/usr/bin/env' ,
299
282
'xcrun' ,
300
283
'xcodebuild' ,
284
+ 'clean' ,
301
285
'build' ,
302
286
'-configuration' , configuration,
303
287
'ONLY_ACTIVE_ARCH=YES' ,
304
288
];
305
289
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
-
315
290
if (developmentTeam != null )
316
291
commands.add ('DEVELOPMENT_TEAM=$developmentTeam ' );
317
292
@@ -343,28 +318,27 @@ Future<XcodeBuildResult> buildXcodeProject({
343
318
);
344
319
}
345
320
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 (
349
323
commands,
350
324
workingDirectory: app.appDirectory,
351
325
allowReentrantFlutter: true
352
326
);
353
- buildStatus .stop ();
354
- if (buildResult .exitCode != 0 ) {
327
+ status .stop ();
328
+ if (result .exitCode != 0 ) {
355
329
printStatus ('Failed to build iOS app' );
356
- if (buildResult .stderr.isNotEmpty) {
330
+ if (result .stderr.isNotEmpty) {
357
331
printStatus ('Error output from Xcode build:\n ↳' );
358
- printStatus (buildResult .stderr, indent: 4 );
332
+ printStatus (result .stderr, indent: 4 );
359
333
}
360
- if (buildResult .stdout.isNotEmpty) {
334
+ if (result .stdout.isNotEmpty) {
361
335
printStatus ('Xcode\' s output:\n ↳' );
362
- printStatus (buildResult .stdout, indent: 4 );
336
+ printStatus (result .stdout, indent: 4 );
363
337
}
364
338
return new XcodeBuildResult (
365
339
success: false ,
366
- stdout: buildResult .stdout,
367
- stderr: buildResult .stderr,
340
+ stdout: result .stdout,
341
+ stderr: result .stderr,
368
342
xcodeBuildExecution: new XcodeBuildExecution (
369
343
commands,
370
344
app.appDirectory,
@@ -374,7 +348,7 @@ Future<XcodeBuildResult> buildXcodeProject({
374
348
} else {
375
349
// Look for 'clean build/<configuration>-<sdk>/Runner.app'.
376
350
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);
378
352
String outputDir;
379
353
if (match != null ) {
380
354
final String actualOutputDir = match.group (1 ).replaceAll ('\\ ' , ' ' );
0 commit comments