Skip to content

Commit

Permalink
[gn + codesign] mac code sign configuration for FlutterMacOS.framewor…
Browse files Browse the repository at this point in the history
…k.zip (flutter#35707)

* embed codesign config in macos framework

* format files

* update path

* y flag for outer layer zip

* simplify structure

* format files
  • Loading branch information
XilaiZhang authored Feb 17, 2023
1 parent a37e27b commit 9c6993e
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions sky/tools/create_macos_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ def regenerate_symlinks(fat_framework):
)


def embed_codesign_configuration(config_path, content):
with open(config_path, 'w') as f:
f.write(content)


def process_framework(dst, args, fat_framework, fat_framework_binary):
if args.dsym:
dsym_out = os.path.splitext(fat_framework)[0] + '.dSYM'
Expand All @@ -146,9 +151,25 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):

# Zip FlutterMacOS.framework.
if args.zip:
macos_filepath_with_entitlements = ''
macos_filepath_without_entitlements = 'FlutterMacOS.framework/Versions/A/FlutterMacOS'

embed_codesign_configuration(
os.path.join(dst, 'entitlements.txt'), macos_filepath_with_entitlements
)

embed_codesign_configuration(
os.path.join(dst, 'without_entitlements.txt'),
macos_filepath_without_entitlements
)
subprocess.check_call([
'zip', '-r', '-y', 'FlutterMacOS.framework.zip',
'FlutterMacOS.framework'
'zip',
'-r',
'-y',
'FlutterMacOS.framework.zip',
'FlutterMacOS.framework',
'entitlements.txt',
'without_entitlements.txt',
],
cwd=dst)

Expand Down

0 comments on commit 9c6993e

Please sign in to comment.