| # Copyright 2023 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("log_command_lib") { |
| rustc_library(target_name) { |
| version = "0.1.0" |
| edition = "2024" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/rust/zx-types", |
| "//src/developer/ffx/lib/errors:lib", |
| "//src/developer/lib/writer:lib", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/diagnostics/selectors", |
| "//src/lib/fidl/rust/fidl", |
| "//src/sys/lib/moniker", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:async-stream", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:chrono-english", |
| "//third_party/rust_crates:futures-util", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| ] + invoker.deps |
| |
| test_deps = [ |
| "//sdk/rust/zx", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ |
| "src/filter.rs", |
| "src/lib.rs", |
| "src/log_formatter.rs", |
| "src/log_socket_stream.rs", |
| ] |
| |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| |
| features = [] |
| if (defined(invoker.features)) { |
| features += invoker.features |
| } |
| } |
| } |
| |
| log_command_lib("log-command") { |
| deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust_flex", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust_flex", |
| "//src/lib/fdomain/client:flex_fidl", |
| "//src/sys/lib/component_debug", |
| ] |
| } |
| |
| log_command_lib("log-command_fdomain") { |
| deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust_fdomain_flex", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust_fdomain_flex", |
| "//src/lib/fdomain/client:flex_fdomain", |
| "//src/sys/lib/component_debug:component_debug_fdomain", |
| ] |
| |
| features = [ "fdomain" ] |
| } |
| |
| fuchsia_unittest_package("log-command-test") { |
| deps = [ ":log-command_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":log-command-test" ] |
| } |