| # 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/rust/rustc_library.gni") |
| |
| rustc_library("lib") { |
| name = "persistence" |
| edition = "2024" |
| with_unit_tests = true |
| |
| visibility = [ |
| "//src/diagnostics/launcher/*", |
| "//src/diagnostics/persistence/*", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.component.sandbox:fuchsia.component.sandbox_rust", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", |
| "//sdk/fidl/fuchsia.update:fuchsia.update_rust", |
| "//sdk/rust/zx", |
| "//src/diagnostics/lib/persistence:lib", |
| "//src/diagnostics/persistence/fidl:persist_rust", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/diagnostics/selectors", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-sync", |
| "//src/lib/sandbox", |
| "//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:log", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "src/constants.rs", |
| "src/fetcher.rs", |
| "src/file_handler.rs", |
| "src/inspect_server.rs", |
| "src/lib.rs", |
| "src/persist_server.rs", |
| "src/scheduler.rs", |
| ] |
| |
| test_deps = [ |
| "//src/lib/diagnostics/hierarchy/rust", |
| "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:pretty_assertions", |
| "//third_party/rust_crates:serde_json5", |
| ] |
| |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| # Rules defining the Persistence component. |
| fuchsia_component_manifest("persistence-manifest") { |
| component_name = "diagnostics-persistence" |
| manifest = "meta/persistence-for-production.cml" |
| restricted_features = [ "dynamic_dictionaries" ] |
| } |
| |
| fuchsia_component("diagnostics-persistence-component") { |
| cm_label = ":persistence-manifest" |
| deps = [ "//src/diagnostics/launcher:bin" ] |
| } |
| |
| fuchsia_package("diagnostics-persistence") { |
| deps = [ ":diagnostics-persistence-component" ] |
| } |
| |
| fuchsia_unittest_package("diagnostics-persistence-unittests") { |
| manifest = "meta/diagnostics-persistence-unittests.cml" |
| deps = [ ":lib_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":diagnostics-persistence-unittests", |
| "tests", |
| ] |
| } |