@@ -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