Fall back to global cache and platform if null when injected into constructor (#50370)
This commit is contained in:
@@ -298,6 +298,56 @@ Future<void> main() async {
|
||||
}
|
||||
}
|
||||
|
||||
// This builds all build modes' frameworks by default
|
||||
section('Build podspec');
|
||||
|
||||
const String cocoapodsOutputDirectoryName = 'flutter-frameworks-cocoapods';
|
||||
|
||||
await inDirectory(projectDir, () async {
|
||||
await flutter(
|
||||
'build',
|
||||
options: <String>[
|
||||
'ios-framework',
|
||||
'--cocoapods',
|
||||
'--force', // Allow podspec creation on master.
|
||||
'--output=$cocoapodsOutputDirectoryName'
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
final String cocoapodsOutputPath = path.join(projectDir.path, cocoapodsOutputDirectoryName);
|
||||
for (final String mode in <String>['Debug', 'Profile', 'Release']) {
|
||||
checkFileExists(path.join(
|
||||
cocoapodsOutputPath,
|
||||
mode,
|
||||
'Flutter.podspec',
|
||||
));
|
||||
|
||||
checkDirectoryExists(path.join(
|
||||
cocoapodsOutputPath,
|
||||
mode,
|
||||
'App.framework',
|
||||
));
|
||||
|
||||
checkDirectoryExists(path.join(
|
||||
cocoapodsOutputPath,
|
||||
mode,
|
||||
'FlutterPluginRegistrant.framework',
|
||||
));
|
||||
|
||||
checkDirectoryExists(path.join(
|
||||
cocoapodsOutputPath,
|
||||
mode,
|
||||
'device_info.framework',
|
||||
));
|
||||
|
||||
checkDirectoryExists(path.join(
|
||||
cocoapodsOutputPath,
|
||||
mode,
|
||||
'package_info.framework',
|
||||
));
|
||||
}
|
||||
|
||||
return TaskResult.success(null);
|
||||
} on TaskResult catch (taskResult) {
|
||||
return taskResult;
|
||||
|
||||
@@ -641,6 +641,13 @@ void checkFileNotExists(String file) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks that the directory exists, otherwise throws a [FileSystemException].
|
||||
void checkDirectoryExists(String directory) {
|
||||
if (!exists(Directory(directory))) {
|
||||
throw FileSystemException('Expected directory to exist.', directory);
|
||||
}
|
||||
}
|
||||
|
||||
/// Check that `collection` contains all entries in `values`.
|
||||
void checkCollectionContains<T>(Iterable<T> values, Iterable<T> collection) {
|
||||
for (final T value in values) {
|
||||
|
||||
Reference in New Issue
Block a user