-
Notifications
You must be signed in to change notification settings - Fork 6k
[ios] use python script to generate extension safe frameworks and code sign them #45781
Changes from all commits
a8796f7
2c1c1a0
981c5d0
5b2a9ac
cc5dc79
5160886
4679b92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,10 +106,49 @@ def main(): | |
args, dst, framework, arm64_framework, simulator_framework, | ||
simulator_x64_framework, simulator_arm64_framework | ||
) | ||
|
||
extension_safe_dst = os.path.join(dst, 'extension_safe') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here, I created a new subfolder under dst, extension safe frameworks are all moved into this subfolder. |
||
create_extension_safe_framework( | ||
args, extension_safe_dst, '%s_extension_safe' % arm64_out_dir, | ||
'%s_extension_safe' % simulator_x64_out_dir, | ||
'%s_extension_safe' % simulator_arm64_out_dir | ||
) | ||
|
||
generate_gen_snapshot(args, dst, x64_out_dir, arm64_out_dir) | ||
zip_archive(dst) | ||
return 0 | ||
|
||
def create_extension_safe_framework( # pylint: disable=too-many-arguments | ||
args, dst, arm64_out_dir, simulator_x64_out_dir, simulator_arm64_out_dir | ||
): | ||
framework = os.path.join(dst, 'Flutter.framework') | ||
simulator_framework = os.path.join(dst, 'sim', 'Flutter.framework') | ||
arm64_framework = os.path.join(arm64_out_dir, 'Flutter.framework') | ||
simulator_x64_framework = os.path.join( | ||
simulator_x64_out_dir, 'Flutter.framework' | ||
) | ||
simulator_arm64_framework = os.path.join( | ||
simulator_arm64_out_dir, 'Flutter.framework' | ||
) | ||
|
||
if not os.path.isdir(arm64_framework): | ||
print( | ||
'Cannot find extension safe iOS arm64 Framework at %s' % arm64_framework | ||
) | ||
return 1 | ||
|
||
if not os.path.isdir(simulator_x64_framework): | ||
print( | ||
'Cannot find extension safe iOS x64 simulator Framework at %s' % | ||
simulator_x64_framework | ||
) | ||
return 1 | ||
|
||
create_framework( | ||
args, dst, framework, arm64_framework, simulator_framework, | ||
simulator_x64_framework, simulator_arm64_framework | ||
) | ||
return 0 | ||
|
||
def create_framework( # pylint: disable=too-many-arguments | ||
args, dst, framework, arm64_framework, simulator_framework, | ||
|
@@ -173,7 +212,9 @@ def zip_archive(dst): | |
ios_file_with_entitlements = ['gen_snapshot_arm64'] | ||
ios_file_without_entitlements = [ | ||
'Flutter.xcframework/ios-arm64/Flutter.framework/Flutter', | ||
'Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter' | ||
'Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter', | ||
'extension_safe/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter', | ||
'extension_safe/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter' | ||
] | ||
embed_codesign_configuration( | ||
os.path.join(dst, 'entitlements.txt'), ios_file_with_entitlements | ||
|
@@ -192,12 +233,21 @@ def zip_archive(dst): | |
'Flutter.xcframework', | ||
'entitlements.txt', | ||
'without_entitlements.txt', | ||
'extension_safe/Flutter.framework', | ||
'extension_safe/Flutter.xcframework', | ||
'extension_safe/sim', | ||
], | ||
cwd=dst) | ||
if os.path.exists(os.path.join(dst, 'Flutter.dSYM')): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We explictly put the Flutter.dsym in a standalone zip file. So I thought we should do the same for extension safe dsym to keep it consistent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I think this is what is misleading. I don't think the zip file location mattered, they are not really useful here, they are later uploaded to a destination determined in the mac_ios_engine.json. After my change, both Flutter.dsym and extension_safe_Flutter.dsym are uploaded to ios/release, where Flutter.dsym used to be. |
||
subprocess.check_call(['zip', '-r', 'Flutter.dSYM.zip', 'Flutter.dSYM'], | ||
cwd=dst) | ||
|
||
if os.path.exists(os.path.join(dst, 'extension_safe', 'Flutter.dSYM')): | ||
subprocess.check_call([ | ||
'zip', '-r', 'extension_safe_Flutter.dSYM.zip', 'Flutter.dSYM' | ||
], | ||
cwd=dst) | ||
|
||
|
||
def process_framework(args, dst, framework, framework_binary): | ||
if args.dsym: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No needed anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, so i moved the Flutter.framework for extension_safe into the responding existing zips. In below python change
For example
debug extension_safe Flutter.framework is now moved under ios-debug/extension_safe