From 2a54bb02aa1ac1a1022f3bb8da546188ea2e3353 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Fri, 26 Feb 2021 13:16:03 -0800 Subject: [PATCH] Opt into CocoaPods parallel codesigning (#76833) --- packages/flutter_tools/lib/src/ios/xcodeproj.dart | 4 ++++ .../test/commands.shard/hermetic/build_macos_test.dart | 3 ++- .../test/commands.shard/permeable/create_test.dart | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/lib/src/ios/xcodeproj.dart b/packages/flutter_tools/lib/src/ios/xcodeproj.dart index 88d128055d..427f84ae25 100644 --- a/packages/flutter_tools/lib/src/ios/xcodeproj.dart +++ b/packages/flutter_tools/lib/src/ios/xcodeproj.dart @@ -172,6 +172,10 @@ List _xcodeBuildSettingsLines({ // This holds because requiresProjectRoot is true for this command xcodeBuildSettings.add('FLUTTER_APPLICATION_PATH=${globals.fs.path.normalize(project.directory.path)}'); + // Tell CocoaPods behavior to codesign in parallel with rest of scripts to speed it up. + // Value must be "true", not "YES". https://github.com/CocoaPods/CocoaPods/pull/6088 + xcodeBuildSettings.add('COCOAPODS_PARALLEL_CODE_SIGN=true'); + // Relative to FLUTTER_APPLICATION_PATH, which is [Directory.current]. if (targetOverride != null) { xcodeBuildSettings.add('FLUTTER_TARGET=$targetOverride'); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart index 1b7e86b319..d527504a91 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart @@ -274,7 +274,8 @@ void main() { 'TRACK_WIDGET_CREATION=true', 'TREE_SHAKE_ICONS=true', 'BUNDLE_SKSL_PATH=foo/bar.sksl.json', - 'PACKAGE_CONFIG=/.dart_tool/package_config.json' + 'PACKAGE_CONFIG=/.dart_tool/package_config.json', + 'COCOAPODS_PARALLEL_CODE_SIGN=true', ])); }, overrides: { FileSystem: () => fileSystem, diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index 7c87f795cc..ce2fd1fc33 100755 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -1056,6 +1056,7 @@ void main() { expect(xcodeConfig, contains('FLUTTER_ROOT=')); expect(xcodeConfig, contains('FLUTTER_APPLICATION_PATH=')); expect(xcodeConfig, contains('FLUTTER_TARGET=')); + expect(xcodeConfig, contains('COCOAPODS_PARALLEL_CODE_SIGN=true')); // Generated export environment variables script final String buildPhaseScriptPath = globals.fs.path.join('.ios', 'Flutter', 'flutter_export_environment.sh'); @@ -1065,6 +1066,7 @@ void main() { expect(buildPhaseScript, contains('FLUTTER_ROOT=')); expect(buildPhaseScript, contains('FLUTTER_APPLICATION_PATH=')); expect(buildPhaseScript, contains('FLUTTER_TARGET=')); + expect(buildPhaseScript, contains('COCOAPODS_PARALLEL_CODE_SIGN=true')); // Generated podspec final String podspecPath = globals.fs.path.join('.ios', 'Flutter', 'flutter_project.podspec'); @@ -1157,6 +1159,7 @@ void main() { final String xcodeConfig = xcodeConfigFile.readAsStringSync(); expect(xcodeConfig, contains('FLUTTER_ROOT=')); expect(xcodeConfig, contains('FLUTTER_APPLICATION_PATH=')); + expect(xcodeConfig, contains('COCOAPODS_PARALLEL_CODE_SIGN=true')); // App identification final String xcodeProjectPath = globals.fs.path.join('ios', 'Runner.xcodeproj', 'project.pbxproj'); expectExists(xcodeProjectPath);