Commit 4d8395e1 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Improve doctor output when Xcode installation is incomplete (#8012)

If the developer has only installed the Xcode command-line tools,
xcode-select and some other tools may be present, but xcodebuild will be
missing. In this case, output a slightly improved message indicating
that the installation is incomplete rather than missing.
parent 1cc78145
...@@ -87,10 +87,17 @@ class IOSWorkflow extends DoctorValidator implements Workflow { ...@@ -87,10 +87,17 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
} }
} else { } else {
xcodeStatus = ValidationType.missing; xcodeStatus = ValidationType.missing;
messages.add(new ValidationMessage.error( if (xcode.xcodeSelectPath.isEmpty) {
'Xcode not installed; this is necessary for iOS development.\n' messages.add(new ValidationMessage.error(
'Download at https://developer.apple.com/xcode/download/.' 'Xcode not installed; this is necessary for iOS development.\n'
)); 'Download at https://developer.apple.com/xcode/download/.'
));
} else {
messages.add(new ValidationMessage.error(
'Xcode installation is incomplete; a full installation is necessary for iOS development.\n'
'Download at https://developer.apple.com/xcode/download/.'
));
}
} }
// Python dependencies installed // Python dependencies installed
......
...@@ -20,6 +20,7 @@ void main() { ...@@ -20,6 +20,7 @@ void main() {
testUsingContext('Emit missing status when nothing is installed', () async { testUsingContext('Emit missing status when nothing is installed', () async {
when(xcode.isInstalled).thenReturn(false); when(xcode.isInstalled).thenReturn(false);
when(xcode.xcodeSelectPath).thenReturn('');
IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget() IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget()
..hasPythonSixModule = false ..hasPythonSixModule = false
..hasHomebrew = false ..hasHomebrew = false
...@@ -30,6 +31,15 @@ void main() { ...@@ -30,6 +31,15 @@ void main() {
testUsingContext('Emits partial status when Xcode is not installed', () async { testUsingContext('Emits partial status when Xcode is not installed', () async {
when(xcode.isInstalled).thenReturn(false); when(xcode.isInstalled).thenReturn(false);
when(xcode.xcodeSelectPath).thenReturn('');
IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget();
ValidationResult result = await workflow.validate();
expect(result.type, ValidationType.partial);
}, overrides: <Type, Generator>{ Xcode: () => xcode });
testUsingContext('Emits partial status when Xcode is partially installed', () async {
when(xcode.isInstalled).thenReturn(false);
when(xcode.xcodeSelectPath).thenReturn('/Library/Developer/CommandLineTools');
IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget(); IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget();
ValidationResult result = await workflow.validate(); ValidationResult result = await workflow.validate();
expect(result.type, ValidationType.partial); expect(result.type, ValidationType.partial);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment