Unverified Commit 42a6b791 authored by Taha Tesser's avatar Taha Tesser Committed by GitHub

[tools] Add Xcode version to non-verbose Flutter doctor (#87022)

parent a1ae4fea
......@@ -58,6 +58,7 @@ class XcodeProjectInterpreter {
processManager: processManager,
),
_version = version,
_versionText = version?.toString(),
_usage = usage;
/// Create an [XcodeProjectInterpreter] for testing.
......
......@@ -32,9 +32,11 @@ class XcodeValidator extends DoctorValidator {
}
final String? versionText = _xcode.versionText;
if (versionText != null) {
messages.add(ValidationMessage(versionText));
xcodeVersionInfo = versionText;
if (xcodeVersionInfo.contains(',')) {
xcodeVersionInfo = xcodeVersionInfo.substring(0, xcodeVersionInfo.indexOf(','));
}
}
if (!_xcode.isInstalledAndMeetsVersionCheck) {
xcodeStatus = ValidationType.partial;
messages.add(ValidationMessage.error(_userMessages.xcodeOutdated(xcodeRequiredVersion.toString())));
......
......@@ -23,6 +23,7 @@ void main() {
final XcodeValidator validator = XcodeValidator(xcode: xcode, userMessages: UserMessages());
final ValidationResult result = await validator.validate();
expect(result.type, ValidationType.missing);
expect(result.statusInfo, isNull);
expect(result.messages.last.type, ValidationMessageType.error);
expect(result.messages.last.message, contains('Xcode not installed'));
});
......@@ -182,6 +183,11 @@ void main() {
final XcodeValidator validator = XcodeValidator(xcode: xcode, userMessages: UserMessages());
final ValidationResult result = await validator.validate();
expect(result.type, ValidationType.installed);
expect(result.messages.length, 1);
final ValidationMessage firstMessage = result.messages.first;
expect(firstMessage.type, ValidationMessageType.information);
expect(firstMessage.message, 'Xcode at /Library/Developer/CommandLineTools');
expect(result.statusInfo, '1000.0.0');
});
});
}
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