Unverified Commit 8f360c97 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Update minimum required version to Xcode 13 (#97746)

parent fdcd1446
......@@ -147,7 +147,7 @@ class UserMessages {
String xcodeLocation(String location) => 'Xcode at $location';
String xcodeOutdated(String requiredVersion) =>
'Flutter requires a minimum Xcode version of $requiredVersion.\n'
'Flutter requires Xcode $requiredVersion or higher.\n'
'Download the latest version or update via the Mac App Store.';
String xcodeRecommended(String recommendedVersion) =>
......
......@@ -18,11 +18,11 @@ import '../base/version.dart';
import '../build_info.dart';
import '../ios/xcodeproj.dart';
Version get xcodeRequiredVersion => Version(12, 3, null, text: '12.3');
Version get xcodeRequiredVersion => Version(13, null, null);
/// Diverging this number from the minimum required version will provide a doctor
/// warning, not error, that users should upgrade Xcode.
Version get xcodeRecommendedVersion => Version(13, null, null, text: '13');
Version get xcodeRecommendedVersion => xcodeRequiredVersion;
/// SDK name passed to `xcrun --sdk`. Corresponds to undocumented Xcode
/// SUPPORTED_PLATFORMS values.
......
......@@ -133,85 +133,50 @@ void main() {
expect(fakeProcessManager.hasRemainingExpectations, isFalse);
});
testWithoutContext('xcodeVersionSatisfactory is false when version is less than minimum', () {
testWithoutContext('version checks fail when version is less than minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(9, 0, 0);
xcodeProjectInterpreter.version = Version(9, null, null);
expect(xcode.isRequiredVersionSatisfactory, isFalse);
});
testWithoutContext('xcodeVersionSatisfactory is false when xcodebuild tools are not installed', () {
xcodeProjectInterpreter.isInstalled = false;
expect(xcode.isRequiredVersionSatisfactory, isFalse);
});
testWithoutContext('xcodeVersionSatisfactory is true when version meets minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(12, 3, null);
expect(xcode.isRequiredVersionSatisfactory, isTrue);
});
testWithoutContext('xcodeVersionSatisfactory is true when major version exceeds minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(13, 0, 0);
expect(xcode.isRequiredVersionSatisfactory, isTrue);
});
testWithoutContext('xcodeVersionSatisfactory is true when minor version exceeds minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(12, 5, 0);
expect(xcode.isRequiredVersionSatisfactory, isTrue);
});
testWithoutContext('xcodeVersionSatisfactory is true when patch version exceeds minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(12, 3, 1);
expect(xcode.isRequiredVersionSatisfactory, isTrue);
});
testWithoutContext('isRecommendedVersionSatisfactory is false when version is less than minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(12, null, null);
expect(xcode.isRecommendedVersionSatisfactory, isFalse);
});
testWithoutContext('isRecommendedVersionSatisfactory is false when xcodebuild tools are not installed', () {
testWithoutContext('version checks fail when xcodebuild tools are not installed', () {
xcodeProjectInterpreter.isInstalled = false;
expect(xcode.isRequiredVersionSatisfactory, isFalse);
expect(xcode.isRecommendedVersionSatisfactory, isFalse);
});
testWithoutContext('isRecommendedVersionSatisfactory is true when version meets minimum', () {
testWithoutContext('version checks pass when version meets minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(13, 0, 0);
xcodeProjectInterpreter.version = Version(13, null, null);
expect(xcode.isRequiredVersionSatisfactory, isTrue);
expect(xcode.isRecommendedVersionSatisfactory, isTrue);
});
testWithoutContext('isRecommendedVersionSatisfactory is true when major version exceeds minimum', () {
testWithoutContext('version checks pass when major version exceeds minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(14, 0, 0);
expect(xcode.isRequiredVersionSatisfactory, isTrue);
expect(xcode.isRecommendedVersionSatisfactory, isTrue);
});
testWithoutContext('isRecommendedVersionSatisfactory is true when minor version exceeds minimum', () {
testWithoutContext('version checks pass when minor version exceeds minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(13, 3, 0);
expect(xcode.isRequiredVersionSatisfactory, isTrue);
expect(xcode.isRecommendedVersionSatisfactory, isTrue);
});
testWithoutContext('isRecommendedVersionSatisfactory is true when patch version exceeds minimum', () {
testWithoutContext('version checks pass when patch version exceeds minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(13, 0, 2);
expect(xcode.isRequiredVersionSatisfactory, isTrue);
expect(xcode.isRecommendedVersionSatisfactory, isTrue);
});
......@@ -232,7 +197,7 @@ void main() {
testWithoutContext('isInstalledAndMeetsVersionCheck is true when macOS and installed and version is satisfied', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(12, 3, null);
xcodeProjectInterpreter.version = Version(13, null, null);
expect(xcode.isInstalledAndMeetsVersionCheck, isTrue);
expect(fakeProcessManager.hasRemainingExpectations, isFalse);
......
......@@ -56,7 +56,7 @@ void main() {
final ValidationResult result = await validator.validate();
expect(result.type, ValidationType.partial);
expect(result.messages.last.type, ValidationMessageType.error);
expect(result.messages.last.message, contains('Flutter requires a minimum Xcode version of 12.3'));
expect(result.messages.last.message, contains('Flutter requires Xcode 13 or higher'));
});
testWithoutContext('Emits partial status when Xcode below recommended version', () async {
......@@ -70,7 +70,7 @@ void main() {
expect(result.type, ValidationType.partial);
expect(result.messages.last.type, ValidationMessageType.hint);
expect(result.messages.last.message, contains('Flutter recommends a minimum Xcode version of 13'));
});
}, skip: true); // [intended] Unskip and update when minimum and required check versions diverge.
testWithoutContext('Emits partial status when Xcode EULA not signed', () async {
final ProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
......
......@@ -294,10 +294,10 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
bool get isInstalled => true;
@override
String get versionText => 'Xcode 12.3';
String get versionText => 'Xcode 13';
@override
Version get version => Version(12, 3, null);
Version get version => Version(13, null, null);
@override
Future<Map<String, String>> getBuildSettings(
......
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