blob: 39aca6ebcaa5a6f0a533a67a2cf91a00c74333f4 [file] [log] [blame]
# 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("workstation_core_shard") {
shard_file = "meta/workstation.core_shard.cml"
}
core_shard("smart_session_from_platform_core_shard") {
shard_file = "meta/session.smart.from_platform.core_shard.cml"
}
core_shard("smart_session_migration_from_platform_core_shard") {
shard_file = "meta/session.smart_migration.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.element:fuchsia.element_rust",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust",
"//sdk/fidl/fuchsia.session:fuchsia.session_rust",
"//src/lib/diagnostics/inspect/contrib/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/session/lib/realm_management",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//src/lib/fuchsia",
"//src/lib/test_util",
"//src/session/testing",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:lazy_static",
]
sources = [
"src/cobalt.rs",
"src/lib.rs",
"src/session_manager.rs",
"src/startup.rs",
]
}
fuchsia_component_manifest("manifest") {
component_name = "session_manager"
manifest = "meta/session_manager.cml"
}
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" ]
}