[gn + artifacts] embed Mac entitlement config in gen_snapshot.zip (flutter/engine#34702)

This commit is contained in:
Xilai Zhang
2022-07-18 10:56:07 -07:00
committed by GitHub
parent 8de89cd83f
commit 480b8230aa
2 changed files with 19 additions and 1 deletions

View File

@@ -194,6 +194,14 @@ 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" ]
}
group("macos_flutter_framework") {
deps = [
"//flutter/shell/platform/darwin/macos:macos_flutter_framework_archive",
@@ -201,7 +209,10 @@ if (is_mac) {
}
zip_bundle("archive_gen_snapshot") {
deps = [ "//flutter/lib/snapshot:create_macos_gen_snapshots" ]
deps = [
":snapshot_entitlement_config",
"//flutter/lib/snapshot:create_macos_gen_snapshots",
]
suffix = "-$flutter_runtime_mode"
if (flutter_runtime_mode == "debug") {
suffix = ""
@@ -212,6 +223,10 @@ 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"
},
]
}

View File

@@ -41,5 +41,8 @@ template("macos_gen_snapshots") {
"--arch",
invoker.arch,
]
metadata = {
snapshot_entitlement_file_path = [ "gen_snapshot_${invoker.arch}" ]
}
}
}