Skip to content

Commit

Permalink
Increase Xcode minimum version to 14 (#125639)
Browse files Browse the repository at this point in the history
Looks like CocoaPods 1.12.1 is incompatible with < Xcode 14 due to CocoaPods/CocoaPods#11828 (see flutter/flutter#123890 for context).

Bump the minimum Xcode version allowed by tooling to 14, released September 2022.

```
[!] Xcode - develop for iOS and macOS (Xcode 13.4)
    � Flutter requires Xcode 14 or higher.
      Download the latest version or update via the Mac App Store.
```

Fixes flutter/flutter#125286.
Previous bump at #97746.
  • Loading branch information
jmagman authored Apr 27, 2023
1 parent eba2a52 commit 6b73885
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/macos/xcode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import '../base/version.dart';
import '../build_info.dart';
import '../ios/xcodeproj.dart';

Version get xcodeRequiredVersion => Version(13, null, null);
Version get xcodeRequiredVersion => Version(14, null, null);

/// Diverging this number from the minimum required version will provide a doctor
/// warning, not error, that users should upgrade Xcode.
Expand Down
10 changes: 5 additions & 5 deletions packages/flutter_tools/test/general.shard/macos/xcode_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,31 +155,31 @@ void main() {

testWithoutContext('version checks pass when version meets minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(13, null, null);
xcodeProjectInterpreter.version = Version(14, null, null);

expect(xcode.isRequiredVersionSatisfactory, isTrue);
expect(xcode.isRecommendedVersionSatisfactory, isTrue);
});

testWithoutContext('version checks pass when major version exceeds minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(14, 0, 0);
xcodeProjectInterpreter.version = Version(15, 0, 0);

expect(xcode.isRequiredVersionSatisfactory, isTrue);
expect(xcode.isRecommendedVersionSatisfactory, isTrue);
});

testWithoutContext('version checks pass when minor version exceeds minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(13, 3, 0);
xcodeProjectInterpreter.version = Version(14, 3, 0);

expect(xcode.isRequiredVersionSatisfactory, isTrue);
expect(xcode.isRecommendedVersionSatisfactory, isTrue);
});

testWithoutContext('version checks pass when patch version exceeds minimum', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(13, 0, 2);
xcodeProjectInterpreter.version = Version(14, 0, 2);

expect(xcode.isRequiredVersionSatisfactory, isTrue);
expect(xcode.isRecommendedVersionSatisfactory, isTrue);
Expand All @@ -202,7 +202,7 @@ void main() {

testWithoutContext('isInstalledAndMeetsVersionCheck is true when macOS and installed and version is satisfied', () {
xcodeProjectInterpreter.isInstalled = true;
xcodeProjectInterpreter.version = Version(13, null, null);
xcodeProjectInterpreter.version = Version(14, null, null);

expect(xcode.isInstalledAndMeetsVersionCheck, isTrue);
expect(fakeProcessManager, hasNoRemainingExpectations);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 Xcode 13 or higher'));
expect(result.messages.last.message, contains('Flutter requires Xcode 14 or higher'));
});

testWithoutContext('Emits partial status when Xcode below recommended version', () async {
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_tools/test/src/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
bool get isInstalled => true;

@override
String get versionText => 'Xcode 13';
String get versionText => 'Xcode 14';

@override
Version get version => Version(13, null, null);
Version get version => Version(14, null, null);

@override
String get build => '13C100';
String get build => '14A309';

@override
Future<Map<String, String>> getBuildSettings(
Expand Down

0 comments on commit 6b73885

Please sign in to comment.