From 6e5a530737467159764ef4aad238b030ffef6c08 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Tue, 28 Mar 2023 16:10:06 -0700 Subject: [PATCH] Add flags to make App.framework work in app extension (#123618) Add flags to make App.framework work in app extension --- packages/flutter_tools/lib/src/base/build.dart | 1 + packages/flutter_tools/lib/src/build_system/targets/ios.dart | 1 + .../flutter_tools/lib/src/build_system/targets/macos.dart | 1 + .../flutter_tools/test/general.shard/base/build_test.dart | 1 + .../test/general.shard/build_system/targets/common_test.dart | 1 + .../test/general.shard/build_system/targets/ios_test.dart | 2 ++ .../test/general.shard/build_system/targets/macos_test.dart | 4 ++++ 7 files changed, 11 insertions(+) diff --git a/packages/flutter_tools/lib/src/base/build.dart b/packages/flutter_tools/lib/src/base/build.dart index f169082dcc..0823e3b051 100644 --- a/packages/flutter_tools/lib/src/base/build.dart +++ b/packages/flutter_tools/lib/src/base/build.dart @@ -300,6 +300,7 @@ class AOTSnapshotter { '-dynamiclib', '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-o', appLib, assemblyO, diff --git a/packages/flutter_tools/lib/src/build_system/targets/ios.dart b/packages/flutter_tools/lib/src/build_system/targets/ios.dart index 392bc616d4..9146f0bfa1 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/ios.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/ios.dart @@ -677,6 +677,7 @@ Future _createStubAppFramework(File outputFile, Environment environment, '-miphonesimulator-version-min=11.0', '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-isysroot', sdkRoot, '-o', outputFile.path, diff --git a/packages/flutter_tools/lib/src/build_system/targets/macos.dart b/packages/flutter_tools/lib/src/build_system/targets/macos.dart index a107f2f834..9aaf236b3f 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/macos.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/macos.dart @@ -206,6 +206,7 @@ static const int Moo = 88; '-dynamiclib', '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-o', outputFile.path, ]); diff --git a/packages/flutter_tools/test/general.shard/base/build_test.dart b/packages/flutter_tools/test/general.shard/base/build_test.dart index 967c216e31..0bd658bb2f 100644 --- a/packages/flutter_tools/test/general.shard/base/build_test.dart +++ b/packages/flutter_tools/test/general.shard/base/build_test.dart @@ -40,6 +40,7 @@ const List kDefaultClang = [ '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-o', diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart index 3f1cef4cfd..e128dc4aec 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart @@ -511,6 +511,7 @@ void main() { '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-o', diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart index 314242fa83..2e1121f06f 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart @@ -31,6 +31,7 @@ const List _kSharedConfig = [ '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-isysroot', @@ -95,6 +96,7 @@ void main() { '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-isysroot', diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart index 7196e88537..176b76b9ad 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart @@ -385,6 +385,7 @@ void main() { '-dynamiclib', '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-o', environment.buildDir @@ -417,6 +418,7 @@ void main() { '-dynamiclib', '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-o', environment.buildDir @@ -474,6 +476,7 @@ void main() { 'xcrun', 'clang', '-arch', 'arm64', '-dynamiclib', '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-o', environment.buildDir.childFile('arm64/App.framework/App').path, environment.buildDir.childFile('arm64/snapshot_assembly.o').path, @@ -482,6 +485,7 @@ void main() { 'xcrun', 'clang', '-arch', 'x86_64', '-dynamiclib', '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks', + '-fapplication-extension', '-install_name', '@rpath/App.framework/App', '-o', environment.buildDir.childFile('x86_64/App.framework/App').path, environment.buildDir.childFile('x86_64/snapshot_assembly.o').path,