| # Copyright 2020 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/config.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| |
| rustc_library("lib") { |
| name = "persistence" |
| edition = "2021" |
| with_unit_tests = true |
| |
| visibility = [ |
| "//src/diagnostics/launcher/*", |
| "//src/diagnostics/persistence/*", |
| ] |
| |
| deps = [ |
| ":persistence-component-config", |
| "//src/diagnostics/lib/inspect-fetcher", |
| "//src/diagnostics/lib/persistence:lib", |
| "//src/diagnostics/persistence/fidl:persist_rust", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ |
| "src/constants.rs", |
| "src/file_handler.rs", |
| "src/inspect_server.rs", |
| "src/lib.rs", |
| "src/persist_server.rs", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:serde_json5", |
| "//third_party/rust_crates:test-case", |
| ] |
| } |
| |
| # Rules defining the Persistence component. |
| fuchsia_component_manifest("persistence-manifest") { |
| component_name = "diagnostics-persistence" |
| manifest = "meta/persistence-for-production.cml" |
| } |
| |
| fuchsia_structured_config_rust_lib("persistence-component-config") { |
| cm_label = ":persistence-manifest" |
| } |
| |
| fuchsia_component("diagnostics-persistence-component") { |
| cm_label = ":persistence-manifest" |
| deps = [ |
| "//src/diagnostics/config/persistence", |
| "//src/diagnostics/launcher:bin", |
| ] |
| } |
| |
| fuchsia_structured_config_values("production-structured-config") { |
| values_source = "structured-config/production.json5" |
| cm_label = ":persistence-manifest" |
| } |
| |
| fuchsia_package("diagnostics-persistence") { |
| deps = [ |
| ":diagnostics-persistence-component", |
| ":production-structured-config", |
| ] |
| } |
| |
| fuchsia_unittest_package("diagnostics-persistence-unittests") { |
| manifest = "meta/diagnostics-persistence-unittests.cml" |
| deps = [ ":lib_test" ] |
| } |
| |
| core_shard("core_shard") { |
| shard_file = "meta/diagnostics-persistence.core_shard.cml" |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":diagnostics-persistence-unittests", |
| "tests:tests", |
| ] |
| } |