From cefcd249ac6bf66dec1635392fc1e9bfe7510dfa Mon Sep 17 00:00:00 2001 From: Jakob Andersen Date: Thu, 16 Mar 2017 11:19:07 +0100 Subject: [PATCH] Only run pod install if CocoaPods v1.0.0 or greater is installed. (#8790) * Only run pod install if CocoaPods v1.0.0 or greater is installed. Avoid issues with older versions of CocoaPods breaking the build. Users who genuinely use older versions of CocoaPods will have to run pod install manually when required. --- packages/flutter_tools/lib/src/ios/ios_workflow.dart | 4 ++-- packages/flutter_tools/lib/src/ios/mac.dart | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/flutter_tools/lib/src/ios/ios_workflow.dart b/packages/flutter_tools/lib/src/ios/ios_workflow.dart index 4e85d03f986..8156a73df30 100644 --- a/packages/flutter_tools/lib/src/ios/ios_workflow.dart +++ b/packages/flutter_tools/lib/src/ios/ios_workflow.dart @@ -60,7 +60,7 @@ class IOSWorkflow extends DoctorValidator implements Workflow { } } - bool get _cocoaPodsInstalledAndMeetsVersionCheck { + bool get cocoaPodsInstalledAndMeetsVersionCheck { if (!hasCocoaPods) return false; try { @@ -178,7 +178,7 @@ class IOSWorkflow extends DoctorValidator implements Workflow { )); } } - if (_cocoaPodsInstalledAndMeetsVersionCheck) { + if (cocoaPodsInstalledAndMeetsVersionCheck) { messages.add(new ValidationMessage('CocoaPods version $cocoaPodsVersionText')); } else { if (!hasCocoaPods) { diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index a8e05ea066d..e20e7938bd7 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -321,8 +321,9 @@ bool _checkXcodeVersion() { void _runPodInstall(Directory bundle, String engineDirectory) { if (fs.file(fs.path.join(bundle.path, 'Podfile')).existsSync()) { - if (!doctor.iosWorkflow.hasCocoaPods) { - printError('Warning: CocoaPods not installed. Not running pod install.'); + if (!doctor.iosWorkflow.cocoaPodsInstalledAndMeetsVersionCheck) { + final String minimumVersion = doctor.iosWorkflow.cocoaPodsMinimumVersion; + printError('Warning: CocoaPods version $minimumVersion or greater not installed. Skipping pod install.'); return; } try {