diff --git a/engine/src/flutter/build/archives/BUILD.gn b/engine/src/flutter/build/archives/BUILD.gn index 010cec22f0b..54bf8676781 100644 --- a/engine/src/flutter/build/archives/BUILD.gn +++ b/engine/src/flutter/build/archives/BUILD.gn @@ -127,3 +127,12 @@ if (host_os == "win") { ] } } + +# Archives Flutter Mac Artifacts +if (is_mac) { + group("macos_flutter_framework") { + deps = [ + "//flutter/shell/platform/darwin/macos:macos_flutter_framework_archive", + ] + } +} diff --git a/engine/src/flutter/build/zip_bundle.gni b/engine/src/flutter/build/zip_bundle.gni index d04cd2f5373..034aaba76da 100644 --- a/engine/src/flutter/build/zip_bundle.gni +++ b/engine/src/flutter/build/zip_bundle.gni @@ -42,6 +42,7 @@ template("zip_bundle") { script = "//flutter/build/zip.py" outputs = [ "$root_build_dir/zip_archives/${invoker.output}" ] sources = [] + forward_variables_from(invoker, [ "visibility" ]) deps = invoker.deps args = [ @@ -84,14 +85,18 @@ template("zip_bundle") { template("zip_bundle_from_file") { assert(defined(invoker.output), "output must be defined") assert(defined(invoker.files), "files must be defined as a list of scopes") + action(target_name) { + forward_variables_from(invoker, + [ + "visibility", + "deps", + ]) script = "//flutter/build/zip.py" outputs = [ "$root_build_dir/zip_archives/${invoker.output}" ] sources = [] - deps = invoker.deps location_source_path = "$target_gen_dir/zip_bundle.txt" write_file(location_source_path, invoker.files, "json") - args = [ "-o", rebase_path(outputs[0]), diff --git a/engine/src/flutter/shell/platform/darwin/macos/BUILD.gn b/engine/src/flutter/shell/platform/darwin/macos/BUILD.gn index fc77383826d..302c9d02878 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/BUILD.gn +++ b/engine/src/flutter/shell/platform/darwin/macos/BUILD.gn @@ -5,6 +5,7 @@ assert(is_mac) import("//build/config/mac/mac_sdk.gni") +import("//flutter/build/zip_bundle.gni") import("//flutter/shell/gpu/gpu.gni") import("//flutter/shell/platform/darwin/common/framework_shared.gni") import("//flutter/shell/platform/glfw/config.gni") @@ -273,7 +274,10 @@ copy("copy_license") { action("_generate_symlinks") { visibility = [ ":*" ] script = "//build/config/mac/package_framework.py" - outputs = [ "$root_build_dir/$_flutter_framework_name.stamp" ] + outputs = [ + "$root_build_dir/$_flutter_framework_name.stamp", + "$root_out_dir/$_flutter_framework_filename", + ] args = [ "--framework", "$_flutter_framework_filename", @@ -317,3 +321,33 @@ if (build_glfw_shell) { public_configs = [ "//flutter:config" ] } } + +zip_bundle("zip_macos_flutter_framework") { + output = "FlutterMacOS.framework.zip" + visibility = [ ":*" ] + deps = [ ":_generate_symlinks" ] + files = [ + { + source = "$root_out_dir/FlutterMacOS.framework" + destination = "FlutterMacOS.framework.zip" + }, + ] +} + +zip_bundle("macos_flutter_framework_archive") { + output = "$full_platform_name/FlutterMacOS.framework.zip" + deps = [ + ":copy_framework_podspec", + ":zip_macos_flutter_framework", + ] + files = [ + { + source = "$root_out_dir/zip_archives/FlutterMacOS.framework.zip" + destination = "FlutterMacOS.framework.zip" + }, + { + source = "$root_out_dir/FlutterMacOS.podspec" + destination = "FlutterMacOS.podspec" + }, + ] +}