| # Copyright 2019 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/config.gni") |
| import("//build/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| group("setui") { |
| testonly = true |
| deps = [ |
| ":bin", |
| ":lib", |
| ":setui_service", |
| ":setui_service_tests", |
| ] |
| } |
| |
| rustc_library("lib") { |
| name = "settings" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth-rustc", |
| "//sdk/fidl/fuchsia.bluetooth.sys:fuchsia.bluetooth.sys-rustc", |
| "//sdk/fidl/fuchsia.deprecatedtimezone:fuchsia.deprecatedtimezone-rustc", |
| "//sdk/fidl/fuchsia.devicesettings:fuchsia.devicesettings-rustc", |
| "//sdk/fidl/fuchsia.hardware.input:fuchsia.hardware.input-rustc", |
| "//sdk/fidl/fuchsia.hardware.light:fuchsia.hardware.light-rustc", |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol-rustc", |
| "//sdk/fidl/fuchsia.intl:fuchsia.intl-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.media:fuchsia.media-rustc", |
| "//sdk/fidl/fuchsia.media.audio:fuchsia.media.audio-rustc", |
| "//sdk/fidl/fuchsia.media.sounds:fuchsia.media.sounds-rustc", |
| "//sdk/fidl/fuchsia.settings:fuchsia.settings-rustc", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc", |
| "//sdk/fidl/fuchsia.ui.brightness:fuchsia.ui.brightness-rustc", |
| "//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input-rustc", |
| "//sdk/fidl/fuchsia.ui.policy:fuchsia.ui.policy-rustc", |
| "//sdk/fidl/fuchsia.ui.types:fuchsia.ui.types-rustc", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/icu_data/rust/icu_data", |
| "//src/lib/inspect/rust/fuchsia-inspect", |
| "//src/lib/inspect/rust/fuchsia-inspect-derive", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:bitflags", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:paste", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:rust_icu_ucal", |
| "//third_party/rust_crates:rust_icu_uenum", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ "//third_party/rust_crates:matches" ] |
| |
| # TODO(56138): Fix the leaks and remove this. |
| test_deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| |
| enforce_source_listing = true |
| |
| sources = [ |
| "src/accessibility.rs", |
| "src/accessibility/accessibility_controller.rs", |
| "src/accessibility/accessibility_fidl_handler.rs", |
| "src/account.rs", |
| "src/account/account_controller.rs", |
| "src/agent.rs", |
| "src/agent/authority_impl.rs", |
| "src/agent/base.rs", |
| "src/agent/earcons.rs", |
| "src/agent/earcons/agent.rs", |
| "src/agent/earcons/bluetooth_handler.rs", |
| "src/agent/earcons/sound_ids.rs", |
| "src/agent/earcons/utils.rs", |
| "src/agent/earcons/volume_change_handler.rs", |
| "src/agent/restore_agent.rs", |
| "src/audio.rs", |
| "src/audio/audio_controller.rs", |
| "src/audio/audio_default_settings.rs", |
| "src/audio/audio_fidl_handler.rs", |
| "src/audio/stream_volume_control.rs", |
| "src/clock.rs", |
| "src/config.rs", |
| "src/config/base.rs", |
| "src/config/default_settings.rs", |
| "src/device.rs", |
| "src/device/device_controller.rs", |
| "src/device/device_fidl_handler.rs", |
| "src/display.rs", |
| "src/display/display_controller.rs", |
| "src/display/display_fidl_handler.rs", |
| "src/display/light_sensor.rs", |
| "src/display/light_sensor_controller.rs", |
| "src/do_not_disturb.rs", |
| "src/do_not_disturb/do_not_disturb_controller.rs", |
| "src/do_not_disturb/do_not_disturb_fidl_handler.rs", |
| "src/fidl_clone.rs", |
| "src/fidl_common.rs", |
| "src/fidl_processor.rs", |
| "src/input.rs", |
| "src/input/common.rs", |
| "src/input/input_controller.rs", |
| "src/input/input_fidl_handler.rs", |
| "src/inspect.rs", |
| "src/inspect/inspect_broker.rs", |
| "src/internal.rs", |
| "src/internal/agent.rs", |
| "src/internal/common.rs", |
| "src/internal/core.rs", |
| "src/internal/event.rs", |
| "src/internal/handler.rs", |
| "src/internal/switchboard.rs", |
| "src/intl.rs", |
| "src/intl/intl_controller.rs", |
| "src/intl/intl_fidl_handler.rs", |
| "src/lib.rs", |
| "src/light.rs", |
| "src/light/light_controller.rs", |
| "src/light/light_fidl_handler.rs", |
| "src/message.rs", |
| "src/message/action_fuse.rs", |
| "src/message/base.rs", |
| "src/message/beacon.rs", |
| "src/message/message_builder.rs", |
| "src/message/message_client.rs", |
| "src/message/message_hub.rs", |
| "src/message/messenger.rs", |
| "src/message/receptor.rs", |
| "src/night_mode.rs", |
| "src/night_mode/night_mode_controller.rs", |
| "src/night_mode/night_mode_fidl_handler.rs", |
| "src/power.rs", |
| "src/power/power_controller.rs", |
| "src/privacy.rs", |
| "src/privacy/privacy_controller.rs", |
| "src/privacy/privacy_fidl_handler.rs", |
| "src/registry.rs", |
| "src/registry/base.rs", |
| "src/registry/device_storage.rs", |
| "src/registry/registry_impl.rs", |
| "src/registry/setting_handler.rs", |
| "src/registry/setting_handler_factory_impl.rs", |
| "src/registry/store_accessor.rs", |
| "src/service_context.rs", |
| "src/setup.rs", |
| "src/setup/setup_controller.rs", |
| "src/setup/setup_fidl_handler.rs", |
| "src/switchboard.rs", |
| "src/switchboard/accessibility_types.rs", |
| "src/switchboard/base.rs", |
| "src/switchboard/hanging_get_handler.rs", |
| "src/switchboard/intl_types.rs", |
| "src/switchboard/light_types.rs", |
| "src/switchboard/switchboard_impl.rs", |
| "src/tests.rs", |
| "src/tests/accessibility_tests.rs", |
| "src/tests/agent_tests.rs", |
| "src/tests/audio_tests.rs", |
| "src/tests/bluetooth_earcons_tests.rs", |
| "src/tests/device_tests.rs", |
| "src/tests/display_tests.rs", |
| "src/tests/do_not_disturb_tests.rs", |
| "src/tests/event_tests.rs", |
| "src/tests/fakes.rs", |
| "src/tests/fakes/audio_core_service.rs", |
| "src/tests/fakes/base.rs", |
| "src/tests/fakes/bluetooth_service.rs", |
| "src/tests/fakes/fake_hanging_get_handler.rs", |
| "src/tests/fakes/fake_hanging_get_types.rs", |
| "src/tests/fakes/hardware_light_service.rs", |
| "src/tests/fakes/hardware_power_statecontrol_service.rs", |
| "src/tests/fakes/input_device_registry_service.rs", |
| "src/tests/fakes/service_registry.rs", |
| "src/tests/fakes/sound_player_service.rs", |
| "src/tests/hanging_get_tests.rs", |
| "src/tests/input_tests.rs", |
| "src/tests/intl_tests.rs", |
| "src/tests/light_sensor_tests.rs", |
| "src/tests/light_tests.rs", |
| "src/tests/message_tests.rs", |
| "src/tests/night_mode_tests.rs", |
| "src/tests/privacy_tests.rs", |
| "src/tests/registry_tests.rs", |
| "src/tests/restore_agent_tests.rs", |
| "src/tests/scaffold.rs", |
| "src/tests/scaffold/agent.rs", |
| "src/tests/scaffold/event.rs", |
| "src/tests/service_configuration_tests.rs", |
| "src/tests/setting_handler_tests.rs", |
| "src/tests/setup_tests.rs", |
| "src/tests/test_failure_utils.rs", |
| "src/tests/volume_change_earcons_tests.rs", |
| ] |
| } |
| |
| test_package("setui_service_tests") { |
| deps = [ |
| ":lib_test", |
| ":tests_config", |
| ] |
| |
| tests = [ |
| { |
| name = "settings_lib_test" |
| environments = basic_envs |
| }, |
| ] |
| |
| resources = [ |
| { |
| path = rebase_path("//third_party/icu/common/icudtl.dat") |
| dest = "icudtl.dat" |
| }, |
| { |
| path = rebase_path("src/tests/testdata/test_store_data.store") |
| dest = "test_store_data.store" |
| }, |
| ] |
| } |
| |
| config_data("tests_config") { |
| for_pkg = "setui_service_tests" |
| sources = [ |
| "src/tests/testdata/audio_config_data.json", |
| "src/tests/testdata/bluetooth-connected.wav", |
| "src/tests/testdata/bluetooth-disconnected.wav", |
| "src/tests/testdata/fake_config_data.json", |
| "src/tests/testdata/fake_invalid_config_data.json", |
| "src/tests/testdata/service_configuration.json", |
| "src/tests/testdata/service_flags.json", |
| "src/tests/testdata/volume-changed.wav", |
| "src/tests/testdata/volume-max.wav", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| name = "setui_service" |
| with_unit_tests = true |
| |
| edition = "2018" |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.settings:fuchsia.settings-rustc", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:parking_lot", |
| ] |
| |
| # TODO(56138): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| |
| enforce_source_listing = true |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| package("setui_service") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "setui_service" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/setui_service.cmx") |
| dest = "setui_service.cmx" |
| }, |
| { |
| path = rebase_path("meta/setui_service.cml") |
| dest = "setui_service.cm" |
| }, |
| ] |
| |
| # Timezone resources, needed to validate input to fuchsia.settings.intl. |
| resources = [ |
| { |
| path = rebase_path("//third_party/icu/common/icudtl.dat") |
| dest = "icudtl.dat" |
| }, |
| ] |
| } |
| |
| rustc_binary("setui-config-test") { |
| testonly = true |
| edition = "2018" |
| name = "setui-config-test" |
| deps = [ |
| ":lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:serde_json", |
| ] |
| |
| # TODO(56138): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| |
| source_root = "src/setui_config_test.rs" |
| |
| enforce_source_listing = true |
| |
| sources = [ "src/setui_config_test.rs" ] |
| } |
| |
| unittest_package("sample-setui-config-test") { |
| deps = [ "//garnet/bin/setui:setui-config-test" ] |
| |
| resources = [ |
| { |
| path = rebase_path("src/tests/testdata/service_configuration.json") |
| dest = "service_configuration.json" |
| }, |
| { |
| path = rebase_path("src/tests/testdata/service_flags.json") |
| dest = "service_flags.json" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "setui_config_test" |
| args = [ |
| "/pkg/data/service_configuration.json", |
| "/pkg/data/service_flags.json", |
| ] |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":sample-setui-config-test", |
| ":setui-config-test", |
| ":setui_service_tests", |
| ] |
| } |