Update minimum version to Xcode 11.0 (#50371)
This commit is contained in:
@@ -19,8 +19,8 @@ import '../ios/devices.dart';
|
||||
import '../ios/xcodeproj.dart';
|
||||
import '../reporting/reporting.dart';
|
||||
|
||||
const int kXcodeRequiredVersionMajor = 10;
|
||||
const int kXcodeRequiredVersionMinor = 2;
|
||||
const int kXcodeRequiredVersionMajor = 11;
|
||||
const int kXcodeRequiredVersionMinor = 0;
|
||||
|
||||
enum SdkType {
|
||||
iPhone,
|
||||
|
||||
@@ -90,9 +90,9 @@ void main() {
|
||||
|
||||
testWithoutContext('xcodebuild majorVersion returns major version', () {
|
||||
when(processManager.runSync(<String>[xcodebuild, '-version']))
|
||||
.thenReturn(ProcessResult(1, 0, 'Xcode 10.3.3\nBuild version 8E3004b', ''));
|
||||
.thenReturn(ProcessResult(1, 0, 'Xcode 11.4.1\nBuild version 11N111s', ''));
|
||||
|
||||
expect(xcodeProjectInterpreter.majorVersion, 10);
|
||||
expect(xcodeProjectInterpreter.majorVersion, 11);
|
||||
});
|
||||
|
||||
testWithoutContext('xcodebuild majorVersion is null when version has unexpected format', () {
|
||||
@@ -102,7 +102,7 @@ void main() {
|
||||
expect(xcodeProjectInterpreter.majorVersion, isNull);
|
||||
});
|
||||
|
||||
testWithoutContext('xcodebuild inorVersion returns minor version', () {
|
||||
testWithoutContext('xcodebuild minorVersion returns minor version', () {
|
||||
when(processManager.runSync(<String>[xcodebuild, '-version']))
|
||||
.thenReturn(ProcessResult(1, 0, 'Xcode 8.3.3\nBuild version 8E3004b', ''));
|
||||
|
||||
|
||||
@@ -83,23 +83,23 @@ void main() {
|
||||
|
||||
testWithoutContext('xcodeVersionSatisfactory is true when version meets minimum', () {
|
||||
when(mockXcodeProjectInterpreter.isInstalled).thenReturn(true);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(10);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(2);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(11);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(0);
|
||||
|
||||
expect(xcode.isVersionSatisfactory, isTrue);
|
||||
});
|
||||
|
||||
testWithoutContext('xcodeVersionSatisfactory is true when major version exceeds minimum', () {
|
||||
when(mockXcodeProjectInterpreter.isInstalled).thenReturn(true);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(11);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(2);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(12);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(0);
|
||||
|
||||
expect(xcode.isVersionSatisfactory, isTrue);
|
||||
});
|
||||
|
||||
testWithoutContext('xcodeVersionSatisfactory is true when minor version exceeds minimum', () {
|
||||
when(mockXcodeProjectInterpreter.isInstalled).thenReturn(true);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(10);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(11);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(3);
|
||||
|
||||
expect(xcode.isVersionSatisfactory, isTrue);
|
||||
@@ -126,8 +126,8 @@ void main() {
|
||||
when(processManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']))
|
||||
.thenReturn(ProcessResult(1, 127, '', 'ERROR'));
|
||||
when(mockXcodeProjectInterpreter.isInstalled).thenReturn(true);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(10);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(2);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(11);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(0);
|
||||
|
||||
expect(xcode.isInstalledAndMeetsVersionCheck, isFalse);
|
||||
});
|
||||
@@ -138,8 +138,8 @@ void main() {
|
||||
when(processManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']))
|
||||
.thenReturn(ProcessResult(1, 0, xcodePath, ''));
|
||||
when(mockXcodeProjectInterpreter.isInstalled).thenReturn(true);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(9);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(0);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(10);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(2);
|
||||
|
||||
expect(xcode.isInstalledAndMeetsVersionCheck, isFalse);
|
||||
});
|
||||
@@ -150,8 +150,8 @@ void main() {
|
||||
when(processManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']))
|
||||
.thenReturn(ProcessResult(1, 0, xcodePath, ''));
|
||||
when(mockXcodeProjectInterpreter.isInstalled).thenReturn(true);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(10);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(2);
|
||||
when(mockXcodeProjectInterpreter.majorVersion).thenReturn(11);
|
||||
when(mockXcodeProjectInterpreter.minorVersion).thenReturn(0);
|
||||
|
||||
expect(xcode.isInstalledAndMeetsVersionCheck, isTrue);
|
||||
});
|
||||
|
||||
@@ -366,13 +366,13 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
|
||||
bool get isInstalled => true;
|
||||
|
||||
@override
|
||||
String get versionText => 'Xcode 10.2';
|
||||
String get versionText => 'Xcode 11.0';
|
||||
|
||||
@override
|
||||
int get majorVersion => 10;
|
||||
int get majorVersion => 11;
|
||||
|
||||
@override
|
||||
int get minorVersion => 2;
|
||||
int get minorVersion => 0;
|
||||
|
||||
@override
|
||||
Future<Map<String, String>> getBuildSettings(
|
||||
|
||||
Reference in New Issue
Block a user