Make module tests pass on Xcode 14 (#110556)
This commit is contained in:
parent
253e3c0856
commit
a4530b7c12
@ -101,28 +101,14 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
|
|||||||
|
|
||||||
final String outputPath = path.join(projectDir.path, outputDirectoryName);
|
final String outputPath = path.join(projectDir.path, outputDirectoryName);
|
||||||
|
|
||||||
// TODO(jmagman): Remove ios-arm64_armv7 checks when armv7 engine artifacts are removed.
|
checkFileExists(path.join(
|
||||||
final String arm64FlutterFramework = path.join(
|
|
||||||
outputPath,
|
outputPath,
|
||||||
'Debug',
|
'Debug',
|
||||||
'Flutter.xcframework',
|
'Flutter.xcframework',
|
||||||
'ios-arm64',
|
'ios-arm64',
|
||||||
'Flutter.framework',
|
'Flutter.framework',
|
||||||
);
|
'Flutter',
|
||||||
|
));
|
||||||
final String armv7FlutterFramework = path.join(
|
|
||||||
outputPath,
|
|
||||||
'Debug',
|
|
||||||
'Flutter.xcframework',
|
|
||||||
'ios-arm64_armv7',
|
|
||||||
'Flutter.framework',
|
|
||||||
);
|
|
||||||
|
|
||||||
final bool arm64FlutterBinaryExists = exists(File(path.join(arm64FlutterFramework, 'Flutter')));
|
|
||||||
final bool armv7FlutterBinaryExists = exists(File(path.join(armv7FlutterFramework, 'Flutter')));
|
|
||||||
if (!arm64FlutterBinaryExists && !armv7FlutterBinaryExists) {
|
|
||||||
throw TaskResult.failure('Expected debug Flutter engine artifact binary to exist');
|
|
||||||
}
|
|
||||||
|
|
||||||
final String debugAppFrameworkPath = path.join(
|
final String debugAppFrameworkPath = path.join(
|
||||||
outputPath,
|
outputPath,
|
||||||
@ -225,8 +211,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
|
|||||||
section("Check all modes' engine dylib");
|
section("Check all modes' engine dylib");
|
||||||
|
|
||||||
for (final String mode in <String>['Debug', 'Profile', 'Release']) {
|
for (final String mode in <String>['Debug', 'Profile', 'Release']) {
|
||||||
// TODO(jmagman): Remove ios-arm64_armv7 checks when armv7 engine artifacts are removed.
|
final String engineBinary = path.join(
|
||||||
final String arm64EngineBinary = path.join(
|
|
||||||
outputPath,
|
outputPath,
|
||||||
mode,
|
mode,
|
||||||
'Flutter.xcframework',
|
'Flutter.xcframework',
|
||||||
@ -234,23 +219,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
|
|||||||
'Flutter.framework',
|
'Flutter.framework',
|
||||||
'Flutter',
|
'Flutter',
|
||||||
);
|
);
|
||||||
|
await _checkBitcode(engineBinary, mode);
|
||||||
final String arm64Armv7EngineBinary = path.join(
|
|
||||||
outputPath,
|
|
||||||
mode,
|
|
||||||
'Flutter.xcframework',
|
|
||||||
'ios-arm64_armv7',
|
|
||||||
'Flutter.framework',
|
|
||||||
'Flutter',
|
|
||||||
);
|
|
||||||
|
|
||||||
if (exists(File(arm64EngineBinary))) {
|
|
||||||
await _checkBitcode(arm64EngineBinary, mode);
|
|
||||||
} else if (exists(File(arm64Armv7EngineBinary))) {
|
|
||||||
await _checkBitcode(arm64Armv7EngineBinary, mode);
|
|
||||||
} else {
|
|
||||||
throw TaskResult.failure('Expected Flutter $mode engine artifact binary to exist');
|
|
||||||
}
|
|
||||||
|
|
||||||
checkFileExists(path.join(
|
checkFileExists(path.join(
|
||||||
outputPath,
|
outputPath,
|
||||||
@ -285,12 +254,21 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
|
|||||||
);
|
);
|
||||||
|
|
||||||
await _checkDylib(pluginFrameworkPath);
|
await _checkDylib(pluginFrameworkPath);
|
||||||
await _checkBitcode(pluginFrameworkPath, mode);
|
|
||||||
if (!await _linksOnFlutter(pluginFrameworkPath)) {
|
if (!await _linksOnFlutter(pluginFrameworkPath)) {
|
||||||
throw TaskResult.failure('$pluginFrameworkPath does not link on Flutter');
|
throw TaskResult.failure('$pluginFrameworkPath does not link on Flutter');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(jmagman): Remove ios-arm64_armv7 checks when CI is updated to Xcode 14.
|
||||||
final String transitiveDependencyFrameworkPath = path.join(
|
final String transitiveDependencyFrameworkPath = path.join(
|
||||||
|
outputPath,
|
||||||
|
mode,
|
||||||
|
'Reachability.xcframework',
|
||||||
|
'ios-arm64',
|
||||||
|
'Reachability.framework',
|
||||||
|
'Reachability',
|
||||||
|
);
|
||||||
|
|
||||||
|
final String armv7TransitiveDependencyFrameworkPath = path.join(
|
||||||
outputPath,
|
outputPath,
|
||||||
mode,
|
mode,
|
||||||
'Reachability.xcframework',
|
'Reachability.xcframework',
|
||||||
@ -298,8 +276,17 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
|
|||||||
'Reachability.framework',
|
'Reachability.framework',
|
||||||
'Reachability',
|
'Reachability',
|
||||||
);
|
);
|
||||||
if (await _linksOnFlutter(transitiveDependencyFrameworkPath)) {
|
|
||||||
throw TaskResult.failure('Transitive dependency $transitiveDependencyFrameworkPath unexpectedly links on Flutter');
|
final bool transitiveDependencyExists = exists(File(transitiveDependencyFrameworkPath));
|
||||||
|
final bool armv7TransitiveDependencyExists = exists(File(armv7TransitiveDependencyFrameworkPath));
|
||||||
|
if (!transitiveDependencyExists && !armv7TransitiveDependencyExists) {
|
||||||
|
throw TaskResult.failure('Expected debug Flutter engine artifact binary to exist');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((transitiveDependencyExists && await _linksOnFlutter(transitiveDependencyFrameworkPath)) ||
|
||||||
|
(armv7TransitiveDependencyExists && await _linksOnFlutter(armv7TransitiveDependencyFrameworkPath))) {
|
||||||
|
throw TaskResult.failure(
|
||||||
|
'Transitive dependency $transitiveDependencyFrameworkPath unexpectedly links on Flutter');
|
||||||
}
|
}
|
||||||
|
|
||||||
checkFileExists(path.join(
|
checkFileExists(path.join(
|
||||||
@ -346,14 +333,6 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
|
|||||||
checkFileExists(simulatorFrameworkHeaderPath);
|
checkFileExists(simulatorFrameworkHeaderPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkDirectoryExists(path.join(
|
|
||||||
outputPath,
|
|
||||||
'Release',
|
|
||||||
'connectivity.xcframework',
|
|
||||||
'ios-arm64',
|
|
||||||
'BCSymbolMaps',
|
|
||||||
));
|
|
||||||
|
|
||||||
section('Check all modes have generated plugin registrant');
|
section('Check all modes have generated plugin registrant');
|
||||||
|
|
||||||
for (final String mode in <String>['Debug', 'Profile', 'Release']) {
|
for (final String mode in <String>['Debug', 'Profile', 'Release']) {
|
||||||
@ -369,7 +348,6 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
|
|||||||
'FlutterPluginRegistrant',
|
'FlutterPluginRegistrant',
|
||||||
);
|
);
|
||||||
await _checkStatic(registrantFrameworkPath);
|
await _checkStatic(registrantFrameworkPath);
|
||||||
await _checkBitcode(registrantFrameworkPath, mode);
|
|
||||||
|
|
||||||
checkFileExists(path.join(
|
checkFileExists(path.join(
|
||||||
outputPath,
|
outputPath,
|
||||||
|
@ -421,7 +421,6 @@ end
|
|||||||
if ((await fileType(builtFlutterBinary)).contains('armv7')) {
|
if ((await fileType(builtFlutterBinary)).contains('armv7')) {
|
||||||
throw TaskResult.failure('Unexpected armv7 architecture slice in $builtFlutterBinary');
|
throw TaskResult.failure('Unexpected armv7 architecture slice in $builtFlutterBinary');
|
||||||
}
|
}
|
||||||
await checkContainsBitcode(builtFlutterBinary);
|
|
||||||
|
|
||||||
final String builtAppBinary = path.join(
|
final String builtAppBinary = path.join(
|
||||||
archivedAppPath,
|
archivedAppPath,
|
||||||
@ -433,7 +432,6 @@ end
|
|||||||
if ((await fileType(builtAppBinary)).contains('armv7')) {
|
if ((await fileType(builtAppBinary)).contains('armv7')) {
|
||||||
throw TaskResult.failure('Unexpected armv7 architecture slice in $builtAppBinary');
|
throw TaskResult.failure('Unexpected armv7 architecture slice in $builtAppBinary');
|
||||||
}
|
}
|
||||||
await checkContainsBitcode(builtAppBinary);
|
|
||||||
|
|
||||||
// The host app example builds plugins statically, url_launcher_ios.framework
|
// The host app example builds plugins statically, url_launcher_ios.framework
|
||||||
// should not exist.
|
// should not exist.
|
||||||
|
@ -8,7 +8,6 @@ import 'dart:io';
|
|||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
import 'host_agent.dart';
|
import 'host_agent.dart';
|
||||||
import 'task_result.dart';
|
|
||||||
import 'utils.dart';
|
import 'utils.dart';
|
||||||
|
|
||||||
typedef SimulatorFunction = Future<void> Function(String deviceId);
|
typedef SimulatorFunction = Future<void> Function(String deviceId);
|
||||||
@ -85,12 +84,6 @@ Future<bool> containsBitcode(String pathToBinary) async {
|
|||||||
return !emptyBitcodeMarkerFound;
|
return !emptyBitcodeMarkerFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> checkContainsBitcode(String pathToBinary) async {
|
|
||||||
if (!await containsBitcode(pathToBinary)) {
|
|
||||||
throw TaskResult.failure('Expected bitcode in $pathToBinary');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Creates and boots a new simulator, passes the new simulator's identifier to
|
/// Creates and boots a new simulator, passes the new simulator's identifier to
|
||||||
/// `testFunction`.
|
/// `testFunction`.
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user