| # Copyright 2022 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_binary.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":cache_manager_tests" ] |
| } |
| |
| rustc_binary("bin") { |
| edition = "2021" |
| output_name = "cache_manager" |
| with_unit_tests = true |
| |
| deps = [ |
| ":cache_manager_config_lib", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_component_manifest("cache_manager_component_manifest") { |
| component_name = "cache_manager" |
| manifest = "meta/cache_manager.cml" |
| } |
| |
| fuchsia_structured_config_rust_lib("cache_manager_config_lib") { |
| cm_label = ":cache_manager_component_manifest" |
| } |
| |
| fuchsia_component("cache_manager_component") { |
| cm_label = ":cache_manager_component_manifest" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_structured_config_values("cache_manager_config_values") { |
| cm_label = ":cache_manager_component_manifest" |
| values_source = "config.json5" |
| } |
| |
| fuchsia_package("cache_manager") { |
| deps = [ |
| ":cache_manager_component", |
| ":cache_manager_config_values", |
| ] |
| } |
| |
| fuchsia_structured_config_values("cache_manager_test_config_values") { |
| cm_label = ":cache_manager_component_manifest" |
| values = { |
| cache_clearing_threshold = 95 |
| storage_checking_frequency = 5000 |
| } |
| } |
| |
| fuchsia_unittest_package("cache_manager_tests") { |
| manifest = "meta/cache_manager_tests.cml" |
| deps = [ |
| ":bin_test", |
| ":cache_manager_test_config_values", |
| ] |
| } |