| # Copyright 2022 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| # |
| # Package for the Flutter embedder for Fuchsia. |
| |
| load( |
| "@rules_fuchsia//fuchsia:defs.bzl", |
| "fuchsia_cc_binary", |
| "fuchsia_cc_test", |
| "fuchsia_test_group", |
| "fuchsia_test_package", |
| "fuchsia_tests", |
| "fuchsia_component_manifest", |
| ) |
| load("@rules_cc//cc:defs.bzl", "cc_library") |
| |
| |
| cc_library( |
| name = "logging", |
| srcs = [ |
| "logging.h", |
| "fuchsia_logger.h", |
| "fuchsia_logger.cc" |
| ], |
| deps = [ |
| "@fuchsia_sdk//pkg/syslog" |
| ] |
| ) |
| |
| cc_library( |
| name = "embedder_state", |
| srcs = [ |
| "flatland_connection.h", |
| "software_surface.h", |
| "embedder_state.h" |
| ], |
| deps = [ |
| "//src/embedder/engine:embedder_header" |
| ] |
| ) |
| |
| cc_library( |
| name = "pointer_utility", |
| srcs = [ |
| ":logging", |
| "pointer_utility.h" |
| ], |
| deps = [ |
| "@fuchsia_sdk//pkg/trace", |
| "@fuchsia_sdk//pkg/trace-engine", |
| "@fuchsia_sdk//pkg/trace-provider-so" |
| ] |
| ) |
| |
| cc_library( |
| name = "mouse_delegate", |
| srcs = [ |
| "mouse_delegate.h", |
| "mouse_delegate.cc" |
| ], |
| deps = [ |
| ":logging", |
| ":pointer_utility", |
| "//src/embedder/engine:embedder_header", |
| "@fuchsia_sdk//fidl/fuchsia.ui.composition:fuchsia.ui.composition_cc", |
| ] |
| ) |
| |
| cc_library( |
| name = "touch_delegate", |
| srcs = [ |
| "touch_delegate.h", |
| "touch_delegate.cc" |
| ], |
| deps = [ |
| ":logging", |
| ":pointer_utility", |
| "//src/embedder/engine:embedder_header", |
| "@fuchsia_sdk//fidl/fuchsia.ui.composition:fuchsia.ui.composition_cc", |
| ] |
| ) |
| |
| |
| # ELF binary that takes the path to Flutter app assets as an argument |
| # and runs the Flutter app defined by those assets. |
| fuchsia_cc_binary( |
| name = "embedder", |
| srcs = [ |
| "flatland_connection.cc", |
| "flatland_ids.h", |
| "flatland_view_provider.h", |
| "keyboard.cc", |
| "keyboard.h", |
| "main.cc", |
| "platform_message_channels.h", |
| "pointer_utility.h", |
| "software_surface.cc", |
| "software_surface.h", |
| "text_delegate.cc", |
| "text_delegate.h", |
| "accessibility_bridge.cc", |
| "accessibility_bridge.h", |
| "root_inspect_node.cc", |
| "root_inspect_node.h", |
| "standard_message_codec/byte_buffer_streams.h", |
| "standard_message_codec/byte_streams.h", |
| "standard_message_codec/encodable_value.h", |
| "standard_message_codec/message_codec.h", |
| "standard_message_codec/method_call.h", |
| "standard_message_codec/method_codec.h", |
| "standard_message_codec/method_result.h", |
| "standard_message_codec/standard_codec_serializer.h", |
| "standard_message_codec/standard_message_codec.cc", |
| "standard_message_codec/standard_message_codec.h", |
| "standard_message_codec/standard_method_codec.h" |
| ], |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":logging", |
| ":embedder_state", |
| ":mouse_delegate", |
| ":touch_delegate", |
| "//src/embedder/engine:embedder_header", |
| "//src/embedder/engine:libflutter_engine_for_platform", |
| "@rapidjson", |
| "@fuchsia_sdk//fidl/fuchsia.fonts:fuchsia.fonts_cc", |
| "@fuchsia_sdk//fidl/fuchsia.sysmem:fuchsia.sysmem_cc", |
| "@fuchsia_sdk//fidl/fuchsia.ui.app:fuchsia.ui.app_cc", |
| "@fuchsia_sdk//fidl/fuchsia.ui.composition:fuchsia.ui.composition_cc", |
| "@fuchsia_sdk//pkg/async-loop-default", |
| "@fuchsia_sdk//pkg/async-loop-cpp", |
| "@fuchsia_sdk//pkg/fit", |
| "@fuchsia_sdk//pkg/scenic_cpp", |
| "@fuchsia_sdk//pkg/sys_cpp", |
| "@fuchsia_sdk//pkg/syslog", |
| "@fuchsia_sdk//pkg/trace", |
| "@fuchsia_sdk//pkg/trace-engine", |
| "@fuchsia_sdk//pkg/trace-provider-so" |
| ], |
| ) |
| |
| fuchsia_cc_test( |
| name = "mouse_delegate_unittests", |
| size = "small", |
| visibility = ["//visibility:public"], |
| srcs = [ "mouse_delegate_unittests.cc"], |
| deps = [ |
| "@com_google_googletest//:gtest_main", |
| ":logging", |
| ":embedder_state", |
| ":mouse_delegate", |
| "//src/embedder/test_util:mouse_event_builder", |
| "//src/embedder/engine:embedder_header", |
| "//src/embedder/engine:libflutter_engine_for_platform", |
| "@rapidjson", |
| "@fuchsia_sdk//fidl/fuchsia.fonts:fuchsia.fonts_cc", |
| "@fuchsia_sdk//fidl/fuchsia.sysmem:fuchsia.sysmem_cc", |
| "@fuchsia_sdk//fidl/fuchsia.ui.app:fuchsia.ui.app_cc", |
| "@fuchsia_sdk//fidl/fuchsia.ui.composition:fuchsia.ui.composition_cc", |
| "@fuchsia_sdk//fidl/fuchsia.accessibility.semantics:fuchsia.accessibility.semantics_cc", |
| "@fuchsia_sdk//pkg/sys_inspect_cpp", |
| "@fuchsia_sdk//pkg/async-loop-default", |
| "@fuchsia_sdk//pkg/async-loop-cpp", |
| "@fuchsia_sdk//pkg/fit", |
| "@fuchsia_sdk//pkg/scenic_cpp", |
| "@fuchsia_sdk//pkg/sys_cpp", |
| "@fuchsia_sdk//pkg/syslog", |
| "@fuchsia_sdk//pkg/trace", |
| "@fuchsia_sdk//pkg/trace-engine", |
| "@fuchsia_sdk//pkg/trace-provider-so", |
| "@fuchsia_sdk//pkg/fdio" |
| ], |
| ) |
| |
| fuchsia_cc_test( |
| name = "touch_delegate_unittests", |
| size = "small", |
| visibility = ["//visibility:public"], |
| srcs = ["touch_delegate_unittests.cc"], |
| deps = [ |
| "@com_google_googletest//:gtest_main", |
| ":logging", |
| ":embedder_state", |
| ":touch_delegate", |
| "//src/embedder/test_util:touch_event_builder", |
| "//src/embedder/engine:embedder_header", |
| "//src/embedder/engine:libflutter_engine_for_platform", |
| "@rapidjson", |
| "@fuchsia_sdk//fidl/fuchsia.fonts:fuchsia.fonts_cc", |
| "@fuchsia_sdk//fidl/fuchsia.sysmem:fuchsia.sysmem_cc", |
| "@fuchsia_sdk//fidl/fuchsia.ui.app:fuchsia.ui.app_cc", |
| "@fuchsia_sdk//fidl/fuchsia.ui.composition:fuchsia.ui.composition_cc", |
| "@fuchsia_sdk//pkg/async-loop-default", |
| "@fuchsia_sdk//pkg/async-loop-cpp", |
| "@fuchsia_sdk//pkg/fit", |
| "@fuchsia_sdk//pkg/scenic_cpp", |
| "@fuchsia_sdk//pkg/sys_cpp", |
| "@fuchsia_sdk//pkg/syslog", |
| "@fuchsia_sdk//pkg/trace", |
| "@fuchsia_sdk//pkg/trace-engine", |
| "@fuchsia_sdk//pkg/trace-provider-so", |
| "@fuchsia_sdk//pkg/fdio" |
| ], |
| ) |
| |
| fuchsia_test_package( |
| name = "mouse_delegate_unittests_pkg", |
| package_name = "mouse_delegate_unittests_pkg", |
| visibility = ["//visibility:public"], |
| deps = [ |
| "//src/embedder/engine:libflutter_engine_pkg_resource" |
| ], |
| components = [ |
| ":mouse_delegate_unittests" |
| ] |
| ) |
| |
| fuchsia_test_package( |
| name = "touch_delegate_unittests_pkg", |
| package_name = "touch_delegate_unittests_pkg", |
| visibility = ["//visibility:public"], |
| deps = [ |
| "//src/embedder/engine:libflutter_engine_pkg_resource" |
| ], |
| components = [ |
| ":touch_delegate_unittests" |
| ] |
| ) |
| |
| fuchsia_component_manifest( |
| name = "embedder_manifest", |
| src = "meta/embedder.cml", |
| includes = [ |
| "@fuchsia_sdk//pkg/syslog:client", |
| "@fuchsia_sdk//pkg/vulkan:client", |
| ], |
| visibility = ["//visibility:public"], |
| ) |