Correct capitalisation of Xcode (#7796)
Ref: https://developer.apple.com/xcode/
This commit is contained in:
@@ -115,7 +115,7 @@ Future<Null> main(List<String> args) async {
|
||||
context.putIfAbsent(ToolConfiguration, () => new ToolConfiguration());
|
||||
context.putIfAbsent(Config, () => new Config());
|
||||
context.putIfAbsent(OperatingSystemUtils, () => new OperatingSystemUtils());
|
||||
context.putIfAbsent(XCode, () => new XCode());
|
||||
context.putIfAbsent(Xcode, () => new Xcode());
|
||||
context.putIfAbsent(IOSSimulatorUtils, () => new IOSSimulatorUtils());
|
||||
context.putIfAbsent(SimControl, () => new SimControl());
|
||||
context.putIfAbsent(Usage, () => new Usage());
|
||||
|
||||
@@ -156,7 +156,7 @@ class RunCommand extends RunCommandBase {
|
||||
void printNoConnectedDevices() {
|
||||
super.printNoConnectedDevices();
|
||||
if (getCurrentHostPlatform() == HostPlatform.darwin_x64 &&
|
||||
XCode.instance.isInstalledAndMeetsVersionCheck) {
|
||||
Xcode.instance.isInstalledAndMeetsVersionCheck) {
|
||||
printStatus('');
|
||||
printStatus('To run on a simulator, launch it first: open -a Simulator.app');
|
||||
printStatus('');
|
||||
|
||||
@@ -299,7 +299,7 @@ class IOSDevice extends Device {
|
||||
|
||||
if (installationResult != 0) {
|
||||
printError('Could not install ${bundle.path} on $id.');
|
||||
printError('Try launching XCode and selecting "Product > Run" to fix the problem:');
|
||||
printError('Try launching Xcode and selecting "Product > Run" to fix the problem:');
|
||||
printError(' open ios/Runner.xcodeproj');
|
||||
printError('');
|
||||
return new LaunchResult.failed();
|
||||
|
||||
@@ -13,7 +13,7 @@ import '../base/process.dart';
|
||||
import '../doctor.dart';
|
||||
import 'mac.dart';
|
||||
|
||||
XCode get xcode => XCode.instance;
|
||||
Xcode get xcode => Xcode.instance;
|
||||
|
||||
class IOSWorkflow extends DoctorValidator implements Workflow {
|
||||
IOSWorkflow() : super('iOS toolchain - develop for iOS devices');
|
||||
@@ -61,7 +61,7 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
|
||||
if (xcode.isInstalled) {
|
||||
xcodeStatus = ValidationType.installed;
|
||||
|
||||
messages.add(new ValidationMessage('XCode at ${xcode.xcodeSelectPath}'));
|
||||
messages.add(new ValidationMessage('Xcode at ${xcode.xcodeSelectPath}'));
|
||||
|
||||
xcodeVersionInfo = xcode.xcodeVersionText;
|
||||
if (xcodeVersionInfo.contains(','))
|
||||
@@ -71,7 +71,7 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
|
||||
if (!xcode.isInstalledAndMeetsVersionCheck) {
|
||||
xcodeStatus = ValidationType.partial;
|
||||
messages.add(new ValidationMessage.error(
|
||||
'Flutter requires a minimum XCode version of $kXcodeRequiredVersionMajor.$kXcodeRequiredVersionMinor.0.\n'
|
||||
'Flutter requires a minimum Xcode version of $kXcodeRequiredVersionMajor.$kXcodeRequiredVersionMinor.0.\n'
|
||||
'Download the latest version or update via the Mac App Store.'
|
||||
));
|
||||
}
|
||||
@@ -79,13 +79,13 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
|
||||
if (!xcode.eulaSigned) {
|
||||
xcodeStatus = ValidationType.partial;
|
||||
messages.add(new ValidationMessage.error(
|
||||
'XCode end user license agreement not signed; open XCode or run the command \'sudo xcodebuild -license\'.'
|
||||
'Xcode end user license agreement not signed; open Xcode or run the command \'sudo xcodebuild -license\'.'
|
||||
));
|
||||
}
|
||||
} else {
|
||||
xcodeStatus = ValidationType.missing;
|
||||
messages.add(new ValidationMessage.error(
|
||||
'XCode not installed; this is necessary for iOS development.\n'
|
||||
'Xcode not installed; this is necessary for iOS development.\n'
|
||||
'Download at https://developer.apple.com/xcode/download/.'
|
||||
));
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
|
||||
if (result.exitCode == 0 && result.stdout.isNotEmpty && !exitsHappy(<String>['ideviceName'])) {
|
||||
brewStatus = ValidationType.partial;
|
||||
messages.add(new ValidationMessage.error(
|
||||
'libimobiledevice is incompatible with the installed XCode version. To update, run:\n'
|
||||
'libimobiledevice is incompatible with the installed Xcode version. To update, run:\n'
|
||||
'brew uninstall libimobiledevice\n'
|
||||
'brew install --HEAD libimobiledevice'
|
||||
));
|
||||
|
||||
@@ -23,8 +23,8 @@ import 'xcodeproj.dart';
|
||||
const int kXcodeRequiredVersionMajor = 7;
|
||||
const int kXcodeRequiredVersionMinor = 0;
|
||||
|
||||
class XCode {
|
||||
XCode() {
|
||||
class Xcode {
|
||||
Xcode() {
|
||||
_eulaSigned = false;
|
||||
|
||||
try {
|
||||
@@ -58,8 +58,8 @@ class XCode {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns [XCode] active in the current app context.
|
||||
static XCode get instance => context[XCode];
|
||||
/// Returns [Xcode] active in the current app context.
|
||||
static Xcode get instance => context[Xcode];
|
||||
|
||||
bool get isInstalledAndMeetsVersionCheck => isInstalled && xcodeVersionSatisfactory;
|
||||
|
||||
@@ -202,7 +202,7 @@ void diagnoseXcodeBuildFailure(XcodeBuildResult result) {
|
||||
printError(' ${plistFile.absolute.path}');
|
||||
printError('');
|
||||
}
|
||||
printError("Try launching XCode and selecting 'Product > Build' to fix the problem:");
|
||||
printError("Try launching Xcode and selecting 'Product > Build' to fix the problem:");
|
||||
printError(" open ios/Runner.xcodeproj");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class IOSSimulatorUtils {
|
||||
static IOSSimulatorUtils get instance => context[IOSSimulatorUtils];
|
||||
|
||||
List<IOSSimulator> getAttachedDevices() {
|
||||
if (!XCode.instance.isInstalledAndMeetsVersionCheck)
|
||||
if (!Xcode.instance.isInstalledAndMeetsVersionCheck)
|
||||
return <IOSSimulator>[];
|
||||
|
||||
return SimControl.instance.getConnectedDevices().map((SimDevice device) {
|
||||
|
||||
@@ -36,7 +36,7 @@ void main() {
|
||||
appContext.setVariable(Logger, notifyingLogger);
|
||||
appContext.setVariable(Doctor, new Doctor());
|
||||
if (platform.isMacOS)
|
||||
appContext.setVariable(XCode, new XCode());
|
||||
appContext.setVariable(Xcode, new Xcode());
|
||||
appContext.setVariable(DeviceManager, new MockDeviceManager());
|
||||
});
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ void testUsingContext(String description, dynamic testMethod(), {
|
||||
when(os.isWindows).thenReturn(false);
|
||||
return os;
|
||||
});
|
||||
testContext.putIfAbsent(XCode, () => new XCode());
|
||||
testContext.putIfAbsent(Xcode, () => new Xcode());
|
||||
testContext.putIfAbsent(IOSSimulatorUtils, () {
|
||||
MockIOSSimulatorUtils mock = new MockIOSSimulatorUtils();
|
||||
when(mock.getAttachedDevices()).thenReturn(<IOSSimulator>[]);
|
||||
|
||||
@@ -13,9 +13,9 @@ import '../context.dart';
|
||||
|
||||
void main() {
|
||||
group('iOS Workflow validation', () {
|
||||
MockXCode xcode;
|
||||
MockXcode xcode;
|
||||
setUp(() {
|
||||
xcode = new MockXCode();
|
||||
xcode = new MockXcode();
|
||||
});
|
||||
|
||||
testUsingContext('Emit missing status when nothing is installed', () async {
|
||||
@@ -25,14 +25,14 @@ void main() {
|
||||
..hasIosDeploy = false;
|
||||
ValidationResult result = await workflow.validate();
|
||||
expect(result.type, ValidationType.missing);
|
||||
}, overrides: <Type, Generator>{ XCode: () => xcode });
|
||||
}, overrides: <Type, Generator>{ Xcode: () => xcode });
|
||||
|
||||
testUsingContext('Emits partial status when Xcode is not installed', () async {
|
||||
when(xcode.isInstalled).thenReturn(false);
|
||||
IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget();
|
||||
ValidationResult result = await workflow.validate();
|
||||
expect(result.type, ValidationType.partial);
|
||||
}, overrides: <Type, Generator>{ XCode: () => xcode });
|
||||
}, overrides: <Type, Generator>{ Xcode: () => xcode });
|
||||
|
||||
testUsingContext('Emits partial status when Xcode version too low', () async {
|
||||
when(xcode.isInstalled).thenReturn(true);
|
||||
@@ -43,7 +43,7 @@ void main() {
|
||||
IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget();
|
||||
ValidationResult result = await workflow.validate();
|
||||
expect(result.type, ValidationType.partial);
|
||||
}, overrides: <Type, Generator>{ XCode: () => xcode });
|
||||
}, overrides: <Type, Generator>{ Xcode: () => xcode });
|
||||
|
||||
testUsingContext('Emits partial status when Xcode EULA not signed', () async {
|
||||
when(xcode.isInstalled).thenReturn(true);
|
||||
@@ -54,7 +54,7 @@ void main() {
|
||||
IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget();
|
||||
ValidationResult result = await workflow.validate();
|
||||
expect(result.type, ValidationType.partial);
|
||||
}, overrides: <Type, Generator>{ XCode: () => xcode });
|
||||
}, overrides: <Type, Generator>{ Xcode: () => xcode });
|
||||
|
||||
testUsingContext('Emits partial status when homebrew not installed', () async {
|
||||
when(xcode.isInstalled).thenReturn(true);
|
||||
@@ -66,7 +66,7 @@ void main() {
|
||||
..hasHomebrew = false;
|
||||
ValidationResult result = await workflow.validate();
|
||||
expect(result.type, ValidationType.partial);
|
||||
}, overrides: <Type, Generator>{ XCode: () => xcode });
|
||||
}, overrides: <Type, Generator>{ Xcode: () => xcode });
|
||||
|
||||
testUsingContext('Emits partial status when ios-deploy is not installed', () async {
|
||||
when(xcode.isInstalled).thenReturn(true);
|
||||
@@ -78,7 +78,7 @@ void main() {
|
||||
..hasIosDeploy = false;
|
||||
ValidationResult result = await workflow.validate();
|
||||
expect(result.type, ValidationType.partial);
|
||||
}, overrides: <Type, Generator>{ XCode: () => xcode });
|
||||
}, overrides: <Type, Generator>{ Xcode: () => xcode });
|
||||
|
||||
testUsingContext('Emits partial status when ios-deploy version is too low', () async {
|
||||
when(xcode.isInstalled).thenReturn(true);
|
||||
@@ -90,7 +90,7 @@ void main() {
|
||||
..iosDeployVersionText = '1.8.0';
|
||||
ValidationResult result = await workflow.validate();
|
||||
expect(result.type, ValidationType.partial);
|
||||
}, overrides: <Type, Generator>{ XCode: () => xcode });
|
||||
}, overrides: <Type, Generator>{ Xcode: () => xcode });
|
||||
|
||||
testUsingContext('Succeeds when all checks pass', () async {
|
||||
when(xcode.isInstalled).thenReturn(true);
|
||||
@@ -100,11 +100,11 @@ void main() {
|
||||
when(xcode.eulaSigned).thenReturn(true);
|
||||
ValidationResult result = await new IOSWorkflowTestTarget().validate();
|
||||
expect(result.type, ValidationType.installed);
|
||||
}, overrides: <Type, Generator>{ XCode: () => xcode });
|
||||
}, overrides: <Type, Generator>{ Xcode: () => xcode });
|
||||
});
|
||||
}
|
||||
|
||||
class MockXCode extends Mock implements XCode {}
|
||||
class MockXcode extends Mock implements Xcode {}
|
||||
|
||||
class IOSWorkflowTestTarget extends IOSWorkflow {
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user