Unverified Commit ef792fc3 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Disable CocoaPods input and output paths in Xcode build phase and adopt new...

Disable CocoaPods input and output paths in Xcode build phase and adopt new Xcode build system (#33684)

Updates the Podfile template to use the CocoaPod disable_input_output_paths installation option which prevents the [CP] Embed Pods Frameworks build phase from outputting the Flutter.framework files.
parent 572f349f
...@@ -178,6 +178,8 @@ task: ...@@ -178,6 +178,8 @@ task:
# with the actual time - this should help to verify # with the actual time - this should help to verify
print_date_script: print_date_script:
- date - date
install_cocoapods_script:
- sudo gem install cocoapods
git_fetch_script: git_fetch_script:
- git clean -xfd - git clean -xfd
- git fetch origin - git fetch origin
......
...@@ -60,6 +60,9 @@ target 'Runner' do ...@@ -60,6 +60,9 @@ target 'Runner' do
} }
end end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
target.build_configurations.each do |config| target.build_configurations.each do |config|
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
platform :ios, '12.0' platform :ios, '12.0'
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
flutter_application_path = 'flutterapp/' flutter_application_path = 'flutterapp/'
framework_dir = File.join(flutter_application_path, '.ios', 'Flutter') framework_dir = File.join(flutter_application_path, '.ios', 'Flutter')
......
...@@ -328,14 +328,11 @@ ...@@ -328,14 +328,11 @@
inputFileListPaths = ( inputFileListPaths = (
); );
inputPaths = ( inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-ios_add2app/Pods-ios_add2app-frameworks.sh",
"${PODS_ROOT}/../flutterapp/.ios/Flutter/engine/Flutter.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputFileListPaths = ( outputFileListPaths = (
); );
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
......
...@@ -206,12 +206,9 @@ ...@@ -206,12 +206,9 @@
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Host/Pods-Host-frameworks.sh",
"${PODS_ROOT}/../../hello/.ios/Flutter/engine/Flutter.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
......
platform :ios, '9.0' platform :ios, '9.0'
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
target 'Host' do target 'Host' do
flutter_application_path = '../hello' flutter_application_path = '../hello'
eval(File.read("#{flutter_application_path}/.ios/Flutter/podhelper.rb")) eval(File.read("#{flutter_application_path}/.ios/Flutter/podhelper.rb"))
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
...@@ -37,6 +37,9 @@ target 'Runner' do ...@@ -37,6 +37,9 @@ target 'Runner' do
} }
end end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
target.build_configurations.each do |config| target.build_configurations.each do |config|
......
...@@ -267,12 +267,9 @@ ...@@ -267,12 +267,9 @@
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../../../../bin/cache/artifacts/engine/ios/Flutter.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '9.0' # platform :ios, '9.0'
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
target 'Runner' do target 'Runner' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks # Uncomment this line if you're using Swift or would like to use dynamic frameworks
use_frameworks! use_frameworks!
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
...@@ -56,6 +56,9 @@ target 'Runner' do ...@@ -56,6 +56,9 @@ target 'Runner' do
pod 'MaterialControls' pod 'MaterialControls'
end end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
target.build_configurations.each do |config| target.build_configurations.each do |config|
......
...@@ -230,12 +230,9 @@ ...@@ -230,12 +230,9 @@
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
...@@ -92,7 +92,6 @@ Future<T> runInContext<T>( ...@@ -92,7 +92,6 @@ Future<T> runInContext<T>(
Logger: () => platform.isWindows ? WindowsStdoutLogger() : StdoutLogger(), Logger: () => platform.isWindows ? WindowsStdoutLogger() : StdoutLogger(),
MacOSWorkflow: () => const MacOSWorkflow(), MacOSWorkflow: () => const MacOSWorkflow(),
OperatingSystemUtils: () => OperatingSystemUtils(), OperatingSystemUtils: () => OperatingSystemUtils(),
PlistBuddy: () => const PlistBuddy(),
SimControl: () => SimControl(), SimControl: () => SimControl(),
Stdio: () => const Stdio(), Stdio: () => const Stdio(),
SystemClock: () => const SystemClock(), SystemClock: () => const SystemClock(),
......
...@@ -28,55 +28,6 @@ import 'code_signing.dart'; ...@@ -28,55 +28,6 @@ import 'code_signing.dart';
import 'xcodeproj.dart'; import 'xcodeproj.dart';
IMobileDevice get iMobileDevice => context.get<IMobileDevice>(); IMobileDevice get iMobileDevice => context.get<IMobileDevice>();
PlistBuddy get plistBuddy => context.get<PlistBuddy>();
class PlistBuddy {
const PlistBuddy();
static const String path = '/usr/libexec/PlistBuddy';
Future<ProcessResult> run(List<String> args) => processManager.run(<String>[path]..addAll(args));
}
/// A property list is a key-value representation commonly used for
/// configuration on macOS/iOS systems.
class PropertyList {
const PropertyList(this.plistPath);
final String plistPath;
/// Prints the specified key, or returns null if not present.
Future<String> read(String key) async {
final ProcessResult result = await _runCommand('Print $key');
if (result.exitCode == 0)
return result.stdout.trim();
return null;
}
/// Adds [key]. Has no effect if the key already exists.
Future<void> addString(String key, String value) async {
await _runCommand('Add $key string $value');
}
/// Updates [key] with the new [value]. Has no effect if the key does not exist.
Future<void> update(String key, String value) async {
await _runCommand('Set $key $value');
}
/// Deletes [key].
Future<void> delete(String key) async {
await _runCommand('Delete $key');
}
/// Deletes the content of the property list and creates a new root of the specified type.
Future<void> clearToDict() async {
await _runCommand('Clear dict');
}
Future<ProcessResult> _runCommand(String command) async {
return await plistBuddy.run(<String>['-c', command, plistPath]);
}
}
/// Specialized exception for expected situations where the ideviceinfo /// Specialized exception for expected situations where the ideviceinfo
/// tool responds with exit code 255 / 'No device found' message /// tool responds with exit code 255 / 'No device found' message
...@@ -149,47 +100,6 @@ class IMobileDevice { ...@@ -149,47 +100,6 @@ class IMobileDevice {
} }
} }
/// Sets the Xcode system.
///
/// Xcode 10 added a new (default) build system with better performance and
/// stricter checks. Flutter apps without plugins build fine under the new
/// system, but it causes build breakages in projects with CocoaPods enabled.
/// This affects Flutter apps with plugins.
///
/// Once Flutter has been updated to be fully compliant with the new build
/// system, this can be removed.
//
// TODO(cbracken): remove when https://github.com/flutter/flutter/issues/20685 is fixed.
Future<void> setXcodeWorkspaceBuildSystem({
@required Directory workspaceDirectory,
@required File workspaceSettings,
@required bool modern,
}) async {
// If this isn't a workspace, we're not using CocoaPods and can use the new
// build system.
if (!workspaceDirectory.existsSync())
return;
final PropertyList plist = PropertyList(workspaceSettings.path);
if (!workspaceSettings.existsSync()) {
workspaceSettings.parent.createSync(recursive: true);
await plist.clearToDict();
}
const String kBuildSystemType = 'BuildSystemType';
if (modern) {
printTrace('Using new Xcode build system.');
await plist.delete(kBuildSystemType);
} else {
printTrace('Using legacy Xcode build system.');
if (await plist.read(kBuildSystemType) == null) {
await plist.addString(kBuildSystemType, 'Original');
} else {
await plist.update(kBuildSystemType, 'Original');
}
}
}
Future<XcodeBuildResult> buildXcodeProject({ Future<XcodeBuildResult> buildXcodeProject({
BuildableIOSApp app, BuildableIOSApp app,
BuildInfo buildInfo, BuildInfo buildInfo,
...@@ -205,12 +115,6 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -205,12 +115,6 @@ Future<XcodeBuildResult> buildXcodeProject({
if (!_checkXcodeVersion()) if (!_checkXcodeVersion())
return XcodeBuildResult(success: false); return XcodeBuildResult(success: false);
// TODO(cbracken): remove when https://github.com/flutter/flutter/issues/20685 is fixed.
await setXcodeWorkspaceBuildSystem(
workspaceDirectory: app.project.xcodeWorkspace,
workspaceSettings: app.project.xcodeWorkspaceSharedSettings,
modern: false,
);
final XcodeProjectInfo projectInfo = await xcodeProjectInterpreter.getInfo(app.project.hostAppRoot.path); final XcodeProjectInfo projectInfo = await xcodeProjectInterpreter.getInfo(app.project.hostAppRoot.path);
if (!projectInfo.targets.contains('Runner')) { if (!projectInfo.targets.contains('Runner')) {
......
...@@ -57,8 +57,8 @@ enum CocoaPodsStatus { ...@@ -57,8 +57,8 @@ enum CocoaPodsStatus {
class CocoaPods { class CocoaPods {
Future<String> _versionText; Future<String> _versionText;
String get cocoaPodsMinimumVersion => '1.0.0'; String get cocoaPodsMinimumVersion => '1.6.0';
String get cocoaPodsRecommendedVersion => '1.5.0'; String get cocoaPodsRecommendedVersion => '1.6.0';
Future<String> get cocoaPodsVersionText { Future<String> get cocoaPodsVersionText {
_versionText ??= runAsync(<String>['pod', '--version']).then<String>((RunResult result) { _versionText ??= runAsync(<String>['pod', '--version']).then<String>((RunResult result) {
......
...@@ -60,6 +60,9 @@ target 'Runner' do ...@@ -60,6 +60,9 @@ target 'Runner' do
} }
end end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
target.build_configurations.each do |config| target.build_configurations.each do |config|
......
...@@ -62,6 +62,9 @@ target 'Runner' do ...@@ -62,6 +62,9 @@ target 'Runner' do
} }
end end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
target.build_configurations.each do |config| target.build_configurations.each do |config|
......
...@@ -77,3 +77,6 @@ target 'Runner' do ...@@ -77,3 +77,6 @@ target 'Runner' do
end end
} }
end end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
...@@ -473,8 +473,8 @@ void main() { ...@@ -473,8 +473,8 @@ void main() {
await runner.run(<String>['create', '--template=module', '--no-pub', '--org', 'com.foo.bar', projectDir.path]); await runner.run(<String>['create', '--template=module', '--no-pub', '--org', 'com.foo.bar', projectDir.path]);
void expectExists(String relPath) { void expectExists(String relPath, [bool expectation = true]) {
expect(fs.isFileSync('${projectDir.path}/$relPath'), true); expect(fs.isFileSync('${projectDir.path}/$relPath'), expectation);
} }
expectExists('lib/main.dart'); expectExists('lib/main.dart');
...@@ -515,6 +515,9 @@ void main() { ...@@ -515,6 +515,9 @@ void main() {
final File xcodeProjectFile = fs.file(fs.path.join(projectDir.path, xcodeProjectPath)); final File xcodeProjectFile = fs.file(fs.path.join(projectDir.path, xcodeProjectPath));
final String xcodeProject = xcodeProjectFile.readAsStringSync(); final String xcodeProject = xcodeProjectFile.readAsStringSync();
expect(xcodeProject, contains('PRODUCT_BUNDLE_IDENTIFIER = com.foo.bar.flutterProject')); expect(xcodeProject, contains('PRODUCT_BUNDLE_IDENTIFIER = com.foo.bar.flutterProject'));
// Xcode build system
final String xcodeWorkspaceSettingsPath = fs.path.join('.ios', 'Runner.xcworkspace', 'xcshareddata', 'WorkspaceSettings.xcsettings');
expectExists(xcodeWorkspaceSettingsPath, false);
final String versionPath = fs.path.join('.metadata'); final String versionPath = fs.path.join('.metadata');
expectExists(versionPath); expectExists(versionPath);
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
import 'dart:async'; import 'dart:async';
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart' show ProcessException, ProcessResult; import 'package:flutter_tools/src/base/io.dart' show ProcessException, ProcessResult;
import 'package:flutter_tools/src/ios/mac.dart'; import 'package:flutter_tools/src/ios/mac.dart';
...@@ -29,73 +28,6 @@ class MockXcodeProjectInterpreter extends Mock implements XcodeProjectInterprete ...@@ -29,73 +28,6 @@ class MockXcodeProjectInterpreter extends Mock implements XcodeProjectInterprete
class MockIosProject extends Mock implements IosProject {} class MockIosProject extends Mock implements IosProject {}
void main() { void main() {
group('PropertyList', () {
MockProcessManager mockProcessManager;
MemoryFileSystem fs;
Directory workspaceDirectory;
File workspaceSettingsFile;
setUp(() {
mockProcessManager = MockProcessManager();
fs = MemoryFileSystem();
workspaceDirectory = fs.directory('Runner.xcworkspace');
workspaceSettingsFile = workspaceDirectory.childDirectory('xcshareddata').childFile('WorkspaceSettings.xcsettings');
});
testUsingContext('does nothing if workspace directory does not exist', () async {
await setXcodeWorkspaceBuildSystem(workspaceDirectory: workspaceDirectory, workspaceSettings: workspaceSettingsFile, modern: false);
verifyNever(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Print BuildSystemType', workspaceSettingsFile.path]));
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => mockProcessManager,
});
testUsingContext('creates dict-based plist if settings file does not exist', () async {
workspaceSettingsFile.parent.createSync(recursive: true);
when(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Print BuildSystemType', workspaceSettingsFile.path]))
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 1, '', '')));
await setXcodeWorkspaceBuildSystem(workspaceDirectory: workspaceDirectory, workspaceSettings: workspaceSettingsFile, modern: false);
verify(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Clear dict', workspaceSettingsFile.path]));
verify(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Add BuildSystemType string Original', workspaceSettingsFile.path]));
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => mockProcessManager,
});
testUsingContext('writes legacy build mode settings if requested and not present', () async {
workspaceSettingsFile.createSync(recursive: true);
when(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Print BuildSystemType', workspaceSettingsFile.path]))
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 1, '', '')));
await setXcodeWorkspaceBuildSystem(workspaceDirectory: workspaceDirectory, workspaceSettings: workspaceSettingsFile, modern: false);
verify(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Add BuildSystemType string Original', workspaceSettingsFile.path]));
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => mockProcessManager,
});
testUsingContext('updates legacy build mode setting if requested and existing setting is present', () async {
workspaceSettingsFile.createSync(recursive: true);
when(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Print BuildSystemType', workspaceSettingsFile.path]))
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, 'FancyNewOne', '')));
await setXcodeWorkspaceBuildSystem(workspaceDirectory: workspaceDirectory, workspaceSettings: workspaceSettingsFile, modern: false);
verify(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Set BuildSystemType Original', workspaceSettingsFile.path]));
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => mockProcessManager,
});
testUsingContext('deletes legacy build mode setting if modern build mode requested', () async {
workspaceSettingsFile.createSync(recursive: true);
when(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Print BuildSystemType', workspaceSettingsFile.path]))
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, 'Original', '')));
await setXcodeWorkspaceBuildSystem(workspaceDirectory: workspaceDirectory, workspaceSettings: workspaceSettingsFile, modern: true);
verify(mockProcessManager.run(<String>[PlistBuddy.path, '-c', 'Delete BuildSystemType', workspaceSettingsFile.path]));
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => mockProcessManager,
});
});
group('IMobileDevice', () { group('IMobileDevice', () {
final FakePlatform osx = FakePlatform.fromPlatform(const LocalPlatform()) final FakePlatform osx = FakePlatform.fromPlatform(const LocalPlatform())
..operatingSystem = 'macos'; ..operatingSystem = 'macos';
......
...@@ -60,7 +60,7 @@ void main() { ...@@ -60,7 +60,7 @@ void main() {
projectUnderTest = FlutterProject.fromDirectory(fs.directory('project')); projectUnderTest = FlutterProject.fromDirectory(fs.directory('project'));
projectUnderTest.ios.xcodeProject.createSync(recursive: true); projectUnderTest.ios.xcodeProject.createSync(recursive: true);
cocoaPodsUnderTest = CocoaPods(); cocoaPodsUnderTest = CocoaPods();
pretendPodVersionIs('1.5.0'); pretendPodVersionIs('1.6.0');
fs.file(fs.path.join( fs.file(fs.path.join(
Cache.flutterRoot, 'packages', 'flutter_tools', 'templates', 'cocoapods', 'Podfile-ios-objc', Cache.flutterRoot, 'packages', 'flutter_tools', 'templates', 'cocoapods', 'Podfile-ios-objc',
)) ))
...@@ -123,28 +123,21 @@ void main() { ...@@ -123,28 +123,21 @@ void main() {
}); });
testUsingContext('detects below minimum version', () async { testUsingContext('detects below minimum version', () async {
pretendPodVersionIs('0.39.8'); pretendPodVersionIs('1.5.0');
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.belowMinimumVersion); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.belowMinimumVersion);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager, ProcessManager: () => mockProcessManager,
}); });
testUsingContext('detects below recommended version', () async {
pretendPodVersionIs('1.4.99');
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.belowRecommendedVersion);
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
});
testUsingContext('detects at recommended version', () async { testUsingContext('detects at recommended version', () async {
pretendPodVersionIs('1.5.0'); pretendPodVersionIs('1.6.0');
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.recommended); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.recommended);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager, ProcessManager: () => mockProcessManager,
}); });
testUsingContext('detects above recommended version', () async { testUsingContext('detects above recommended version', () async {
pretendPodVersionIs('1.5.1'); pretendPodVersionIs('1.6.1');
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.recommended); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.recommended);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager, ProcessManager: () => mockProcessManager,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment