From 67aee9a0c3101c35227eec820ede7aedd5cc94cb Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Tue, 22 Jun 2021 20:56:02 -0700 Subject: [PATCH] Avoid iOS app with extension checks that fail on M1 (#85087) --- .../tasks/ios_app_with_extensions_test.dart | 38 +++++++------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart b/dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart index b685b9d83e6..c45249b0816 100644 --- a/dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart +++ b/dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart @@ -12,7 +12,6 @@ import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/ios.dart'; import 'package:flutter_devicelab/framework/task_result.dart'; import 'package:flutter_devicelab/framework/utils.dart'; -import 'package:meta/meta.dart'; import 'package:path/path.dart' as path; Future main() async { @@ -68,8 +67,8 @@ Future main() async { ); checkDirectoryExists(appBundle); - await _checkFlutterFrameworkArchs(appFrameworkPath, isSimulator: false); - await _checkFlutterFrameworkArchs(flutterFrameworkPath, isSimulator: false); + await _checkFlutterFrameworkArchs(appFrameworkPath); + await _checkFlutterFrameworkArchs(flutterFrameworkPath); // Check the watch extension framework added in the Podfile // is in place with the expected watch archs. @@ -101,8 +100,8 @@ Future main() async { }); checkDirectoryExists(appBundle); - await _checkFlutterFrameworkArchs(appFrameworkPath, isSimulator: false); - await _checkFlutterFrameworkArchs(flutterFrameworkPath, isSimulator: false); + await _checkFlutterFrameworkArchs(appFrameworkPath); + await _checkFlutterFrameworkArchs(flutterFrameworkPath); unawaited(_checkWatchExtensionFrameworkArchs(watchExtensionFrameworkPath)); section('Clean build'); @@ -252,22 +251,18 @@ Future main() async { )).path; checkDirectoryExists(simulatorAppBundle); - - final String simulatorAppFrameworkPath = path.join( + checkFileExists(path.join( simulatorAppBundle, 'Frameworks', 'App.framework', 'App', - ); - final String simulatorFlutterFrameworkPath = path.join( + )); + checkFileExists(path.join( simulatorAppBundle, 'Frameworks', 'Flutter.framework', 'Flutter', - ); - - await _checkFlutterFrameworkArchs(simulatorAppFrameworkPath, isSimulator: true); - await _checkFlutterFrameworkArchs(simulatorFlutterFrameworkPath, isSimulator: true); + )); return TaskResult.success(null); } catch (e) { @@ -307,23 +302,16 @@ Future main() async { }); } -Future _checkFlutterFrameworkArchs(String frameworkPath, { - @required bool isSimulator -}) async { +Future _checkFlutterFrameworkArchs(String frameworkPath) async { checkFileExists(frameworkPath); final String archs = await fileType(frameworkPath); - if (isSimulator == archs.contains('armv7')) { - throw TaskResult.failure('$frameworkPath armv7 architecture unexpected'); + if (!archs.contains('arm64')) { + throw TaskResult.failure('$frameworkPath arm64 architecture missing'); } - if (isSimulator == archs.contains('arm64')) { - throw TaskResult.failure('$frameworkPath arm64 architecture unexpected'); - } - - if (isSimulator != archs.contains('x86_64')) { - throw TaskResult.failure( - '$frameworkPath x86_64 architecture unexpected'); + if (archs.contains('x86_64')) { + throw TaskResult.failure('$frameworkPath x86_64 architecture unexpectedly present'); } }