Unverified Commit 6881fca7 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Respect plugin excluded iOS architectures (#86905)

parent 8fcace1d
...@@ -167,14 +167,19 @@ class _FlutterProject { ...@@ -167,14 +167,19 @@ class _FlutterProject {
} }
final String podsProjectContent = podsProject.readAsStringSync(); final String podsProjectContent = podsProject.readAsStringSync();
// This may be a bit brittle, IPHONEOS_DEPLOYMENT_TARGET appears in the if (target == 'ios') {
// Pods Xcode project file 6 times. If this number changes, make sure // This may be a bit brittle, IPHONEOS_DEPLOYMENT_TARGET appears in the
// it's not a regression in the IPHONEOS_DEPLOYMENT_TARGET override logic. // Pods Xcode project file 6 times. If this number changes, make sure
// The plugintest target should not have IPHONEOS_DEPLOYMENT_TARGET set. // it's not a regression in the IPHONEOS_DEPLOYMENT_TARGET override logic.
// See _reduceDarwinPluginMinimumVersion for details. // The plugintest target should not have IPHONEOS_DEPLOYMENT_TARGET set.
final int iosDeploymentTargetCount = 'IPHONEOS_DEPLOYMENT_TARGET'.allMatches(podsProjectContent).length; // See _reduceDarwinPluginMinimumVersion for details.
if (target == 'ios' && iosDeploymentTargetCount != 9) { final int iosDeploymentTargetCount = 'IPHONEOS_DEPLOYMENT_TARGET'.allMatches(podsProjectContent).length;
throw TaskResult.failure('plugintest may contain IPHONEOS_DEPLOYMENT_TARGET, $iosDeploymentTargetCount found'); if (iosDeploymentTargetCount != 9) {
throw TaskResult.failure('plugintest may contain IPHONEOS_DEPLOYMENT_TARGET, $iosDeploymentTargetCount found');
}
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, but 12.
......
...@@ -74,7 +74,7 @@ def flutter_additional_ios_build_settings(target) ...@@ -74,7 +74,7 @@ def flutter_additional_ios_build_settings(target)
# Override legacy Xcode 11 style VALID_ARCHS[sdk=iphonesimulator*]=x86_64 and prefer Xcode 12 EXCLUDED_ARCHS. # Override legacy Xcode 11 style VALID_ARCHS[sdk=iphonesimulator*]=x86_64 and prefer Xcode 12 EXCLUDED_ARCHS.
build_configuration.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = '$(ARCHS_STANDARD)' build_configuration.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = '$(ARCHS_STANDARD)'
build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'i386' build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = '$(inherited) i386'
end end
end end
......
...@@ -225,7 +225,7 @@ void main() { ...@@ -225,7 +225,7 @@ void main() {
'FLUTTER_XCODE_ONLY_ACTIVE_ARCH': 'NO', 'FLUTTER_XCODE_ONLY_ACTIVE_ARCH': 'NO',
}, },
); );
// This test case would fail if arm64 or i386 were not excluded. // This test case would fail if arm64 or x86_64 simulators could not build.
expect(buildSimulator.exitCode, 0); expect(buildSimulator.exitCode, 0);
final File simulatorAppFrameworkBinary = fileSystem.file(fileSystem.path.join( final File simulatorAppFrameworkBinary = fileSystem.file(fileSystem.path.join(
...@@ -243,6 +243,7 @@ void main() { ...@@ -243,6 +243,7 @@ void main() {
<String>['file', simulatorAppFrameworkBinary.path], <String>['file', simulatorAppFrameworkBinary.path],
); );
expect(archs.stdout, contains('Mach-O 64-bit dynamically linked shared library x86_64')); expect(archs.stdout, contains('Mach-O 64-bit dynamically linked shared library x86_64'));
expect(archs.stdout, contains('Mach-O 64-bit dynamically linked shared library arm64'));
}); });
}, skip: !platform.isMacOS, timeout: const Timeout(Duration(minutes: 5)) }, skip: !platform.isMacOS, timeout: const Timeout(Duration(minutes: 5))
); );
......
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