Skip to content

Commit

Permalink
Check for Xcode 11 and Xcode 12 directory names in build_ios_framewor…
Browse files Browse the repository at this point in the history
…k_module_test (flutter#60045)
  • Loading branch information
jmagman authored Jun 23, 2020
1 parent c8e53b3 commit 8b79bb9
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions dev/devicelab/bin/tasks/build_ios_framework_module_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,36 @@ Future<void> main() async {
}
await _checkFrameworkArchs(debugAppFrameworkPath, 'Debug');

checkFileExists(path.join(
// Xcode changed the name of this generated directory in Xcode 12.
const String xcode11ArmDirectoryName = 'ios-armv7_arm64';
const String xcode12ArmDirectoryName = 'ios-arm64_armv7';

final String xcode11AppFrameworkDirectory = path.join(
outputPath,
'Debug',
'App.xcframework',
'ios-armv7_arm64',
xcode11ArmDirectoryName,
'App.framework',
'App',
));
);
final String xcode12AppFrameworkDirectory = path.join(
outputPath,
'Debug',
'App.xcframework',
xcode12ArmDirectoryName,
'App.framework',
'App',
);

// This seemed easier than an explicit Xcode version check.
String xcodeArmDirectoryName;
if (exists(File(xcode11AppFrameworkDirectory))) {
xcodeArmDirectoryName = xcode11ArmDirectoryName;
} else if (exists(File(xcode12AppFrameworkDirectory))) {
xcodeArmDirectoryName = xcode12ArmDirectoryName;
} else {
throw const FileSystemException('Expected App.framework binary to exist.');
}

checkFileExists(path.join(
outputPath,
Expand Down Expand Up @@ -158,7 +180,7 @@ Future<void> main() async {
outputPath,
mode,
'App.xcframework',
'ios-armv7_arm64',
xcodeArmDirectoryName,
'App.framework',
'App',
));
Expand Down Expand Up @@ -190,7 +212,7 @@ Future<void> main() async {
outputPath,
mode,
'Flutter.xcframework',
'ios-armv7_arm64',
xcodeArmDirectoryName,
'Flutter.framework',
'Flutter',
));
Expand Down Expand Up @@ -234,7 +256,7 @@ Future<void> main() async {
outputPath,
mode,
'device_info.xcframework',
'ios-armv7_arm64',
xcodeArmDirectoryName,
'device_info.framework',
'device_info',
));
Expand All @@ -243,7 +265,7 @@ Future<void> main() async {
outputPath,
mode,
'device_info.xcframework',
'ios-armv7_arm64',
xcodeArmDirectoryName,
'device_info.framework',
'Headers',
'DeviceInfoPlugin.h',
Expand Down Expand Up @@ -301,7 +323,7 @@ Future<void> main() async {
outputPath,
mode,
'FlutterPluginRegistrant.xcframework',
'ios-armv7_arm64',
xcodeArmDirectoryName,
'FlutterPluginRegistrant.framework',
'Headers',
'GeneratedPluginRegistrant.h',
Expand Down

0 comments on commit 8b79bb9

Please sign in to comment.