blob: cb6332591fa0a5c3e5fdd43ac0e2db77a7218b0f [file] [log] [blame]
# 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_library.gni")
import("//third_party/cobalt/metrics_registry.gni")
metrics_registry("recovery_metrics_registry") {
# ID of the 'recovery' project from the //third_party/cobalt_config/projects.yaml file
project_id = 17
# The namespace to use in the generated code
namespace = "cobalt_registry"
# Generates a rust target called 'recovery_metrics_rustlib'
generate_rust = true
}
rustc_library("recovery-util") {
edition = "2021"
with_unit_tests = true
deps = [
":recovery_metrics_registry_rustlib",
"//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt_rust",
"//sdk/fidl/fuchsia.device:fuchsia.device_rust",
"//sdk/fidl/fuchsia.feedback:fuchsia.feedback_rust",
"//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_rust",
"//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_rust",
"//sdk/fidl/fuchsia.hwinfo:fuchsia.hwinfo_rust",
"//sdk/fidl/fuchsia.intl:fuchsia.intl_rust",
"//sdk/fidl/fuchsia.location.namedplace:fuchsia.location.namedplace_rust",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust",
"//sdk/fidl/fuchsia.recovery:fuchsia.recovery_rust",
"//sdk/fidl/fuchsia.settings:fuchsia.settings_rust",
"//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common_rust",
"//sdk/fidl/fuchsia.wlan.policy:fuchsia.wlan.policy_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/recovery/system:ota_lib",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:mockall",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//src/lib/fuchsia",
"//src/sys/pkg/testing/mock-metrics",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:lazy_static",
]
sources = [
"src/block.rs",
"src/cobalt.rs",
"src/crash.rs",
"src/lib.rs",
"src/ota/action.rs",
"src/ota/actions/factory_reset.rs",
"src/ota/actions/get_wifi_networks.rs",
"src/ota/actions/mod.rs",
"src/ota/actions/ota_reinstall.rs",
"src/ota/actions/set_sharing_consent.rs",
"src/ota/actions/wifi_connect.rs",
"src/ota/controller.rs",
"src/ota/mod.rs",
"src/ota/state_machine.rs",
"src/reboot.rs",
"src/regulatory.rs",
"src/testing/mod.rs",
"src/wlan.rs",
]
}
fuchsia_unittest_package("recovery-util-test") {
deps = [ ":recovery-util_test" ]
}
group("tests") {
testonly = true
deps = [ ":recovery-util-test" ]
}