| # Copyright 2021 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_library.gni") |
| |
| rustc_library("component_hub") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component-rustc", |
| "//sdk/fidl/fuchsia.component.config:fuchsia.component.config-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//src/sys/lib/cm_rust", |
| "//src/sys/lib/moniker", |
| "//src/sys/lib/routing", |
| "//third_party/rust_crates:ansi_term", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| # Some host tools use serde to serialize/deserialize types. This |
| # dependency is guarded in code via #[cfg(feature = "serde")] and |
| # #[cfg_attr(feature = "serde", ...)] to prevent serde dependencies in |
| # non-host builds. |
| features = [] |
| if (is_host) { |
| features += [ "serde" ] |
| deps += [ "//third_party/rust_crates:serde" ] |
| } |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl-rustc", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| sources = [ |
| "src/doctor.rs", |
| "src/io.rs", |
| "src/lib.rs", |
| "src/list.rs", |
| "src/new/list.rs", |
| "src/new/mod.rs", |
| "src/new/show.rs", |
| "src/select.rs", |
| "src/show.rs", |
| ] |
| } |
| |
| fuchsia_unittest_package("component_hub_unittests") { |
| manifest = "meta/unittests.cml" |
| deps = [ ":component_hub_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":component_hub_unittests" ] |
| |
| # TODO(fxbug.dev/82186): Failing test disabled on coverage. |
| # Please fix test and remove condition below. |
| if (!is_coverage) { |
| deps += [ "tests:component_hub_integration_tests" ] |
| } |
| } |