| # 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") | |
| template("component_debug_lib") { | |
| rustc_library(target_name) { | |
| version = "0.1.0" | |
| edition = "2024" | |
| with_unit_tests = true | |
| deps = [ | |
| "//sdk/rust/zx-status", | |
| "//src/lib/directed_graph", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia-async", | |
| "//src/lib/fuchsia-url", | |
| "//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-lite", | |
| "//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", | |
| ] + invoker.deps | |
| 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", | |
| ] | |
| } | |
| if (defined(invoker.features)) { | |
| features += invoker.features | |
| } | |
| test_deps = [ | |
| "//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", | |
| ] + invoker.test_deps | |
| sources = [ | |
| "src/capability.rs", | |
| "src/cli/capability.rs", | |
| "src/cli/collection.rs", | |
| "src/cli/config.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", | |
| ] | |
| } | |
| } | |
| component_debug_lib("component_debug") { | |
| deps = [ | |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust_flex", | |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust_flex", | |
| "//sdk/fidl/fuchsia.dash:fuchsia.dash_rust_flex", | |
| "//sdk/fidl/fuchsia.data:fuchsia.data_rust_flex", | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust_flex", | |
| "//sdk/fidl/fuchsia.process:fuchsia.process_rust_flex", | |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust_flex", | |
| "//src/lib/fdomain/client:flex_fidl", | |
| "//src/lib/fuchsia-fs", | |
| ] | |
| test_deps = [ | |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", | |
| "//src/lib/fdio/rust:fdio", | |
| "//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", | |
| ] | |
| } | |
| component_debug_lib("component_debug_fdomain") { | |
| deps = [ | |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust_fdomain_flex", | |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust_fdomain_flex", | |
| "//sdk/fidl/fuchsia.dash:fuchsia.dash_rust_fdomain_flex", | |
| "//sdk/fidl/fuchsia.data:fuchsia.data_rust_fdomain_flex", | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust_fdomain_flex", | |
| "//sdk/fidl/fuchsia.process:fuchsia.process_rust_fdomain_flex", | |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust_fdomain_flex", | |
| "//src/lib/fdomain/client:flex_fdomain", | |
| "//src/lib/fuchsia-fs:fuchsia-fs_fdomain", | |
| ] | |
| test_deps = [ | |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_fdomain", | |
| "//src/lib/fdio/rust:fdio", | |
| "//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", | |
| ] | |
| features = [ "fdomain" ] | |
| } | |
| 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" ] | |
| } | |
| } |