|  | # 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") | 
|  | import("//src/sys/core/build/core_shard.gni") | 
|  |  | 
|  | group("log-stats") { | 
|  | testonly = true | 
|  | deps = [ ":tests" ] | 
|  | } | 
|  |  | 
|  | group("tests") { | 
|  | testonly = true | 
|  | deps = [ | 
|  | ":log-stats-tests", | 
|  | "tests", | 
|  | ] | 
|  | } | 
|  |  | 
|  | fuchsia_component("component") { | 
|  | component_name = "log-stats" | 
|  | manifest = "meta/log-stats.cml" | 
|  | deps = [ "//src/diagnostics/launcher:bin" ] | 
|  | } | 
|  |  | 
|  | fuchsia_package("package") { | 
|  | package_name = "log-stats" | 
|  | deps = [ ":component" ] | 
|  | } | 
|  |  | 
|  | rustc_library("lib") { | 
|  | edition = "2021" | 
|  | name = "log-stats" | 
|  | with_unit_tests = true | 
|  |  | 
|  | visibility = [ | 
|  | "//src/diagnostics/launcher/*", | 
|  | "//src/diagnostics/log-stats/*", | 
|  | ] | 
|  |  | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", | 
|  | "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust", | 
|  | "//sdk/fidl/fuchsia.ui.activity:fuchsia.ui.activity_rust", | 
|  | "//src/lib/diagnostics/data/rust", | 
|  | "//src/lib/diagnostics/inspect/derive", | 
|  | "//src/lib/diagnostics/inspect/runtime/rust", | 
|  | "//src/lib/diagnostics/inspect/rust", | 
|  | "//src/lib/diagnostics/reader/rust", | 
|  | "//src/lib/fidl/rust/fidl", | 
|  | "//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:futures", | 
|  | "//third_party/rust_crates:regex", | 
|  | "//third_party/rust_crates:serde", | 
|  | "//third_party/rust_crates:serde_json", | 
|  | "//third_party/rust_crates:tracing", | 
|  | ] | 
|  |  | 
|  | test_deps = [ | 
|  | "//src/lib/fuchsia", | 
|  | "//third_party/rust_crates:proptest", | 
|  | ] | 
|  |  | 
|  | sources = [ | 
|  | "src/lib.rs", | 
|  | "src/metric_logger.rs", | 
|  | "src/stats.rs", | 
|  | ] | 
|  | } | 
|  |  | 
|  | fuchsia_unittest_component("log-stats-unit-tests") { | 
|  | deps = [ ":lib_test" ] | 
|  | } | 
|  |  | 
|  | fuchsia_test_package("log-stats-tests") { | 
|  | test_components = [ ":log-stats-unit-tests" ] | 
|  | } | 
|  |  | 
|  | core_shard("core_shard") { | 
|  | shard_file = "meta/log-stats.core_shard.cml" | 
|  | } |