Update number of IPHONEOS_DEPLOYMENT_TARGET in plugin_test_ios (#91324)
This commit is contained in:
parent
3e334945e3
commit
4ef6fc1833
@ -173,25 +173,21 @@ class _FlutterProject {
|
||||
|
||||
final String podsProjectContent = podsProject.readAsStringSync();
|
||||
if (target == 'ios') {
|
||||
// This may be a bit brittle, IPHONEOS_DEPLOYMENT_TARGET appears in the
|
||||
// Pods Xcode project file 6 times. If this number changes, make sure
|
||||
// it's not a regression in the IPHONEOS_DEPLOYMENT_TARGET override logic.
|
||||
// The plugintest target should not have IPHONEOS_DEPLOYMENT_TARGET set.
|
||||
// See _reduceDarwinPluginMinimumVersion for details.
|
||||
final int iosDeploymentTargetCount = 'IPHONEOS_DEPLOYMENT_TARGET'.allMatches(podsProjectContent).length;
|
||||
if (iosDeploymentTargetCount != 9) {
|
||||
throw TaskResult.failure('plugintest may contain IPHONEOS_DEPLOYMENT_TARGET, $iosDeploymentTargetCount found');
|
||||
// Plugins with versions lower than the app version should not have IPHONEOS_DEPLOYMENT_TARGET set.
|
||||
// The plugintest plugin target should not have IPHONEOS_DEPLOYMENT_TARGET set since it has been lowered
|
||||
// in _reduceDarwinPluginMinimumVersion to 7, which is below the target version of 9.
|
||||
if (podsProjectContent.contains('IPHONEOS_DEPLOYMENT_TARGET = 7')) {
|
||||
throw TaskResult.failure('Plugin build setting IPHONEOS_DEPLOYMENT_TARGET not removed');
|
||||
}
|
||||
if (!podsProjectContent.contains(r'"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "$(inherited) i386";')) {
|
||||
throw TaskResult.failure(r'EXCLUDED_ARCHS is not "$(inherited) i386"');
|
||||
}
|
||||
}
|
||||
|
||||
// Same for macOS, but 12.
|
||||
// Same for macOS deployment target, but 10.8.
|
||||
// The plugintest target should not have MACOSX_DEPLOYMENT_TARGET set.
|
||||
final int macosDeploymentTargetCount = 'MACOSX_DEPLOYMENT_TARGET'.allMatches(podsProjectContent).length;
|
||||
if (target == 'macos' && macosDeploymentTargetCount != 12) {
|
||||
throw TaskResult.failure('plugintest may contain MACOSX_DEPLOYMENT_TARGET, $macosDeploymentTargetCount found');
|
||||
if (target == 'macos' && podsProjectContent.contains('MACOSX_DEPLOYMENT_TARGET = 10.8')) {
|
||||
throw TaskResult.failure('Plugin build setting MACOSX_DEPLOYMENT_TARGET not removed');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user