| # Copyright 2025 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") |
| |
| group("light") { |
| testonly = true |
| deps = [ |
| ":settings_light", |
| ":tests", |
| ] |
| } |
| |
| rustc_library("settings_light") { |
| name = "settings_light" |
| with_unit_tests = true |
| edition = "2021" |
| |
| visibility = [ |
| ":*", |
| "//src/settings/service:*", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.light:fuchsia.hardware.light_rust", |
| "//sdk/fidl/fuchsia.settings:fuchsia.settings_rust", |
| "//sdk/fidl/fuchsia.ui.types:fuchsia.ui.types_rust", |
| "//src/lib/async-utils", |
| "//src/lib/fuchsia-async", |
| "//src/settings/common:settings_common", |
| "//src/settings/media_buttons:settings_media_buttons", |
| "//src/settings/storage:settings_storage", |
| "//src/settings/storage_fidl:fuchsia.settings.storage_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//sdk/rust/zx", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/settings/test_common:settings_test_common", |
| ] |
| |
| sources = [ |
| "src/lib.rs", |
| "src/light_controller.rs", |
| "src/light_fidl_handler.rs", |
| "src/light_hardware_configuration.rs", |
| "src/test_fakes.rs", |
| "src/test_fakes/hardware_light_service.rs", |
| "src/types.rs", |
| ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| fuchsia_unittest_package("settings_light_tests") { |
| component_name = "settings_light_test" |
| manifest = "meta/settings_light_tests.cml" |
| deps = [ ":settings_light_test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":settings_light_tests" ] |
| } |