Recommend using Cocoapods 1.5.0 (#17308)
This commit is contained in:
parent
372ac6d5d4
commit
61c7171872
@ -52,7 +52,7 @@ Future<T> runInContext<T>(
|
|||||||
BotDetector: () => const BotDetector(),
|
BotDetector: () => const BotDetector(),
|
||||||
Cache: () => new Cache(),
|
Cache: () => new Cache(),
|
||||||
Clock: () => const Clock(),
|
Clock: () => const Clock(),
|
||||||
CocoaPods: () => const CocoaPods(),
|
CocoaPods: () => new CocoaPods(),
|
||||||
Config: () => new Config(),
|
Config: () => new Config(),
|
||||||
DevFSConfig: () => new DevFSConfig(),
|
DevFSConfig: () => new DevFSConfig(),
|
||||||
DeviceManager: () => new DeviceManager(),
|
DeviceManager: () => new DeviceManager(),
|
||||||
|
@ -33,25 +33,46 @@ const String cocoaPodsUpgradeInstructions = '''
|
|||||||
|
|
||||||
CocoaPods get cocoaPods => context[CocoaPods];
|
CocoaPods get cocoaPods => context[CocoaPods];
|
||||||
|
|
||||||
|
/// Result of evaluating the CocoaPods installation.
|
||||||
|
enum CocoaPodsStatus {
|
||||||
|
/// iOS plugins will not work, installation required.
|
||||||
|
notInstalled,
|
||||||
|
/// iOS plugins will not work, upgrade required.
|
||||||
|
belowMinimumVersion,
|
||||||
|
/// iOS plugins may not work in certain situations (Swift, static libraries),
|
||||||
|
/// upgrade recommended.
|
||||||
|
belowRecommendedVersion,
|
||||||
|
/// Everything should be fine.
|
||||||
|
recommended,
|
||||||
|
}
|
||||||
|
|
||||||
class CocoaPods {
|
class CocoaPods {
|
||||||
const CocoaPods();
|
Future<String> _versionText;
|
||||||
|
|
||||||
Future<bool> get hasCocoaPods => exitsHappyAsync(<String>['pod', '--version']);
|
|
||||||
|
|
||||||
// TODO(mravn): Insist on 1.5.0 once build bots have that installed.
|
|
||||||
// Earlier versions do not work with Swift and static libraries.
|
|
||||||
String get cocoaPodsMinimumVersion => '1.0.0';
|
String get cocoaPodsMinimumVersion => '1.0.0';
|
||||||
|
String get cocoaPodsRecommendedVersion => '1.5.0';
|
||||||
|
|
||||||
Future<String> get cocoaPodsVersionText async => (await runAsync(<String>['pod', '--version'])).processResult.stdout.trim();
|
Future<String> get cocoaPodsVersionText {
|
||||||
|
_versionText ??= runAsync(<String>['pod', '--version']).then<String>((RunResult result) {
|
||||||
|
return result.exitCode == 0 ? result.stdout.trim() : null;
|
||||||
|
}, onError: (dynamic _) => null);
|
||||||
|
return _versionText;
|
||||||
|
}
|
||||||
|
|
||||||
Future<bool> get isCocoaPodsInstalledAndMeetsVersionCheck async {
|
Future<CocoaPodsStatus> get evaluateCocoaPodsInstallation async {
|
||||||
if (!await hasCocoaPods)
|
final String versionText = await cocoaPodsVersionText;
|
||||||
return false;
|
if (versionText == null)
|
||||||
|
return CocoaPodsStatus.notInstalled;
|
||||||
try {
|
try {
|
||||||
final Version installedVersion = new Version.parse(await cocoaPodsVersionText);
|
final Version installedVersion = new Version.parse(versionText);
|
||||||
return installedVersion >= new Version.parse(cocoaPodsMinimumVersion);
|
if (installedVersion < new Version.parse(cocoaPodsMinimumVersion))
|
||||||
|
return CocoaPodsStatus.belowMinimumVersion;
|
||||||
|
else if (installedVersion < new Version.parse(cocoaPodsRecommendedVersion))
|
||||||
|
return CocoaPodsStatus.belowRecommendedVersion;
|
||||||
|
else
|
||||||
|
return CocoaPodsStatus.recommended;
|
||||||
} on FormatException {
|
} on FormatException {
|
||||||
return false;
|
return CocoaPodsStatus.notInstalled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,16 +100,37 @@ class CocoaPods {
|
|||||||
|
|
||||||
/// Make sure the CocoaPods tools are in the right states.
|
/// Make sure the CocoaPods tools are in the right states.
|
||||||
Future<bool> _checkPodCondition() async {
|
Future<bool> _checkPodCondition() async {
|
||||||
if (!await isCocoaPodsInstalledAndMeetsVersionCheck) {
|
final CocoaPodsStatus installation = await evaluateCocoaPodsInstallation;
|
||||||
final String minimumVersion = cocoaPodsMinimumVersion;
|
switch (installation) {
|
||||||
|
case CocoaPodsStatus.notInstalled:
|
||||||
printError(
|
printError(
|
||||||
'Warning: CocoaPods version $minimumVersion or greater not installed. Skipping pod install.\n'
|
'Warning: CocoaPods not installed. Skipping pod install.\n'
|
||||||
'$noCocoaPodsConsequence\n'
|
'$noCocoaPodsConsequence\n'
|
||||||
'To install:\n'
|
'To install:\n'
|
||||||
'$cocoaPodsInstallInstructions\n',
|
'$cocoaPodsInstallInstructions\n',
|
||||||
emphasis: true,
|
emphasis: true,
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
|
case CocoaPodsStatus.belowMinimumVersion:
|
||||||
|
printError(
|
||||||
|
'Warning: CocoaPods minimum required version $cocoaPodsMinimumVersion or greater not installed. Skipping pod install.\n'
|
||||||
|
'$noCocoaPodsConsequence\n'
|
||||||
|
'To upgrade:\n'
|
||||||
|
'$cocoaPodsUpgradeInstructions\n',
|
||||||
|
emphasis: true,
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
case CocoaPodsStatus.belowRecommendedVersion:
|
||||||
|
printError(
|
||||||
|
'Warning: CocoaPods recommended version $cocoaPodsRecommendedVersion or greater not installed.\n'
|
||||||
|
'Pods handling may fail on some projects involving plugins.\n'
|
||||||
|
'To upgrade:\n'
|
||||||
|
'$cocoaPodsUpgradeInstructions\n',
|
||||||
|
emphasis: true,
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (!await isCocoaPodsInitialized) {
|
if (!await isCocoaPodsInitialized) {
|
||||||
printError(
|
printError(
|
||||||
@ -155,19 +197,20 @@ class CocoaPods {
|
|||||||
|
|
||||||
// Check if you need to run pod install.
|
// Check if you need to run pod install.
|
||||||
// The pod install will run if any of below is true.
|
// The pod install will run if any of below is true.
|
||||||
// 1. The flutter.framework has changed (debug/release/profile)
|
// 1. Flutter dependencies have changed
|
||||||
// 2. The podfile.lock doesn't exist
|
// 2. Podfile.lock doesn't exist or is older than Podfile
|
||||||
// 3. The Pods/Manifest.lock doesn't exist (It is deleted when plugins change)
|
// 3. Pods/Manifest.lock doesn't exist (It is deleted when plugins change)
|
||||||
// 4. The podfile.lock doesn't match Pods/Manifest.lock.
|
// 4. Podfile.lock doesn't match Pods/Manifest.lock.
|
||||||
bool _shouldRunPodInstall(Directory appIosDirectory, bool dependenciesChanged) {
|
bool _shouldRunPodInstall(Directory appIosDirectory, bool dependenciesChanged) {
|
||||||
if (dependenciesChanged)
|
if (dependenciesChanged)
|
||||||
return true;
|
return true;
|
||||||
// Check if podfile.lock and Pods/Manifest.lock exist and match.
|
final File podfileFile = appIosDirectory.childFile('Podfile');
|
||||||
final File podfileLockFile = appIosDirectory.childFile('Podfile.lock');
|
final File podfileLockFile = appIosDirectory.childFile('Podfile.lock');
|
||||||
final File manifestLockFile =
|
final File manifestLockFile =
|
||||||
appIosDirectory.childFile(fs.path.join('Pods', 'Manifest.lock'));
|
appIosDirectory.childFile(fs.path.join('Pods', 'Manifest.lock'));
|
||||||
return !podfileLockFile.existsSync()
|
return !podfileLockFile.existsSync()
|
||||||
|| !manifestLockFile.existsSync()
|
|| !manifestLockFile.existsSync()
|
||||||
|
|| podfileLockFile.statSync().modified.isBefore(podfileFile.statSync().modified)
|
||||||
|| podfileLockFile.readAsStringSync() != manifestLockFile.readAsStringSync();
|
|| podfileLockFile.readAsStringSync() != manifestLockFile.readAsStringSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,9 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await cocoaPods.isCocoaPodsInstalledAndMeetsVersionCheck) {
|
final CocoaPodsStatus cocoaPodsStatus = await cocoaPods.evaluateCocoaPodsInstallation;
|
||||||
|
|
||||||
|
if (cocoaPodsStatus == CocoaPodsStatus.recommended) {
|
||||||
if (await cocoaPods.isCocoaPodsInitialized) {
|
if (await cocoaPods.isCocoaPodsInitialized) {
|
||||||
messages.add(new ValidationMessage('CocoaPods version ${await cocoaPods.cocoaPodsVersionText}'));
|
messages.add(new ValidationMessage('CocoaPods version ${await cocoaPods.cocoaPodsVersionText}'));
|
||||||
} else {
|
} else {
|
||||||
@ -186,7 +188,7 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
brewStatus = ValidationType.partial;
|
brewStatus = ValidationType.partial;
|
||||||
if (!await cocoaPods.hasCocoaPods) {
|
if (cocoaPodsStatus == CocoaPodsStatus.notInstalled) {
|
||||||
messages.add(new ValidationMessage.error(
|
messages.add(new ValidationMessage.error(
|
||||||
'CocoaPods not installed.\n'
|
'CocoaPods not installed.\n'
|
||||||
'$noCocoaPodsConsequence\n'
|
'$noCocoaPodsConsequence\n'
|
||||||
@ -194,8 +196,8 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
|
|||||||
'$cocoaPodsInstallInstructions'
|
'$cocoaPodsInstallInstructions'
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
messages.add(new ValidationMessage.error(
|
messages.add(new ValidationMessage.hint(
|
||||||
'CocoaPods out of date ($cocoaPods.cocoaPodsMinimumVersion is required).\n'
|
'CocoaPods out of date (${cocoaPods.cocoaPodsRecommendedVersion} is recommended).\n'
|
||||||
'$noCocoaPodsConsequence\n'
|
'$noCocoaPodsConsequence\n'
|
||||||
'To upgrade:\n'
|
'To upgrade:\n'
|
||||||
'$cocoaPodsUpgradeInstructions'
|
'$cocoaPodsUpgradeInstructions'
|
||||||
|
@ -238,7 +238,7 @@ void injectPlugins({String directory}) {
|
|||||||
_writeAndroidPluginRegistrant(directory, plugins);
|
_writeAndroidPluginRegistrant(directory, plugins);
|
||||||
if (fs.isDirectorySync(fs.path.join(directory, 'ios'))) {
|
if (fs.isDirectorySync(fs.path.join(directory, 'ios'))) {
|
||||||
_writeIOSPluginRegistrant(directory, plugins);
|
_writeIOSPluginRegistrant(directory, plugins);
|
||||||
const CocoaPods cocoaPods = const CocoaPods();
|
final CocoaPods cocoaPods = new CocoaPods();
|
||||||
if (plugins.isNotEmpty)
|
if (plugins.isNotEmpty)
|
||||||
cocoaPods.setupPodfile(directory);
|
cocoaPods.setupPodfile(directory);
|
||||||
if (changed)
|
if (changed)
|
||||||
|
@ -29,8 +29,8 @@ end
|
|||||||
target 'Runner' do
|
target 'Runner' do
|
||||||
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
|
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
|
||||||
# referring to absolute paths on developers' machines.
|
# referring to absolute paths on developers' machines.
|
||||||
system('rm -rf Pods/.symlinks')
|
system('rm -rf .symlinks')
|
||||||
system('mkdir -p Pods/.symlinks/plugins')
|
system('mkdir -p .symlinks/plugins')
|
||||||
|
|
||||||
# Flutter Pods
|
# Flutter Pods
|
||||||
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
|
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
|
||||||
@ -39,7 +39,7 @@ target 'Runner' do
|
|||||||
end
|
end
|
||||||
generated_xcode_build_settings.map { |p|
|
generated_xcode_build_settings.map { |p|
|
||||||
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
|
||||||
symlink = File.join('Pods', '.symlinks', 'flutter')
|
symlink = File.join('.symlinks', 'flutter')
|
||||||
File.symlink(File.dirname(p[:path]), symlink)
|
File.symlink(File.dirname(p[:path]), symlink)
|
||||||
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
|
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
|
||||||
end
|
end
|
||||||
@ -48,7 +48,7 @@ target 'Runner' do
|
|||||||
# Plugin Pods
|
# Plugin Pods
|
||||||
plugin_pods = parse_KV_file('../.flutter-plugins')
|
plugin_pods = parse_KV_file('../.flutter-plugins')
|
||||||
plugin_pods.map { |p|
|
plugin_pods.map { |p|
|
||||||
symlink = File.join('Pods', '.symlinks', 'plugins', p[:name])
|
symlink = File.join('.symlinks', 'plugins', p[:name])
|
||||||
File.symlink(p[:path], symlink)
|
File.symlink(p[:path], symlink)
|
||||||
pod p[:name], :path => File.join(symlink, 'ios')
|
pod p[:name], :path => File.join(symlink, 'ios')
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,8 @@ target 'Runner' do
|
|||||||
|
|
||||||
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
|
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
|
||||||
# referring to absolute paths on developers' machines.
|
# referring to absolute paths on developers' machines.
|
||||||
system('rm -rf Pods/.symlinks')
|
system('rm -rf .symlinks')
|
||||||
system('mkdir -p Pods/.symlinks/plugins')
|
system('mkdir -p .symlinks/plugins')
|
||||||
|
|
||||||
# Flutter Pods
|
# Flutter Pods
|
||||||
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
|
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
|
||||||
@ -41,7 +41,7 @@ target 'Runner' do
|
|||||||
end
|
end
|
||||||
generated_xcode_build_settings.map { |p|
|
generated_xcode_build_settings.map { |p|
|
||||||
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
|
||||||
symlink = File.join('Pods', '.symlinks', 'flutter')
|
symlink = File.join('.symlinks', 'flutter')
|
||||||
File.symlink(File.dirname(p[:path]), symlink)
|
File.symlink(File.dirname(p[:path]), symlink)
|
||||||
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
|
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
|
||||||
end
|
end
|
||||||
@ -50,7 +50,7 @@ target 'Runner' do
|
|||||||
# Plugin Pods
|
# Plugin Pods
|
||||||
plugin_pods = parse_KV_file('../.flutter-plugins')
|
plugin_pods = parse_KV_file('../.flutter-plugins')
|
||||||
plugin_pods.map { |p|
|
plugin_pods.map { |p|
|
||||||
symlink = File.join('Pods', '.symlinks', 'plugins', p[:name])
|
symlink = File.join('.symlinks', 'plugins', p[:name])
|
||||||
File.symlink(p[:path], symlink)
|
File.symlink(p[:path], symlink)
|
||||||
pod p[:name], :path => File.join(symlink, 'ios')
|
pod p[:name], :path => File.join(symlink, 'ios')
|
||||||
}
|
}
|
||||||
|
@ -42,3 +42,4 @@ Icon?
|
|||||||
/ServiceDefinitions.json
|
/ServiceDefinitions.json
|
||||||
|
|
||||||
Pods/
|
Pods/
|
||||||
|
.symlinks/
|
||||||
|
@ -17,12 +17,27 @@ import 'package:test/test.dart';
|
|||||||
|
|
||||||
import '../src/context.dart';
|
import '../src/context.dart';
|
||||||
|
|
||||||
|
typedef Future<ProcessResult> InvokeProcess();
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
FileSystem fs;
|
FileSystem fs;
|
||||||
ProcessManager mockProcessManager;
|
ProcessManager mockProcessManager;
|
||||||
MockXcodeProjectInterpreter mockXcodeProjectInterpreter;
|
MockXcodeProjectInterpreter mockXcodeProjectInterpreter;
|
||||||
Directory projectUnderTest;
|
Directory projectUnderTest;
|
||||||
CocoaPods cocoaPodsUnderTest;
|
CocoaPods cocoaPodsUnderTest;
|
||||||
|
InvokeProcess resultOfPodVersion;
|
||||||
|
|
||||||
|
void pretendPodIsNotInstalled() {
|
||||||
|
resultOfPodVersion = () async => throw 'Executable does not exist';
|
||||||
|
}
|
||||||
|
|
||||||
|
void pretendPodVersionFails() {
|
||||||
|
resultOfPodVersion = () async => exitsWithError();
|
||||||
|
}
|
||||||
|
|
||||||
|
void pretendPodVersionIs(String versionText) {
|
||||||
|
resultOfPodVersion = () async => exitsHappy(versionText);
|
||||||
|
}
|
||||||
|
|
||||||
setUp(() {
|
setUp(() {
|
||||||
Cache.flutterRoot = 'flutter';
|
Cache.flutterRoot = 'flutter';
|
||||||
@ -30,7 +45,8 @@ void main() {
|
|||||||
mockProcessManager = new MockProcessManager();
|
mockProcessManager = new MockProcessManager();
|
||||||
mockXcodeProjectInterpreter = new MockXcodeProjectInterpreter();
|
mockXcodeProjectInterpreter = new MockXcodeProjectInterpreter();
|
||||||
projectUnderTest = fs.directory(fs.path.join('project', 'ios'))..createSync(recursive: true);
|
projectUnderTest = fs.directory(fs.path.join('project', 'ios'))..createSync(recursive: true);
|
||||||
|
cocoaPodsUnderTest = new CocoaPods();
|
||||||
|
pretendPodVersionIs('1.5.0');
|
||||||
fs.file(fs.path.join(
|
fs.file(fs.path.join(
|
||||||
Cache.flutterRoot, 'packages', 'flutter_tools', 'templates', 'cocoapods', 'Podfile-objc'
|
Cache.flutterRoot, 'packages', 'flutter_tools', 'templates', 'cocoapods', 'Podfile-objc'
|
||||||
))
|
))
|
||||||
@ -41,30 +57,85 @@ void main() {
|
|||||||
))
|
))
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('Swift podfile template');
|
..writeAsStringSync('Swift podfile template');
|
||||||
cocoaPodsUnderTest = const TestCocoaPods();
|
fs.directory(fs.path.join(homeDirPath, '.cocoapods', 'repos', 'master')).createSync(recursive: true);
|
||||||
|
when(mockProcessManager.run(
|
||||||
|
<String>['pod', '--version'],
|
||||||
|
workingDirectory: any,
|
||||||
|
environment: any,
|
||||||
|
)).thenAnswer((_) => resultOfPodVersion());
|
||||||
when(mockProcessManager.run(
|
when(mockProcessManager.run(
|
||||||
<String>['pod', 'install', '--verbose'],
|
<String>['pod', 'install', '--verbose'],
|
||||||
workingDirectory: 'project/ios',
|
workingDirectory: 'project/ios',
|
||||||
environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'},
|
environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'},
|
||||||
)).thenAnswer((_) => new Future<ProcessResult>.value(exitsHappy));
|
)).thenAnswer((_) async => exitsHappy());
|
||||||
|
});
|
||||||
|
|
||||||
|
group('Evaluate installation', () {
|
||||||
|
testUsingContext('detects not installed, if pod exec does not exist', () async {
|
||||||
|
pretendPodIsNotInstalled();
|
||||||
|
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.notInstalled);
|
||||||
|
}, overrides: <Type, Generator>{
|
||||||
|
ProcessManager: () => mockProcessManager,
|
||||||
|
});
|
||||||
|
|
||||||
|
testUsingContext('detects not installed, if pod version fails', () async {
|
||||||
|
pretendPodVersionFails();
|
||||||
|
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.notInstalled);
|
||||||
|
}, overrides: <Type, Generator>{
|
||||||
|
ProcessManager: () => mockProcessManager,
|
||||||
|
});
|
||||||
|
|
||||||
|
testUsingContext('detects installed', () async {
|
||||||
|
pretendPodVersionIs('0.0.1');
|
||||||
|
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, isNot(CocoaPodsStatus.notInstalled));
|
||||||
|
}, overrides: <Type, Generator>{
|
||||||
|
ProcessManager: () => mockProcessManager,
|
||||||
|
});
|
||||||
|
|
||||||
|
testUsingContext('detects below minimum version', () async {
|
||||||
|
pretendPodVersionIs('0.39.8');
|
||||||
|
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.belowMinimumVersion);
|
||||||
|
}, overrides: <Type, Generator>{
|
||||||
|
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 {
|
||||||
|
pretendPodVersionIs('1.5.0');
|
||||||
|
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.recommended);
|
||||||
|
}, overrides: <Type, Generator>{
|
||||||
|
ProcessManager: () => mockProcessManager,
|
||||||
|
});
|
||||||
|
|
||||||
|
testUsingContext('detects above recommended version', () async {
|
||||||
|
pretendPodVersionIs('1.5.1');
|
||||||
|
expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.recommended);
|
||||||
|
}, overrides: <Type, Generator>{
|
||||||
|
ProcessManager: () => mockProcessManager,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
group('Setup Podfile', () {
|
group('Setup Podfile', () {
|
||||||
File podfile;
|
File podFile;
|
||||||
File debugConfigFile;
|
File debugConfigFile;
|
||||||
File releaseConfigFile;
|
File releaseConfigFile;
|
||||||
|
|
||||||
setUp(() {
|
setUp(() {
|
||||||
debugConfigFile = fs.file(fs.path.join('project', 'ios', 'Flutter', 'Debug.xcconfig'));
|
debugConfigFile = fs.file(fs.path.join('project', 'ios', 'Flutter', 'Debug.xcconfig'));
|
||||||
releaseConfigFile = fs.file(fs.path.join('project', 'ios', 'Flutter', 'Release.xcconfig'));
|
releaseConfigFile = fs.file(fs.path.join('project', 'ios', 'Flutter', 'Release.xcconfig'));
|
||||||
podfile = fs.file(fs.path.join('project', 'ios', 'Podfile'));
|
podFile = fs.file(fs.path.join('project', 'ios', 'Podfile'));
|
||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('creates objective-c Podfile when not present', () {
|
testUsingContext('creates objective-c Podfile when not present', () {
|
||||||
cocoaPodsUnderTest.setupPodfile('project');
|
cocoaPodsUnderTest.setupPodfile('project');
|
||||||
|
|
||||||
expect(podfile.readAsStringSync(), 'Objective-C podfile template');
|
expect(podFile.readAsStringSync(), 'Objective-C podfile template');
|
||||||
}, overrides: <Type, Generator>{
|
}, overrides: <Type, Generator>{
|
||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
});
|
});
|
||||||
@ -77,18 +148,18 @@ void main() {
|
|||||||
|
|
||||||
cocoaPodsUnderTest.setupPodfile('project');
|
cocoaPodsUnderTest.setupPodfile('project');
|
||||||
|
|
||||||
expect(podfile.readAsStringSync(), 'Swift podfile template');
|
expect(podFile.readAsStringSync(), 'Swift podfile template');
|
||||||
}, overrides: <Type, Generator>{
|
}, overrides: <Type, Generator>{
|
||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
|
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
|
||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('does not recreate Podfile when already present', () {
|
testUsingContext('does not recreate Podfile when already present', () {
|
||||||
podfile..createSync()..writeAsStringSync('Existing Podfile');
|
podFile..createSync()..writeAsStringSync('Existing Podfile');
|
||||||
|
|
||||||
cocoaPodsUnderTest.setupPodfile('project');
|
cocoaPodsUnderTest.setupPodfile('project');
|
||||||
|
|
||||||
expect(podfile.readAsStringSync(), 'Existing Podfile');
|
expect(podFile.readAsStringSync(), 'Existing Podfile');
|
||||||
}, overrides: <Type, Generator>{
|
}, overrides: <Type, Generator>{
|
||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
});
|
});
|
||||||
@ -98,14 +169,14 @@ void main() {
|
|||||||
|
|
||||||
cocoaPodsUnderTest.setupPodfile('project');
|
cocoaPodsUnderTest.setupPodfile('project');
|
||||||
|
|
||||||
expect(podfile.existsSync(), false);
|
expect(podFile.existsSync(), false);
|
||||||
}, overrides: <Type, Generator>{
|
}, overrides: <Type, Generator>{
|
||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
|
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
|
||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('includes Pod config in xcconfig files, if not present', () {
|
testUsingContext('includes Pod config in xcconfig files, if not present', () {
|
||||||
podfile..createSync()..writeAsStringSync('Existing Podfile');
|
podFile..createSync()..writeAsStringSync('Existing Podfile');
|
||||||
debugConfigFile..createSync(recursive: true)..writeAsStringSync('Existing debug config');
|
debugConfigFile..createSync(recursive: true)..writeAsStringSync('Existing debug config');
|
||||||
releaseConfigFile..createSync(recursive: true)..writeAsStringSync('Existing release config');
|
releaseConfigFile..createSync(recursive: true)..writeAsStringSync('Existing release config');
|
||||||
|
|
||||||
@ -126,14 +197,14 @@ void main() {
|
|||||||
|
|
||||||
group('Process pods', () {
|
group('Process pods', () {
|
||||||
testUsingContext('prints error, if CocoaPods is not installed', () async {
|
testUsingContext('prints error, if CocoaPods is not installed', () async {
|
||||||
|
pretendPodIsNotInstalled();
|
||||||
projectUnderTest.childFile('Podfile').createSync();
|
projectUnderTest.childFile('Podfile').createSync();
|
||||||
cocoaPodsUnderTest = const TestCocoaPods(false);
|
|
||||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||||
appIosDirectory: projectUnderTest,
|
appIosDirectory: projectUnderTest,
|
||||||
iosEngineDir: 'engine/path',
|
iosEngineDir: 'engine/path',
|
||||||
);
|
);
|
||||||
verifyNever(mockProcessManager.run(
|
verifyNever(mockProcessManager.run(
|
||||||
typed<List<String>>(any),
|
argThat(containsAllInOrder(<String>['pod', 'install'])),
|
||||||
workingDirectory: any,
|
workingDirectory: any,
|
||||||
environment: typed<Map<String, String>>(any, named: 'environment'),
|
environment: typed<Map<String, String>>(any, named: 'environment'),
|
||||||
));
|
));
|
||||||
@ -146,7 +217,6 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('throws, if Podfile is missing.', () async {
|
testUsingContext('throws, if Podfile is missing.', () async {
|
||||||
cocoaPodsUnderTest = const TestCocoaPods(true);
|
|
||||||
try {
|
try {
|
||||||
await cocoaPodsUnderTest.processPods(
|
await cocoaPodsUnderTest.processPods(
|
||||||
appIosDirectory: projectUnderTest,
|
appIosDirectory: projectUnderTest,
|
||||||
@ -156,7 +226,7 @@ void main() {
|
|||||||
} catch(e) {
|
} catch(e) {
|
||||||
expect(e, const isInstanceOf<ToolExit>());
|
expect(e, const isInstanceOf<ToolExit>());
|
||||||
verifyNever(mockProcessManager.run(
|
verifyNever(mockProcessManager.run(
|
||||||
typed<List<String>>(any),
|
argThat(containsAllInOrder(<String>['pod', 'install'])),
|
||||||
workingDirectory: any,
|
workingDirectory: any,
|
||||||
environment: typed<Map<String, String>>(any, named: 'environment'),
|
environment: typed<Map<String, String>>(any, named: 'environment'),
|
||||||
));
|
));
|
||||||
@ -169,7 +239,7 @@ void main() {
|
|||||||
testUsingContext('throws, if specs repo is outdated.', () async {
|
testUsingContext('throws, if specs repo is outdated.', () async {
|
||||||
fs.file(fs.path.join('project', 'ios', 'Podfile'))
|
fs.file(fs.path.join('project', 'ios', 'Podfile'))
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing Podfile');
|
..writeAsStringSync('Existing Podfile');
|
||||||
|
|
||||||
when(mockProcessManager.run(
|
when(mockProcessManager.run(
|
||||||
<String>['pod', 'install', '--verbose'],
|
<String>['pod', 'install', '--verbose'],
|
||||||
@ -178,9 +248,7 @@ void main() {
|
|||||||
'FLUTTER_FRAMEWORK_DIR': 'engine/path',
|
'FLUTTER_FRAMEWORK_DIR': 'engine/path',
|
||||||
'COCOAPODS_DISABLE_STATS': 'true',
|
'COCOAPODS_DISABLE_STATS': 'true',
|
||||||
},
|
},
|
||||||
)).thenAnswer((_) => new Future<ProcessResult>.value(new ProcessResult(
|
)).thenAnswer((_) async => exitsWithError(
|
||||||
1,
|
|
||||||
1,
|
|
||||||
'''
|
'''
|
||||||
[!] Unable to satisfy the following requirements:
|
[!] Unable to satisfy the following requirements:
|
||||||
|
|
||||||
@ -195,8 +263,7 @@ You have either:
|
|||||||
* not added the source repo that hosts the Podspec to your Podfile.
|
* not added the source repo that hosts the Podspec to your Podfile.
|
||||||
|
|
||||||
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.''',
|
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.''',
|
||||||
'',
|
));
|
||||||
)));
|
|
||||||
try {
|
try {
|
||||||
await cocoaPodsUnderTest.processPods(
|
await cocoaPodsUnderTest.processPods(
|
||||||
appIosDirectory: projectUnderTest,
|
appIosDirectory: projectUnderTest,
|
||||||
@ -218,10 +285,10 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
testUsingContext('run pod install, if Podfile.lock is missing', () async {
|
testUsingContext('run pod install, if Podfile.lock is missing', () async {
|
||||||
projectUnderTest.childFile('Podfile')
|
projectUnderTest.childFile('Podfile')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing Podfile');
|
..writeAsStringSync('Existing Podfile');
|
||||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsString('Existing lock file.');
|
..writeAsStringSync('Existing lock file.');
|
||||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||||
appIosDirectory: projectUnderTest,
|
appIosDirectory: projectUnderTest,
|
||||||
iosEngineDir: 'engine/path',
|
iosEngineDir: 'engine/path',
|
||||||
@ -241,10 +308,10 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
testUsingContext('runs pod install, if Manifest.lock is missing', () async {
|
testUsingContext('runs pod install, if Manifest.lock is missing', () async {
|
||||||
projectUnderTest.childFile('Podfile')
|
projectUnderTest.childFile('Podfile')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing Podfile');
|
..writeAsStringSync('Existing Podfile');
|
||||||
projectUnderTest.childFile('Podfile.lock')
|
projectUnderTest.childFile('Podfile.lock')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing lock file.');
|
..writeAsStringSync('Existing lock file.');
|
||||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||||
appIosDirectory: projectUnderTest,
|
appIosDirectory: projectUnderTest,
|
||||||
iosEngineDir: 'engine/path',
|
iosEngineDir: 'engine/path',
|
||||||
@ -267,13 +334,13 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
testUsingContext('runs pod install, if Manifest.lock different from Podspec.lock', () async {
|
testUsingContext('runs pod install, if Manifest.lock different from Podspec.lock', () async {
|
||||||
projectUnderTest.childFile('Podfile')
|
projectUnderTest.childFile('Podfile')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing Podfile');
|
..writeAsStringSync('Existing Podfile');
|
||||||
projectUnderTest.childFile('Podfile.lock')
|
projectUnderTest.childFile('Podfile.lock')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing lock file.');
|
..writeAsStringSync('Existing lock file.');
|
||||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsString('Different lock file.');
|
..writeAsStringSync('Different lock file.');
|
||||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||||
appIosDirectory: projectUnderTest,
|
appIosDirectory: projectUnderTest,
|
||||||
iosEngineDir: 'engine/path',
|
iosEngineDir: 'engine/path',
|
||||||
@ -296,13 +363,13 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
testUsingContext('runs pod install, if flutter framework changed', () async {
|
testUsingContext('runs pod install, if flutter framework changed', () async {
|
||||||
projectUnderTest.childFile('Podfile')
|
projectUnderTest.childFile('Podfile')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing Podfile');
|
..writeAsStringSync('Existing Podfile');
|
||||||
projectUnderTest.childFile('Podfile.lock')
|
projectUnderTest.childFile('Podfile.lock')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing lock file.');
|
..writeAsStringSync('Existing lock file.');
|
||||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsString('Existing lock file.');
|
..writeAsStringSync('Existing lock file.');
|
||||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||||
appIosDirectory: projectUnderTest,
|
appIosDirectory: projectUnderTest,
|
||||||
iosEngineDir: 'engine/path',
|
iosEngineDir: 'engine/path',
|
||||||
@ -322,16 +389,47 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
ProcessManager: () => mockProcessManager,
|
ProcessManager: () => mockProcessManager,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testUsingContext('runs pod install, if Podfile.lock is older than Podfile', () async {
|
||||||
|
projectUnderTest.childFile('Podfile')
|
||||||
|
..createSync()
|
||||||
|
..writeAsStringSync('Existing Podfile');
|
||||||
|
projectUnderTest.childFile('Podfile.lock')
|
||||||
|
..createSync()
|
||||||
|
..writeAsStringSync('Existing lock file.');
|
||||||
|
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||||
|
..createSync(recursive: true)
|
||||||
|
..writeAsStringSync('Existing lock file.');
|
||||||
|
await new Future<void>.delayed(const Duration(milliseconds: 10));
|
||||||
|
projectUnderTest.childFile('Podfile')
|
||||||
|
..writeAsStringSync('Updated Podfile');
|
||||||
|
await cocoaPodsUnderTest.processPods(
|
||||||
|
appIosDirectory: projectUnderTest,
|
||||||
|
iosEngineDir: 'engine/path',
|
||||||
|
dependenciesChanged: false,
|
||||||
|
);
|
||||||
|
verify(mockProcessManager.run(
|
||||||
|
<String>['pod', 'install', '--verbose'],
|
||||||
|
workingDirectory: 'project/ios',
|
||||||
|
environment: <String, String>{
|
||||||
|
'FLUTTER_FRAMEWORK_DIR': 'engine/path',
|
||||||
|
'COCOAPODS_DISABLE_STATS': 'true',
|
||||||
|
},
|
||||||
|
));
|
||||||
|
}, overrides: <Type, Generator>{
|
||||||
|
FileSystem: () => fs,
|
||||||
|
ProcessManager: () => mockProcessManager,
|
||||||
|
});
|
||||||
|
|
||||||
testUsingContext('skips pod install, if nothing changed', () async {
|
testUsingContext('skips pod install, if nothing changed', () async {
|
||||||
projectUnderTest.childFile('Podfile')
|
projectUnderTest.childFile('Podfile')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing Podfile');
|
..writeAsStringSync('Existing Podfile');
|
||||||
projectUnderTest.childFile('Podfile.lock')
|
projectUnderTest.childFile('Podfile.lock')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing lock file.');
|
..writeAsStringSync('Existing lock file.');
|
||||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsString('Existing lock file.');
|
..writeAsStringSync('Existing lock file.');
|
||||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||||
appIosDirectory: projectUnderTest,
|
appIosDirectory: projectUnderTest,
|
||||||
iosEngineDir: 'engine/path',
|
iosEngineDir: 'engine/path',
|
||||||
@ -339,7 +437,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
);
|
);
|
||||||
expect(didInstall, isFalse);
|
expect(didInstall, isFalse);
|
||||||
verifyNever(mockProcessManager.run(
|
verifyNever(mockProcessManager.run(
|
||||||
typed<List<String>>(any),
|
argThat(containsAllInOrder(<String>['pod', 'install'])),
|
||||||
workingDirectory: any,
|
workingDirectory: any,
|
||||||
environment: typed<Map<String, String>>(any, named: 'environment'),
|
environment: typed<Map<String, String>>(any, named: 'environment'),
|
||||||
));
|
));
|
||||||
@ -351,13 +449,13 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
testUsingContext('a failed pod install deletes Pods/Manifest.lock', () async {
|
testUsingContext('a failed pod install deletes Pods/Manifest.lock', () async {
|
||||||
projectUnderTest.childFile('Podfile')
|
projectUnderTest.childFile('Podfile')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing Podfile');
|
..writeAsStringSync('Existing Podfile');
|
||||||
projectUnderTest.childFile('Podfile.lock')
|
projectUnderTest.childFile('Podfile.lock')
|
||||||
..createSync()
|
..createSync()
|
||||||
..writeAsString('Existing lock file.');
|
..writeAsStringSync('Existing lock file.');
|
||||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsString('Existing lock file.');
|
..writeAsStringSync('Existing lock file.');
|
||||||
|
|
||||||
when(mockProcessManager.run(
|
when(mockProcessManager.run(
|
||||||
<String>['pod', 'install', '--verbose'],
|
<String>['pod', 'install', '--verbose'],
|
||||||
@ -367,9 +465,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
'COCOAPODS_DISABLE_STATS': 'true',
|
'COCOAPODS_DISABLE_STATS': 'true',
|
||||||
},
|
},
|
||||||
)).thenAnswer(
|
)).thenAnswer(
|
||||||
(_) => new Future<ProcessResult>.value(
|
(_) async => exitsWithError()
|
||||||
new ProcessResult(1, 1, 'fails for some reason', '')
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -392,24 +488,5 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
class MockProcessManager extends Mock implements ProcessManager {}
|
class MockProcessManager extends Mock implements ProcessManager {}
|
||||||
class MockXcodeProjectInterpreter extends Mock implements XcodeProjectInterpreter {}
|
class MockXcodeProjectInterpreter extends Mock implements XcodeProjectInterpreter {}
|
||||||
|
|
||||||
class TestCocoaPods extends CocoaPods {
|
ProcessResult exitsWithError([String stdout = '']) => new ProcessResult(1, 1, stdout, '');
|
||||||
const TestCocoaPods([this._hasCocoaPods = true]);
|
ProcessResult exitsHappy([String stdout = '']) => new ProcessResult(1, 0, stdout, '');
|
||||||
|
|
||||||
final bool _hasCocoaPods;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<bool> get hasCocoaPods => new Future<bool>.value(_hasCocoaPods);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<String> get cocoaPodsVersionText async => new Future<String>.value('1.5.0');
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<bool> get isCocoaPodsInitialized => new Future<bool>.value(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final ProcessResult exitsHappy = new ProcessResult(
|
|
||||||
1, // pid
|
|
||||||
0, // exitCode
|
|
||||||
'', // stdout
|
|
||||||
'', // stderr
|
|
||||||
);
|
|
||||||
|
@ -33,10 +33,10 @@ void main() {
|
|||||||
cocoaPods = new MockCocoaPods();
|
cocoaPods = new MockCocoaPods();
|
||||||
fs = new MemoryFileSystem();
|
fs = new MemoryFileSystem();
|
||||||
|
|
||||||
when(cocoaPods.isCocoaPodsInstalledAndMeetsVersionCheck)
|
when(cocoaPods.evaluateCocoaPodsInstallation)
|
||||||
.thenAnswer((_) => new Future<bool>.value(true));
|
.thenAnswer((_) async => CocoaPodsStatus.recommended);
|
||||||
when(cocoaPods.isCocoaPodsInitialized)
|
when(cocoaPods.isCocoaPodsInitialized).thenAnswer((_) async => true);
|
||||||
.thenAnswer((_) => new Future<bool>.value(true));
|
when(cocoaPods.cocoaPodsVersionText).thenAnswer((_) async => '1.8.0');
|
||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('Emit missing status when nothing is installed', () async {
|
testUsingContext('Emit missing status when nothing is installed', () async {
|
||||||
@ -213,9 +213,8 @@ void main() {
|
|||||||
.thenReturn('Xcode 8.2.1\nBuild version 8C1002\n');
|
.thenReturn('Xcode 8.2.1\nBuild version 8C1002\n');
|
||||||
when(xcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
|
when(xcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
|
||||||
when(xcode.eulaSigned).thenReturn(true);
|
when(xcode.eulaSigned).thenReturn(true);
|
||||||
when(cocoaPods.isCocoaPodsInstalledAndMeetsVersionCheck)
|
when(cocoaPods.evaluateCocoaPodsInstallation)
|
||||||
.thenAnswer((_) => new Future<bool>.value(false));
|
.thenAnswer((_) async => CocoaPodsStatus.notInstalled);
|
||||||
when(cocoaPods.hasCocoaPods).thenAnswer((_) => new Future<bool>.value(false));
|
|
||||||
when(xcode.isSimctlInstalled).thenReturn(true);
|
when(xcode.isSimctlInstalled).thenReturn(true);
|
||||||
final IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget();
|
final IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget();
|
||||||
final ValidationResult result = await workflow.validate();
|
final ValidationResult result = await workflow.validate();
|
||||||
@ -232,11 +231,8 @@ void main() {
|
|||||||
.thenReturn('Xcode 8.2.1\nBuild version 8C1002\n');
|
.thenReturn('Xcode 8.2.1\nBuild version 8C1002\n');
|
||||||
when(xcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
|
when(xcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
|
||||||
when(xcode.eulaSigned).thenReturn(true);
|
when(xcode.eulaSigned).thenReturn(true);
|
||||||
when(cocoaPods.isCocoaPodsInstalledAndMeetsVersionCheck)
|
when(cocoaPods.evaluateCocoaPodsInstallation)
|
||||||
.thenAnswer((_) => new Future<bool>.value(false));
|
.thenAnswer((_) async => CocoaPodsStatus.belowRecommendedVersion);
|
||||||
when(cocoaPods.hasCocoaPods).thenAnswer((_) => new Future<bool>.value(true));
|
|
||||||
when(cocoaPods.cocoaPodsVersionText)
|
|
||||||
.thenAnswer((_) => new Future<String>.value('0.39.0'));
|
|
||||||
when(xcode.isSimctlInstalled).thenReturn(true);
|
when(xcode.isSimctlInstalled).thenReturn(true);
|
||||||
final IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget();
|
final IOSWorkflowTestTarget workflow = new IOSWorkflowTestTarget();
|
||||||
final ValidationResult result = await workflow.validate();
|
final ValidationResult result = await workflow.validate();
|
||||||
@ -253,8 +249,6 @@ void main() {
|
|||||||
.thenReturn('Xcode 8.2.1\nBuild version 8C1002\n');
|
.thenReturn('Xcode 8.2.1\nBuild version 8C1002\n');
|
||||||
when(xcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
|
when(xcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
|
||||||
when(xcode.eulaSigned).thenReturn(true);
|
when(xcode.eulaSigned).thenReturn(true);
|
||||||
when(cocoaPods.isCocoaPodsInstalledAndMeetsVersionCheck).thenAnswer((_) async => false);
|
|
||||||
when(cocoaPods.hasCocoaPods).thenAnswer((_) async => true);
|
|
||||||
when(cocoaPods.isCocoaPodsInitialized).thenAnswer((_) async => false);
|
when(cocoaPods.isCocoaPodsInitialized).thenAnswer((_) async => false);
|
||||||
when(xcode.isSimctlInstalled).thenReturn(true);
|
when(xcode.isSimctlInstalled).thenReturn(true);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user