blob: 6a21723bf6a2d63ab77c2cb61c84ffed914828f2 [file] [log] [blame]
# 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 = "2018"
with_unit_tests = true
deps = [
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//src/lib/fuchsia-async",
"//src/lib/zircon/rust:fuchsia-zircon-status",
"//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 = [ "//third_party/rust_crates:tempfile" ]
sources = [
"src/doctor.rs",
"src/io.rs",
"src/lib.rs",
"src/list.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" ]
}
}