Native assets: package in framework on iOS and MacOS (#140907)

Packages the native assets for iOS and MacOS in frameworks.

Issue:

* https://github.com/flutter/flutter/issues/140544
* https://github.com/flutter/flutter/issues/129757

## Details

* [x] This packages dylibs from the native assets feature in frameworks. It packages every dylib in a separate framework.
* [x] The dylib name is updated to use `@rpath` instead of `@executable_path`.
* [x] The dylibs for flutter-tester are no longer modified to change the install name. (Previously it was wrongly updating the install name to the location the dylib would have once deployed in an app.)
* [x] Use symlinking on MacOS.
This commit is contained in:
Daco Harkes
2024-01-19 21:29:13 +01:00
committed by GitHub
parent 77c3807c80
commit 2e229be2ff
9 changed files with 479 additions and 107 deletions

View File

@@ -250,9 +250,7 @@ dependencies:
checkDirectoryNotExists(path.join(ephemeralIOSHostApp.path, 'Frameworks', '$dartPluginName.framework'));
// Native assets embedded, no embedded framework.
const String libFfiPackageDylib = 'lib$ffiPackageName.dylib';
checkFileExists(path.join(ephemeralIOSHostApp.path, 'Frameworks', libFfiPackageDylib));
checkDirectoryNotExists(path.join(ephemeralIOSHostApp.path, 'Frameworks', '$ffiPackageName.framework'));
checkFileExists(path.join(ephemeralIOSHostApp.path, 'Frameworks', '$ffiPackageName.framework', ffiPackageName));
section('Clean and pub get module');
@@ -385,7 +383,8 @@ end
checkFileExists(path.join(
hostFrameworksDirectory,
libFfiPackageDylib,
'$ffiPackageName.framework',
ffiPackageName,
));
section('Check the NOTICE file is correct');
@@ -491,7 +490,8 @@ end
checkFileExists(path.join(
archivedAppPath,
'Frameworks',
libFfiPackageDylib,
'$ffiPackageName.framework',
ffiPackageName,
));
// The host app example builds plugins statically, url_launcher_ios.framework