blob: 59e88d12a8756b980475df2bbe8f222d8b99b795 [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_debug") {
version = "0.1.0"
edition = "2021"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.component:fuchsia.component_rust",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.dash:fuchsia.dash_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.process:fuchsia.process_rust",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-url",
"//src/lib/zircon/rust:fuchsia-zircon-status",
"//src/sys/lib/cm_fidl_validator",
"//src/sys/lib/cm_rust",
"//src/sys/lib/cm_types",
"//src/sys/lib/moniker",
"//src/sys/lib/socket-to-stdio",
"//third_party/rust_crates:ansi_term",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:prettytable-rs",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:textwrap",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:url",
"//tools/lib/config_value_file",
]
assert_no_deps = [
# The component internal API should not be exposed to this library
"//sdk/fidl/fuchsia.component.internal:fuchsia.component.internal_rust",
# Should not need to bring in the entire routing crate. This crate is used
# by the client, the backend is responsible for routing
"//src/sys/lib/routing",
]
# 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:schemars",
"//third_party/rust_crates:serde",
]
}
test_deps = [
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/sys/lib/cm_rust/testing",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:pretty_assertions",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:test-case",
]
sources = [
"src/capability.rs",
"src/cli/capability.rs",
"src/cli/collection.rs",
"src/cli/create.rs",
"src/cli/destroy.rs",
"src/cli/doctor.rs",
"src/cli/explore.rs",
"src/cli/format.rs",
"src/cli/graph.rs",
"src/cli/list.rs",
"src/cli/mod.rs",
"src/cli/reload.rs",
"src/cli/resolve.rs",
"src/cli/route.rs",
"src/cli/run.rs",
"src/cli/show.rs",
"src/cli/start.rs",
"src/cli/stop.rs",
"src/cli/storage.rs",
"src/config.rs",
"src/copy.rs",
"src/dirs.rs",
"src/doctor.rs",
"src/explore.rs",
"src/io.rs",
"src/lib.rs",
"src/lifecycle.rs",
"src/path.rs",
"src/query.rs",
"src/realm.rs",
"src/route.rs",
"src/storage/copy.rs",
"src/storage/delete.rs",
"src/storage/delete_all.rs",
"src/storage/list.rs",
"src/storage/make_directory.rs",
"src/storage/mod.rs",
"src/test_utils.rs",
]
}
fuchsia_unittest_package("component_debug_unittests") {
manifest = "meta/unittests.cml"
deps = [ ":component_debug_test" ]
}
group("tests") {
testonly = true
deps = [ ":component_debug_unittests" ]
# TODO(https://fxbug.dev/42162724): Failing test disabled on coverage.
# Please fix test and remove condition below.
if (!is_coverage) {
deps += [ "tests:component_debug_integration_tests" ]
}
}