Update CocoaPods minimum version to 1.9 (#71170)

This commit is contained in:
Jenn Magder
2020-12-17 10:22:50 -08:00
committed by GitHub
parent 9f7e785c7b
commit 23f5fbc69d
5 changed files with 8 additions and 70 deletions

View File

@@ -160,12 +160,6 @@ class UserMessages {
// Messages used in CocoaPodsValidator
String cocoaPodsVersion(String version) => 'CocoaPods version $version';
String cocoaPodsUninitialized(String consequence) =>
'CocoaPods installed but not initialized.\n'
'$consequence\n'
'To initialize CocoaPods, run:\n'
' pod setup\n'
"once to finalize CocoaPods' installation.";
String cocoaPodsMissing(String consequence, String installInstructions) =>
'CocoaPods not installed.\n'
'$consequence\n'

View File

@@ -89,11 +89,9 @@ class CocoaPods {
_processManager = processManager,
_xcodeProjectInterpreter = xcodeProjectInterpreter,
_logger = logger,
_platform = platform,
_artifacts = artifacts,
_usage = usage,
_processUtils = ProcessUtils(processManager: processManager, logger: logger),
_fileSystemUtils = FileSystemUtils(fileSystem: fileSystem, platform: platform),
_operatingSystemUtils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: logger,
@@ -103,19 +101,17 @@ class CocoaPods {
final FileSystem _fileSystem;
final ProcessManager _processManager;
final FileSystemUtils _fileSystemUtils;
final ProcessUtils _processUtils;
final OperatingSystemUtils _operatingSystemUtils;
final XcodeProjectInterpreter _xcodeProjectInterpreter;
final Logger _logger;
final Platform _platform;
final Artifacts _artifacts;
final Usage _usage;
Future<String> _versionText;
String get cocoaPodsMinimumVersion => '1.6.0';
String get cocoaPodsRecommendedVersion => '1.9.0';
String get cocoaPodsMinimumVersion => '1.9.0';
String get cocoaPodsRecommendedVersion => '1.10.0';
Future<bool> get isInstalled =>
_processUtils.exitsHappy(<String>['which', 'pod']);
@@ -157,28 +153,6 @@ class CocoaPods {
}
}
/// Whether CocoaPods ran 'pod setup' once where the costly pods' specs are
/// cloned.
///
/// Versions >= 1.8.0 do not require 'pod setup' and default to a CDN instead
/// of a locally cloned repository.
/// See http://blog.cocoapods.org/CocoaPods-1.8.0-beta/
///
/// A user can override the default location via the CP_REPOS_DIR environment
/// variable.
///
/// See https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/config.rb#L138
/// for details of this variable.
Future<bool> get isCocoaPodsInitialized async {
final Version installedVersion = Version.parse(await cocoaPodsVersionText);
if (installedVersion != null && installedVersion >= Version.parse('1.8.0')) {
return true;
}
final String cocoapodsReposDir = _platform.environment['CP_REPOS_DIR']
?? _fileSystem.path.join(_fileSystemUtils.homeDirPath, '.cocoapods', 'repos');
return _fileSystem.isDirectory(_fileSystem.path.join(cocoapodsReposDir, 'master'));
}
Future<bool> processPods({
@required XcodeBasedProject xcodeProject,
@required BuildMode buildMode,
@@ -246,17 +220,6 @@ class CocoaPods {
case CocoaPodsStatus.recommended:
break;
}
if (!await isCocoaPodsInitialized) {
_logger.printError(
'Warning: CocoaPods installed but not initialized. Skipping pod install.\n'
'$noCocoaPodsConsequence\n'
'To initialize CocoaPods, run:\n'
' pod setup\n'
"once to finalize CocoaPods' installation.",
emphasis: true,
);
return false;
}
return true;
}

View File

@@ -30,12 +30,7 @@ class CocoaPodsValidator extends DoctorValidator {
ValidationType status = ValidationType.installed;
if (cocoaPodsStatus == CocoaPodsStatus.recommended) {
if (await _cocoaPods.isCocoaPodsInitialized) {
messages.add(ValidationMessage(_userMessages.cocoaPodsVersion(await _cocoaPods.cocoaPodsVersionText)));
} else {
status = ValidationType.partial;
messages.add(ValidationMessage.error(_userMessages.cocoaPodsUninitialized(noCocoaPodsConsequence)));
}
messages.add(ValidationMessage(_userMessages.cocoaPodsVersion(await _cocoaPods.cocoaPodsVersionText)));
} else {
if (cocoaPodsStatus == CocoaPodsStatus.notInstalled) {
status = ValidationType.missing;