From 331dafdd04bd3c5ae1060c173091008ec1b28e22 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 25 Feb 2022 23:02:40 -0800 Subject: [PATCH 1/8] Generate windows flutter. --- build/archives/BUILD.gn | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/build/archives/BUILD.gn b/build/archives/BUILD.gn index 4aff1973b2224..d9fba7903969b 100644 --- a/build/archives/BUILD.gn +++ b/build/archives/BUILD.gn @@ -89,3 +89,40 @@ if (!is_fuchsia) { deps = [ "//flutter/web_sdk:flutter_web_sdk_archive" ] } } + +# Archives Flutter Windows Artifacts +if (host_os == "win") { + zip_bundle("windows_flutter") { + output = "$full_platform_name-$flutter_runtime_mode/$full_platform_name-flutter.zip" + deps = [ + "//flutter/shell/platform/common:publish_headers", + "//flutter/shell/platform/windows:flutter_windows", + ] + files = [ + { + source = "$root_out_dir/flutter_export.h" + destination = "flutter_export.h" + }, + { + source = "$root_out_dir/flutter_windows.h" + destination = "flutter_windows.h" + }, + { + source = "$root_out_dir/flutter_messenger.h" + destination = "flutter_messenger.h" + }, + { + source = "$root_out_dir/flutter_plugin_registrar.h" + destination = "flutter_plugin_registrar.h" + }, + { + source = "$root_out_dir/flutter_texture_registrar.h" + destination = "flutter_texture_registrar.h" + }, + { + source = "$root_out_dir/flutter_windows.dll" + destination = "flutter_windows.dll" + }, + ] + } +} From ce1af42dcc96366a210af313743345105fba6dcd Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 25 Feb 2022 23:10:16 -0800 Subject: [PATCH 2/8] Add additional dep to generate windows headers. --- build/archives/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/build/archives/BUILD.gn b/build/archives/BUILD.gn index d9fba7903969b..010cec22f0ba8 100644 --- a/build/archives/BUILD.gn +++ b/build/archives/BUILD.gn @@ -97,6 +97,7 @@ if (host_os == "win") { deps = [ "//flutter/shell/platform/common:publish_headers", "//flutter/shell/platform/windows:flutter_windows", + "//flutter/shell/platform/windows:publish_headers_windows", ] files = [ { From afdf9da42598d09b85ad655da6678874924d2cf2 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Sat, 26 Feb 2022 23:13:34 -0800 Subject: [PATCH 3/8] Archive windows client wrapper. --- .../platform/windows/client_wrapper/BUILD.gn | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/shell/platform/windows/client_wrapper/BUILD.gn b/shell/platform/windows/client_wrapper/BUILD.gn index 18cf24d75abd3..b08efd03dc979 100644 --- a/shell/platform/windows/client_wrapper/BUILD.gn +++ b/shell/platform/windows/client_wrapper/BUILD.gn @@ -97,3 +97,45 @@ executable("client_wrapper_windows_unittests") { "//third_party/dart/runtime:libdart_jit", ] } + +if (host_os == "win") { + client_wrapper_file_archive_list = [ + "core_implementations.cc", + "engine_method_result.cc", + "flutter_engine.cc", + "flutter_view_controller.cc", + "plugin_registrar.cc", + "README", + "standard_codec.cc", + ] + + zip_bundle("client_wrapper_archive") { + output = "$full_platform_name/flutter-cpp-client-wrapper.zip" + deps = [ + ":client_wrapper_windows", + "//flutter/shell/platform/common/client_wrapper:client_wrapper", + ] + tmp_files = [] + foreach(source, client_wrapper_file_archive_list) { + tmp_files += [ + { + source = "//flutter/shell/platform/common/client_wrapper/$source" + destination = "cpp_client_wrapper/$source" + }, + ] + } + sources = core_cpp_client_wrapper_includes + + core_cpp_client_wrapper_internal_headers + foreach(source, sources) { + rebased_path = + rebase_path(source, "//flutter/shell/platform/common/client_wrapper") + tmp_files += [ + { + source = source + destination = "cpp_client_wrapper/$rebased_path" + }, + ] + } + files = tmp_files + } +} From 2adcda590af4c696f353587e2170445252735055 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Sat, 26 Feb 2022 23:41:19 -0800 Subject: [PATCH 4/8] Import zip_bundle. --- shell/platform/windows/client_wrapper/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/platform/windows/client_wrapper/BUILD.gn b/shell/platform/windows/client_wrapper/BUILD.gn index b08efd03dc979..9623ffaaca6ed 100644 --- a/shell/platform/windows/client_wrapper/BUILD.gn +++ b/shell/platform/windows/client_wrapper/BUILD.gn @@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//flutter/build/zip_bundle.gni") import("//flutter/shell/platform/common/client_wrapper/publish.gni") import("//flutter/testing/testing.gni") From 6fef33f67e1de17ae98e86c30bdee0f288f7c944 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Sun, 27 Feb 2022 00:35:26 -0800 Subject: [PATCH 5/8] Add publish dependency. --- shell/platform/windows/client_wrapper/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/platform/windows/client_wrapper/BUILD.gn b/shell/platform/windows/client_wrapper/BUILD.gn index 9623ffaaca6ed..81a312125174c 100644 --- a/shell/platform/windows/client_wrapper/BUILD.gn +++ b/shell/platform/windows/client_wrapper/BUILD.gn @@ -115,6 +115,7 @@ if (host_os == "win") { deps = [ ":client_wrapper_windows", "//flutter/shell/platform/common/client_wrapper:client_wrapper", + "//flutter/shell/platform/common/client_wrapper:publish_wrapper_windows", ] tmp_files = [] foreach(source, client_wrapper_file_archive_list) { From b8211fb9432759a5263fe811e0e3c1bb5911258a Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Sun, 27 Feb 2022 13:18:50 -0800 Subject: [PATCH 6/8] Update to correct dependency. --- shell/platform/windows/client_wrapper/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/windows/client_wrapper/BUILD.gn b/shell/platform/windows/client_wrapper/BUILD.gn index 81a312125174c..f55999452b1de 100644 --- a/shell/platform/windows/client_wrapper/BUILD.gn +++ b/shell/platform/windows/client_wrapper/BUILD.gn @@ -115,7 +115,7 @@ if (host_os == "win") { deps = [ ":client_wrapper_windows", "//flutter/shell/platform/common/client_wrapper:client_wrapper", - "//flutter/shell/platform/common/client_wrapper:publish_wrapper_windows", + "//flutter/shell/platform/windows/client_wrapper:publish_wrapper_windows", ] tmp_files = [] foreach(source, client_wrapper_file_archive_list) { From 402fca1573e5e9751fa92022d4d3f26c821b3750 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Sun, 27 Feb 2022 17:19:14 -0800 Subject: [PATCH 7/8] Process windows specific files differently from common ones. --- .../platform/windows/client_wrapper/BUILD.gn | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/shell/platform/windows/client_wrapper/BUILD.gn b/shell/platform/windows/client_wrapper/BUILD.gn index f55999452b1de..9bfb01bbab973 100644 --- a/shell/platform/windows/client_wrapper/BUILD.gn +++ b/shell/platform/windows/client_wrapper/BUILD.gn @@ -103,13 +103,16 @@ if (host_os == "win") { client_wrapper_file_archive_list = [ "core_implementations.cc", "engine_method_result.cc", - "flutter_engine.cc", - "flutter_view_controller.cc", "plugin_registrar.cc", "README", "standard_codec.cc", ] + win_client_wrapper_file_archive_list = [ + "flutter_engine.cc", + "flutter_view_controller.cc", + ] + zip_bundle("client_wrapper_archive") { output = "$full_platform_name/flutter-cpp-client-wrapper.zip" deps = [ @@ -126,14 +129,24 @@ if (host_os == "win") { }, ] } - sources = core_cpp_client_wrapper_includes + + + # Windows specific source code files + foreach(source, win_client_wrapper_file_archive_list) { + tmp_files += [ + { + source = "//flutter/shell/platform/windows/client_wrapper/$source" + destination = "cpp_client_wrapper/$source" + }, + ] + } + headers = core_cpp_client_wrapper_includes + core_cpp_client_wrapper_internal_headers - foreach(source, sources) { + foreach(header, headers) { rebased_path = - rebase_path(source, "//flutter/shell/platform/common/client_wrapper") + rebase_path(header, "//flutter/shell/platform/common/client_wrapper") tmp_files += [ { - source = source + source = header destination = "cpp_client_wrapper/$rebased_path" }, ] From 2db25d22debc2bac0c50b5f7f6f6366c27e713ba Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Mon, 28 Feb 2022 19:06:10 -0800 Subject: [PATCH 8/8] Remove unnecessary if clause. --- .../platform/windows/client_wrapper/BUILD.gn | 96 +++++++++---------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/shell/platform/windows/client_wrapper/BUILD.gn b/shell/platform/windows/client_wrapper/BUILD.gn index 9bfb01bbab973..02724a5083f31 100644 --- a/shell/platform/windows/client_wrapper/BUILD.gn +++ b/shell/platform/windows/client_wrapper/BUILD.gn @@ -99,58 +99,56 @@ executable("client_wrapper_windows_unittests") { ] } -if (host_os == "win") { - client_wrapper_file_archive_list = [ - "core_implementations.cc", - "engine_method_result.cc", - "plugin_registrar.cc", - "README", - "standard_codec.cc", - ] +client_wrapper_file_archive_list = [ + "core_implementations.cc", + "engine_method_result.cc", + "plugin_registrar.cc", + "README", + "standard_codec.cc", +] - win_client_wrapper_file_archive_list = [ - "flutter_engine.cc", - "flutter_view_controller.cc", +win_client_wrapper_file_archive_list = [ + "flutter_engine.cc", + "flutter_view_controller.cc", +] + +zip_bundle("client_wrapper_archive") { + output = "$full_platform_name/flutter-cpp-client-wrapper.zip" + deps = [ + ":client_wrapper_windows", + ":publish_wrapper_windows", + "//flutter/shell/platform/common/client_wrapper:client_wrapper", ] + tmp_files = [] + foreach(source, client_wrapper_file_archive_list) { + tmp_files += [ + { + source = "//flutter/shell/platform/common/client_wrapper/$source" + destination = "cpp_client_wrapper/$source" + }, + ] + } - zip_bundle("client_wrapper_archive") { - output = "$full_platform_name/flutter-cpp-client-wrapper.zip" - deps = [ - ":client_wrapper_windows", - "//flutter/shell/platform/common/client_wrapper:client_wrapper", - "//flutter/shell/platform/windows/client_wrapper:publish_wrapper_windows", + # Windows specific source code files + foreach(source, win_client_wrapper_file_archive_list) { + tmp_files += [ + { + source = "//flutter/shell/platform/windows/client_wrapper/$source" + destination = "cpp_client_wrapper/$source" + }, + ] + } + headers = core_cpp_client_wrapper_includes + + core_cpp_client_wrapper_internal_headers + foreach(header, headers) { + rebased_path = + rebase_path(header, "//flutter/shell/platform/common/client_wrapper") + tmp_files += [ + { + source = header + destination = "cpp_client_wrapper/$rebased_path" + }, ] - tmp_files = [] - foreach(source, client_wrapper_file_archive_list) { - tmp_files += [ - { - source = "//flutter/shell/platform/common/client_wrapper/$source" - destination = "cpp_client_wrapper/$source" - }, - ] - } - - # Windows specific source code files - foreach(source, win_client_wrapper_file_archive_list) { - tmp_files += [ - { - source = "//flutter/shell/platform/windows/client_wrapper/$source" - destination = "cpp_client_wrapper/$source" - }, - ] - } - headers = core_cpp_client_wrapper_includes + - core_cpp_client_wrapper_internal_headers - foreach(header, headers) { - rebased_path = - rebase_path(header, "//flutter/shell/platform/common/client_wrapper") - tmp_files += [ - { - source = header - destination = "cpp_client_wrapper/$rebased_path" - }, - ] - } - files = tmp_files } + files = tmp_files }