rsync Flutter.framework for add to app (#83315)

This commit is contained in:
Jenn Magder 2021-05-25 10:49:02 -07:00 committed by GitHub
parent e566356ea1
commit 2d86249435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -57,6 +57,8 @@ Future<void> main() async {
);
});
checkDirectoryExists(path.join(projectDir.path, '.ios', 'Flutter', 'engine', 'Flutter.xcframework'));
final Directory ephemeralIOSHostApp = Directory(path.join(
projectDir.path,
'build',
@ -90,6 +92,8 @@ Future<void> main() async {
);
});
checkDirectoryExists(path.join(projectDir.path, '.ios', 'Flutter', 'engine', 'Flutter.xcframework'));
if (!exists(ephemeralIOSHostApp)) {
return TaskResult.failure('Failed to build ephemeral host .app');
}
@ -126,6 +130,7 @@ Future<void> main() async {
if (!exists(ephemeralSimulatorHostApp)) {
return TaskResult.failure('Failed to build ephemeral host .app');
}
checkFileExists(path.join(ephemeralSimulatorHostApp.path, 'Frameworks', 'Flutter.framework', 'Flutter'));
if (!exists(File(path.join(
ephemeralSimulatorHostApp.path,
@ -170,6 +175,7 @@ Future<void> main() async {
options: <String>['ios', '--no-codesign', '-v'],
);
});
checkDirectoryExists(path.join(projectDir.path, '.ios', 'Flutter', 'engine', 'Flutter.xcframework'));
final bool ephemeralHostAppWithCocoaPodsBuilt = exists(ephemeralIOSHostApp);
@ -189,6 +195,7 @@ Future<void> main() async {
}
checkFileExists(path.join(ephemeralIOSHostApp.path, 'Frameworks', 'device_info.framework', 'device_info'));
checkFileExists(path.join(ephemeralIOSHostApp.path, 'Frameworks', 'Flutter.framework', 'Flutter'));
// Static, no embedded framework.
checkDirectoryNotExists(path.join(ephemeralIOSHostApp.path, 'Frameworks', 'google_sign_in.framework'));

View File

@ -144,8 +144,7 @@ is set to release or run \"flutter build ios --release\", then re-run Archive fr
# TODO(jmagman): use assemble copied engine in add-to-app.
if [[ -e "${project_path}/.ios" ]]; then
RunCommand rm -rf -- "${derived_dir}/engine/Flutter.framework"
RunCommand cp -r -- "${flutter_framework}" "${derived_dir}/engine"
RunCommand rsync -av --delete --filter "- .DS_Store" "${flutter_framework}" "${derived_dir}/engine"
fi
RunCommand pushd "${project_path}" > /dev/null