From 9a61b8713c63e43cb2de463eec2d0e5a1cad2197 Mon Sep 17 00:00:00 2001 From: xster Date: Mon, 1 May 2017 12:47:25 -0700 Subject: [PATCH] CocoaPods flow step 1 (#9687) * Add cocoapods reason * s/native/iOS --- .../lib/src/ios/ios_workflow.dart | 16 ++++++------- packages/flutter_tools/lib/src/ios/mac.dart | 23 ++++++++++++++++++- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/packages/flutter_tools/lib/src/ios/ios_workflow.dart b/packages/flutter_tools/lib/src/ios/ios_workflow.dart index 70bb7027389..a9d0ce6dd47 100644 --- a/packages/flutter_tools/lib/src/ios/ios_workflow.dart +++ b/packages/flutter_tools/lib/src/ios/ios_workflow.dart @@ -181,17 +181,17 @@ class IOSWorkflow extends DoctorValidator implements Workflow { brewStatus = ValidationType.partial; if (!hasCocoaPods) { messages.add(new ValidationMessage.error( - 'CocoaPods not installed. To install:\n' - ' brew update\n' - ' brew install cocoapods\n' - ' pod setup' + 'CocoaPods not installed.\n' + '$noCocoaPodsConsequence\n' + 'To install:\n' + '$cocoaPodsInstallInstructions' )); } else { messages.add(new ValidationMessage.error( - 'CocoaPods out of date ($cocoaPodsMinimumVersion is required). To upgrade:\n' - ' brew update\n' - ' brew upgrade cocoapods\n' - ' pod setup' + 'CocoaPods out of date ($cocoaPodsMinimumVersion is required).\n' + '$noCocoaPodsConsequence\n' + 'To upgrade:\n' + '$cocoaPodsUpgradeInstructions' )); } } diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index cf675ac5a28..4774054ff86 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -347,11 +347,32 @@ bool _checkXcodeVersion() { return true; } +final String noCocoaPodsConsequence = ''' + CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your + plugin usage on the Dart side. + Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS. + For more info, see https://flutter.io/platform-plugins'''; + +final String cocoaPodsInstallInstructions = ''' + brew update + brew install cocoapods + pod setup'''; + +final String cocoaPodsUpgradeInstructions = ''' + brew update + brew upgrade cocoapods + pod setup'''; + Future _runPodInstall(Directory bundle, String engineDirectory) async { if (fs.file(fs.path.join(bundle.path, 'Podfile')).existsSync()) { if (!doctor.iosWorkflow.cocoaPodsInstalledAndMeetsVersionCheck) { final String minimumVersion = doctor.iosWorkflow.cocoaPodsMinimumVersion; - printError('Warning: CocoaPods version $minimumVersion or greater not installed. Skipping pod install.'); + printError( + 'Warning: CocoaPods version $minimumVersion or greater not installed. Skipping pod install.\n' + '$noCocoaPodsConsequence\n' + 'To install:\n' + '$cocoaPodsInstallInstructions\n' + ); return; } try {