Unverified Commit bfbb3476 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Use BUILD_LIBRARY_FOR_DISTRIBUTION build setting for generating add-to-app frameworks (#50536)

parent 0a38f29c
...@@ -218,7 +218,7 @@ Future<void> main() async { ...@@ -218,7 +218,7 @@ Future<void> main() async {
); );
} }
section("Check all modes' have plugin dylib"); section('Check all modes have plugins');
for (final String mode in <String>['Debug', 'Profile', 'Release']) { for (final String mode in <String>['Debug', 'Profile', 'Release']) {
final String pluginFrameworkPath = path.join( final String pluginFrameworkPath = path.join(
...@@ -238,6 +238,17 @@ Future<void> main() async { ...@@ -238,6 +238,17 @@ Future<void> main() async {
'device_info.framework', 'device_info.framework',
'device_info', 'device_info',
)); ));
checkFileExists(path.join(
outputPath,
mode,
'device_info.xcframework',
'ios-armv7_arm64',
'device_info.framework',
'Headers',
'DeviceInfoPlugin.h',
));
final String simulatorFrameworkPath = path.join( final String simulatorFrameworkPath = path.join(
outputPath, outputPath,
mode, mode,
...@@ -246,10 +257,23 @@ Future<void> main() async { ...@@ -246,10 +257,23 @@ Future<void> main() async {
'device_info.framework', 'device_info.framework',
'device_info', 'device_info',
); );
final String simulatorFrameworkHeaderPath = path.join(
outputPath,
mode,
'device_info.xcframework',
'ios-x86_64-simulator',
'device_info.framework',
'Headers',
'DeviceInfoPlugin.h',
);
if (mode == 'Debug') { if (mode == 'Debug') {
checkFileExists(simulatorFrameworkPath); checkFileExists(simulatorFrameworkPath);
checkFileExists(simulatorFrameworkHeaderPath);
} else { } else {
checkFileNotExists(simulatorFrameworkPath); checkFileNotExists(simulatorFrameworkPath);
checkFileNotExists(simulatorFrameworkHeaderPath);
} }
} }
......
...@@ -475,7 +475,8 @@ end ...@@ -475,7 +475,8 @@ end
'-destination generic/platform=iOS', '-destination generic/platform=iOS',
'SYMROOT=${iPhoneBuildOutput.path}', 'SYMROOT=${iPhoneBuildOutput.path}',
'BITCODE_GENERATION_MODE=$bitcodeGenerationMode', 'BITCODE_GENERATION_MODE=$bitcodeGenerationMode',
'ONLY_ACTIVE_ARCH=NO' // No device targeted, so build all valid architectures. 'ONLY_ACTIVE_ARCH=NO', // No device targeted, so build all valid architectures.
'BUILD_LIBRARY_FOR_DISTRIBUTION=YES',
]; ];
RunResult buildPluginsResult = await processUtils.run( RunResult buildPluginsResult = await processUtils.run(
...@@ -500,8 +501,8 @@ end ...@@ -500,8 +501,8 @@ end
'-destination generic/platform=iOS', '-destination generic/platform=iOS',
'SYMROOT=${simulatorBuildOutput.path}', 'SYMROOT=${simulatorBuildOutput.path}',
'ARCHS=x86_64', 'ARCHS=x86_64',
'ONLY_ACTIVE_ARCH=NO' 'ONLY_ACTIVE_ARCH=NO', // No device targeted, so build all valid architectures.
// No device targeted, so build all valid architectures. 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES',
]; ];
buildPluginsResult = await processUtils.run( buildPluginsResult = await processUtils.run(
......
...@@ -10,17 +10,5 @@ target 'Runner' do ...@@ -10,17 +10,5 @@ target 'Runner' do
install_flutter_plugin_pods flutter_application_path install_flutter_plugin_pods flutter_application_path
end end
post_install do |installer|
installer.pods_project.targets.each do |target|
# Aggregate targets do not have a headers build phase.
if target.respond_to?('headers_build_phase')
target.headers_build_phase.files.each do |file|
# Make headers public so they can be imported by the host application.
file.settings = { 'ATTRIBUTES' => ['Public'] }
end
end
end
end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true install! 'cocoapods', :disable_input_output_paths => true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment