blob: 101a758d6d02c9c249339b264869b9cfe89784db [file] [log] [blame]
# Copyright 2020 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.
import("//build/components.gni")
import("//build/rust/rustc_binary.gni")
rustc_binary("element_manager_bin") {
name = "element_manager"
with_unit_tests = true
edition = "2021"
deps = [
":element_config",
"//sdk/fidl/fuchsia.component:fuchsia.component-rustc",
"//sdk/fidl/fuchsia.data:fuchsia.data-rustc",
"//sdk/fidl/fuchsia.element:fuchsia.element-rustc",
"//sdk/fidl/fuchsia.element:fuchsia.element-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app-rustc",
"//sdk/fidl/fuchsia.ui.scenic:fuchsia.ui.scenic-rustc",
"//src/lib/async-utils",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/ui/fuchsia-scenic",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/session/lib/realm_management",
"//src/sys/lib/fidl-connector",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:derivative",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//src/lib/test_util",
"//src/session/testing",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:lazy_static",
]
sources = [
"src/annotation.rs",
"src/element.rs",
"src/element_manager.rs",
"src/main.rs",
]
}
# The Element Manager component is undergoing a breaking change. Previous
# versions consumed the `fuchsia.component.Realm` protocol from the framework.
# However, this behavior has been changed to instead consume the protocol
# from parent, delegating the necessary routing to the session. All clients of
# the Element Manager component are to move to use this version. In order to
# facilitate this transition, the deprecated version of the component is kept.
#
# TODO(http://fxbug.dev/95841): Remove `meta/base.shard.cml`
# and deprecated component manifest.
fuchsia_component_manifest("manifest") {
component_name = "element_manager"
manifest = "meta/element_manager.cml"
}
fuchsia_structured_config_rust_lib("element_config") {
cm_label = ":manifest"
}
fuchsia_structured_config_values("sc_values") {
cm_label = ":manifest"
values = {
elements_collection_name = "elements"
}
}
fuchsia_component("element_manager_comp") {
cm_label = ":manifest"
deps = [ ":element_manager_bin" ]
}
# The Element Manager component is undergoing a breaking change. Previous
# versions consumed the `fuchsia.component.Realm` protocol from the framework.
# However, this behavior has been changed to instead consume the protocol
# from parent, delegating the necessary routing to the session. All clients of
# the Element Manager component are to move to use this version. In order to
# facilitate this transition, the deprecated version of the component is kept.
#
# TODO(http://fxbug.dev/95841): Remove `new_element_manager` related GN targets.
fuchsia_component_manifest("new_element_manager_manifest") {
component_name = "new_element_manager"
manifest = "meta/element_manager.cml"
}
fuchsia_structured_config_values("new_element_manager_sc_values") {
cm_label = ":new_element_manager_manifest"
values = {
elements_collection_name = "elements"
}
}
fuchsia_component("new_element_manager_comp") {
cm_label = ":new_element_manager_manifest"
deps = [ ":element_manager_bin" ]
}
fuchsia_package("element_manager") {
deps = [
":element_manager_comp",
":new_element_manager_comp",
":new_element_manager_sc_values",
":sc_values",
]
}
fuchsia_unittest_package("element_manager_tests") {
manifest = "meta/element_manager_bin_test.cml"
deps = [ ":element_manager_bin_test" ]
}