From 0b155a908bbb2e8a8b627c7e2d6a3f8ef37d6efb Mon Sep 17 00:00:00 2001 From: Xilai Zhang Date: Tue, 16 Aug 2022 15:33:08 -0700 Subject: [PATCH] [gn + generator ] add codesign configs for generator tasks in ios/artifacts.zip (flutter/engine#35417) --- .../sky/tools/create_full_ios_framework.py | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/sky/tools/create_full_ios_framework.py b/engine/src/flutter/sky/tools/create_full_ios_framework.py index 82aa7f5a29e..c90087ef152 100644 --- a/engine/src/flutter/sky/tools/create_full_ios_framework.py +++ b/engine/src/flutter/sky/tools/create_full_ios_framework.py @@ -165,9 +165,34 @@ def create_framework( ]) +def embed_codesign_configuration(config_path, contents): + with open(config_path, 'w') as f: + f.writelines(contents) + + def zip_archive(dst): + ios_file_with_entitlements = ['gen_snapshot_arm64\n'] + ios_file_without_entitlements = [ + 'Flutter.xcframework/ios-arm64/Flutter.framework/Flutter\n', + 'Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter\n' + ] + embed_codesign_configuration( + os.path.join(dst, 'entitlements.txt'), ios_file_with_entitlements + ) + + embed_codesign_configuration( + os.path.join(dst, 'without_entitlements.txt'), + ios_file_without_entitlements + ) + subprocess.check_call([ - 'zip', '-r', 'artifacts.zip', 'gen_snapshot_arm64', 'Flutter.xcframework' + 'zip', + '-r', + 'artifacts.zip', + 'gen_snapshot_arm64', + 'Flutter.xcframework', + 'entitlements.txt', + 'without_entitlements.txt', ], cwd=dst) if (os.path.exists(os.path.join(dst, 'Flutter.dSYM'))):