| # Copyright 2019 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") |
| import("//build/rust/rustc_library.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| import("//third_party/cobalt/metrics_registry.gni") |
| |
| core_shard("terminal_core_shard") { |
| shard_file = "meta/terminal.core_shard.cml" |
| } |
| |
| core_shard("smart_session_from_platform_core_shard") { |
| shard_file = "meta/session.smart.from_platform.core_shard.cml" |
| } |
| |
| metrics_registry("session_framework_metrics_registry") { |
| # This must match the ID of our Cobalt project as specified in: |
| # third_party/cobalt_config/projects.yaml |
| project_id = 2550112954 |
| generate_rust = true |
| namespace = "cobalt_registry" |
| generate_binarypb = false |
| } |
| |
| rustc_library("lib") { |
| name = "session_manager_lib" |
| with_unit_tests = true |
| edition = "2021" |
| |
| visibility = [ |
| "//src/session/bin/session_manager/*", |
| "//src/session/examples/*", |
| "//src/session/tests/session_manager/*", |
| "//src/session/tools/*", |
| ] |
| |
| deps = [ |
| ":session_framework_metrics_registry_rustlib", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust", |
| "//sdk/fidl/fuchsia.power.broker:fuchsia.power.broker_rust", |
| "//sdk/fidl/fuchsia.power.system:fuchsia.power.system_rust", |
| "//sdk/fidl/fuchsia.session:fuchsia.session_rust", |
| "//sdk/fidl/fuchsia.session.power:fuchsia.session.power_rust", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/session/lib/realm_management", |
| "//src/storage/lib/vfs/rust:vfs", |
| "//third_party/rust_crates:anyhow", |
| "//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_rust", |
| "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", |
| "//src/lib/fuchsia", |
| "//src/lib/test_util", |
| "//src/session/testing", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:lazy_static", |
| ] |
| |
| sources = [ |
| "src/cobalt.rs", |
| "src/lib.rs", |
| "src/power.rs", |
| "src/session_manager.rs", |
| "src/startup.rs", |
| ] |
| } |
| |
| fuchsia_component_manifest("manifest") { |
| component_name = "session_manager" |
| manifest = "meta/session_manager.cml" |
| restricted_features = [ "dictionaries" ] |
| } |
| |
| fuchsia_structured_config_rust_lib("session_manager_config") { |
| cm_label = ":manifest" |
| } |
| |
| rustc_binary("bin") { |
| name = "session_manager" |
| edition = "2021" |
| |
| deps = [ |
| ":lib", |
| ":session_manager_config", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_component("session_manager_comp") { |
| cm_label = ":manifest" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("session_manager") { |
| deps = [ ":session_manager_comp" ] |
| } |
| |
| fuchsia_unittest_package("session_manager_tests") { |
| deps = [ ":lib_test" ] |
| |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":session_manager_tests" ] |
| } |