Unverified Commit 67aee9a0 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Avoid iOS app with extension checks that fail on M1 (#85087)

parent fc9d3129
...@@ -12,7 +12,6 @@ import 'package:flutter_devicelab/framework/framework.dart'; ...@@ -12,7 +12,6 @@ import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/ios.dart'; import 'package:flutter_devicelab/framework/ios.dart';
import 'package:flutter_devicelab/framework/task_result.dart'; import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/framework/utils.dart'; import 'package:flutter_devicelab/framework/utils.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
Future<void> main() async { Future<void> main() async {
...@@ -68,8 +67,8 @@ Future<void> main() async { ...@@ -68,8 +67,8 @@ Future<void> main() async {
); );
checkDirectoryExists(appBundle); checkDirectoryExists(appBundle);
await _checkFlutterFrameworkArchs(appFrameworkPath, isSimulator: false); await _checkFlutterFrameworkArchs(appFrameworkPath);
await _checkFlutterFrameworkArchs(flutterFrameworkPath, isSimulator: false); await _checkFlutterFrameworkArchs(flutterFrameworkPath);
// Check the watch extension framework added in the Podfile // Check the watch extension framework added in the Podfile
// is in place with the expected watch archs. // is in place with the expected watch archs.
...@@ -101,8 +100,8 @@ Future<void> main() async { ...@@ -101,8 +100,8 @@ Future<void> main() async {
}); });
checkDirectoryExists(appBundle); checkDirectoryExists(appBundle);
await _checkFlutterFrameworkArchs(appFrameworkPath, isSimulator: false); await _checkFlutterFrameworkArchs(appFrameworkPath);
await _checkFlutterFrameworkArchs(flutterFrameworkPath, isSimulator: false); await _checkFlutterFrameworkArchs(flutterFrameworkPath);
unawaited(_checkWatchExtensionFrameworkArchs(watchExtensionFrameworkPath)); unawaited(_checkWatchExtensionFrameworkArchs(watchExtensionFrameworkPath));
section('Clean build'); section('Clean build');
...@@ -252,22 +251,18 @@ Future<void> main() async { ...@@ -252,22 +251,18 @@ Future<void> main() async {
)).path; )).path;
checkDirectoryExists(simulatorAppBundle); checkDirectoryExists(simulatorAppBundle);
checkFileExists(path.join(
final String simulatorAppFrameworkPath = path.join(
simulatorAppBundle, simulatorAppBundle,
'Frameworks', 'Frameworks',
'App.framework', 'App.framework',
'App', 'App',
); ));
final String simulatorFlutterFrameworkPath = path.join( checkFileExists(path.join(
simulatorAppBundle, simulatorAppBundle,
'Frameworks', 'Frameworks',
'Flutter.framework', 'Flutter.framework',
'Flutter', 'Flutter',
); ));
await _checkFlutterFrameworkArchs(simulatorAppFrameworkPath, isSimulator: true);
await _checkFlutterFrameworkArchs(simulatorFlutterFrameworkPath, isSimulator: true);
return TaskResult.success(null); return TaskResult.success(null);
} catch (e) { } catch (e) {
...@@ -307,23 +302,16 @@ Future<void> main() async { ...@@ -307,23 +302,16 @@ Future<void> main() async {
}); });
} }
Future<void> _checkFlutterFrameworkArchs(String frameworkPath, { Future<void> _checkFlutterFrameworkArchs(String frameworkPath) async {
@required bool isSimulator
}) async {
checkFileExists(frameworkPath); checkFileExists(frameworkPath);
final String archs = await fileType(frameworkPath); final String archs = await fileType(frameworkPath);
if (isSimulator == archs.contains('armv7')) { if (!archs.contains('arm64')) {
throw TaskResult.failure('$frameworkPath armv7 architecture unexpected'); 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')) { if (archs.contains('x86_64')) {
throw TaskResult.failure( throw TaskResult.failure('$frameworkPath x86_64 architecture unexpectedly present');
'$frameworkPath x86_64 architecture unexpected');
} }
} }
......
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