mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[gn + codesign] move snapshot meta data to generators (flutter/engine#39726)
[gn + codesign] move snapshot meta data to generators
This commit is contained in:
parent
d2b6e2e0a6
commit
4bf5a04e84
@ -281,19 +281,8 @@ if (host_os == "win") {
|
||||
|
||||
# Archives Flutter Mac Artifacts
|
||||
if (is_mac) {
|
||||
generated_file("snapshot_entitlement_config") {
|
||||
outputs = [ "$target_gen_dir/snapshot_entitlements.txt" ]
|
||||
|
||||
data_keys = [ "snapshot_entitlement_file_path" ]
|
||||
|
||||
deps = [ "//flutter/lib/snapshot:create_macos_gen_snapshots" ]
|
||||
}
|
||||
|
||||
zip_bundle("archive_gen_snapshot") {
|
||||
deps = [
|
||||
":snapshot_entitlement_config",
|
||||
"//flutter/lib/snapshot:create_macos_gen_snapshots",
|
||||
]
|
||||
deps = [ "//flutter/lib/snapshot:create_macos_gen_snapshots" ]
|
||||
suffix = "-$flutter_runtime_mode"
|
||||
if (flutter_runtime_mode == "debug") {
|
||||
suffix = ""
|
||||
@ -304,10 +293,6 @@ if (is_mac) {
|
||||
source = "$root_out_dir/gen_snapshot_$target_cpu"
|
||||
destination = "gen_snapshot_$target_cpu"
|
||||
},
|
||||
{
|
||||
source = "$target_gen_dir/snapshot_entitlements.txt"
|
||||
destination = "entitlements.txt"
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@ -290,9 +290,6 @@ if (host_os == "mac" && target_os == "mac") {
|
||||
sources = [ "${host_output_dir}/gen_snapshot" ]
|
||||
outputs = [ "${root_out_dir}/gen_snapshot_${target_cpu}" ]
|
||||
deps = [ "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)" ]
|
||||
metadata = {
|
||||
snapshot_entitlement_file_path = [ "gen_snapshot_{$target_cpu}" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -67,7 +67,20 @@ def main():
|
||||
zip_archive(dst)
|
||||
|
||||
|
||||
def embed_codesign_configuration(config_path, contents):
|
||||
with open(config_path, 'w') as f:
|
||||
f.write('\n'.join(contents) + '\n')
|
||||
|
||||
|
||||
def zip_archive(dst):
|
||||
snapshot_filepath_with_entitlements = [
|
||||
'gen_snapshot_arm64', 'gen_snapshot_x64'
|
||||
]
|
||||
|
||||
embed_codesign_configuration(
|
||||
os.path.join(dst, 'entitlements.txt'), snapshot_filepath_with_entitlements
|
||||
)
|
||||
|
||||
subprocess.check_call([
|
||||
'zip',
|
||||
'-r',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user