From 5d2a460fdd3e1cadaead8708de959b5326e5be57 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 1 Feb 2017 16:16:33 -0800 Subject: [PATCH] Correct capitalisation of Xcode (#7796) Ref: https://developer.apple.com/xcode/ --- packages/flutter_tools/lib/executable.dart | 2 +- .../flutter_tools/lib/src/commands/run.dart | 2 +- .../flutter_tools/lib/src/ios/devices.dart | 2 +- .../lib/src/ios/ios_workflow.dart | 12 +++++----- packages/flutter_tools/lib/src/ios/mac.dart | 10 ++++----- .../flutter_tools/lib/src/ios/simulators.dart | 2 +- packages/flutter_tools/test/daemon_test.dart | 2 +- packages/flutter_tools/test/src/context.dart | 2 +- .../test/src/ios/ios_workflow_test.dart | 22 +++++++++---------- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/flutter_tools/lib/executable.dart b/packages/flutter_tools/lib/executable.dart index d23b6d5705..f0f4142eb5 100644 --- a/packages/flutter_tools/lib/executable.dart +++ b/packages/flutter_tools/lib/executable.dart @@ -115,7 +115,7 @@ Future main(List 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()); diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart index f0ce0c98a0..38385b3027 100644 --- a/packages/flutter_tools/lib/src/commands/run.dart +++ b/packages/flutter_tools/lib/src/commands/run.dart @@ -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(''); diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index fd7e705564..f145a5ade1 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -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(); diff --git a/packages/flutter_tools/lib/src/ios/ios_workflow.dart b/packages/flutter_tools/lib/src/ios/ios_workflow.dart index 213f5051aa..bd55ead525 100644 --- a/packages/flutter_tools/lib/src/ios/ios_workflow.dart +++ b/packages/flutter_tools/lib/src/ios/ios_workflow.dart @@ -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(['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' )); diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index 13114c0163..95231da20a 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -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; } diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index 5dffffaf24..4b0ec37829 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -43,7 +43,7 @@ class IOSSimulatorUtils { static IOSSimulatorUtils get instance => context[IOSSimulatorUtils]; List getAttachedDevices() { - if (!XCode.instance.isInstalledAndMeetsVersionCheck) + if (!Xcode.instance.isInstalledAndMeetsVersionCheck) return []; return SimControl.instance.getConnectedDevices().map((SimDevice device) { diff --git a/packages/flutter_tools/test/daemon_test.dart b/packages/flutter_tools/test/daemon_test.dart index 28a7ff8ed5..4e0a4ef8f6 100644 --- a/packages/flutter_tools/test/daemon_test.dart +++ b/packages/flutter_tools/test/daemon_test.dart @@ -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()); }); diff --git a/packages/flutter_tools/test/src/context.dart b/packages/flutter_tools/test/src/context.dart index 02f1d99712..e694029689 100644 --- a/packages/flutter_tools/test/src/context.dart +++ b/packages/flutter_tools/test/src/context.dart @@ -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([]); diff --git a/packages/flutter_tools/test/src/ios/ios_workflow_test.dart b/packages/flutter_tools/test/src/ios/ios_workflow_test.dart index 1c077a6eb2..0a6921fe86 100644 --- a/packages/flutter_tools/test/src/ios/ios_workflow_test.dart +++ b/packages/flutter_tools/test/src/ios/ios_workflow_test.dart @@ -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: { XCode: () => xcode }); + }, overrides: { 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: { XCode: () => xcode }); + }, overrides: { 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: { XCode: () => xcode }); + }, overrides: { 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: { XCode: () => xcode }); + }, overrides: { 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: { XCode: () => xcode }); + }, overrides: { 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: { XCode: () => xcode }); + }, overrides: { 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: { XCode: () => xcode }); + }, overrides: { 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: { XCode: () => xcode }); + }, overrides: { Xcode: () => xcode }); }); } -class MockXCode extends Mock implements XCode {} +class MockXcode extends Mock implements Xcode {} class IOSWorkflowTestTarget extends IOSWorkflow { @override