| # Copyright 2019 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") |
| |
| group("rust") { |
| public_deps = [ ":lib" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":diagnostics-data-tests" ] |
| } |
| |
| rustc_library("lib") { |
| edition = "2024" |
| name = "diagnostics_data" |
| with_unit_tests = true |
| |
| sources = [ "src/lib.rs" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect_rust", |
| "//src/lib/diagnostics/hierarchy/rust", |
| "//src/lib/diagnostics/log/types:types-serde", |
| "//src/lib/diagnostics/selectors", |
| "//src/sys/lib/moniker", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:flyweights", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:termion", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:pretty_assertions", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:test-case", |
| ] |
| |
| if (is_fuchsia) { |
| deps += [ |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/rust/zx", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps += [ |
| "//sdk/fidl/fuchsia.diagnostics.types:fuchsia.diagnostics.types_rust", |
| ] |
| |
| sources += [ "src/logs_legacy.rs" ] |
| } |
| |
| if (is_host) { |
| deps += [ "//third_party/rust_crates:schemars" ] |
| features = [ "json_schema" ] |
| } |
| |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| fuchsia_unittest_package("diagnostics-data-tests") { |
| deps = [ ":lib_test" ] |
| } |