Skip to content

Add a user friendly error message when no development team is selected for physical deployment - #7879

Merged
xster merged 8 commits into
flutter:masterfrom
xster:provisioning-warning
Feb 8, 2017
Merged

xster merged 8 commits into
flutter:masterfrom
xster:provisioning-warning

Conversation

@xster

@xster xster commented Feb 4, 2017

Copy link
Copy Markdown
Member

No description provided.

@xster
xster requested a review from cbracken February 4, 2017 01:47
@xster

xster commented Feb 4, 2017

Copy link
Copy Markdown
Member Author

For #7839

allowReentrantFlutter: true
);
if (checkBuildSettings.exitCode == 0
&& !checkBuildSettings.stdout?.contains('DEVELOPMENT_TEAM') == true) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely the case with recent releases of Xcode (> 8.1, IIRC) when using automatic signing -- is it also the case in Xcode 7 and/or when you use manual mode and use a provisioning profile?

One option would be to bump the minimum required Xcode version from its current value (IIRC, >= 7.0) in mac.dart.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check both development team and provisioning profile as suggested

printError(' https://flutter.io/setup/#deploy-to-ios-devices\n');
printError('Or run on an iOS simulator');
printError(
'═══════════════════════════════════════════════════════════════════════════════════');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a multi-line ''' string.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that might be more readable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if (result.buildForDevice
&& result.buildCommands != null
&& result.buildCommands.contains('build')
&& result.appDirectory != null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When buildForDevice is true, are buildCommands and appDirectory always expected? If so, use assertions ahead of the conditional.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some grouping would indeed be nicer. Pulled out an inner class and used assertions.

printError('Encountered error while building for $logTarget.');
diagnoseXcodeBuildFailure(result);
await diagnoseXcodeBuildFailure(result);
throwToolExit('');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems hacky to call it with an empty string.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swapped in the message 2 lines earlier. Makes sense to print the definitive implication at the end anyway.

printStatus(result.stdout);
return new XcodeBuildResult(false, stdout: result.stdout, stderr: result.stderr);
return new XcodeBuildResult(
false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use named arguments for all boolean parameters.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return;
}
if (result.buildForDevice
&& result.buildCommands != null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you put the && at the end of the lines you'll get the subexpressions lined up

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if (checkBuildSettings.exitCode == 0
&& !checkBuildSettings.stdout?.contains('DEVELOPMENT_TEAM') == true) {
printError(
'═══════════════════════════════════════════════════════════════════════════════════');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think wrapping here is helping readability.

this.stderr,
this.buildCommands,
this.buildForDevice,
this.appDirectory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing comma

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Hixie

Hixie commented Feb 4, 2017

Copy link
Copy Markdown
Contributor

LGTM but I don't really know much about Xcode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants