| # Copyright 2021 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") |
| import("//third_party/cobalt/metrics_registry.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":wlandevicemonitor-tests" ] |
| } |
| |
| metrics_registry("wlan_metrics_registry") { |
| # This must match the ID of our Cobalt project as specified in: |
| # third_party/cobalt_config/projects.yaml |
| project_id = 3708719327 |
| generate_rust = true |
| |
| # We don't need to include a copy of our projects's Cobalt registry in our package because we |
| # rely on it being packaged with Cobalt itself |
| generate_binarypb = false |
| } |
| |
| wlandevicemonitor_deps = [ |
| ":wlandevicemonitor_config", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common_rust", |
| "//sdk/fidl/fuchsia.wlan.device:fuchsia.wlan.device_rust", |
| "//sdk/fidl/fuchsia.wlan.device.service:fuchsia.wlan.device.service_rust", |
| "//sdk/fidl/fuchsia.wlan.sme:fuchsia.wlan.sme_rust", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/diagnostics/log/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-sync", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| wlandevicemonitor_srcs = [ |
| "src/device.rs", |
| "src/device_watch.rs", |
| "src/inspect.rs", |
| "src/main.rs", |
| "src/service.rs", |
| "src/watchable_map.rs", |
| "src/watcher_service.rs", |
| ] |
| |
| wlandevicemonitor_test_deps = [ |
| "//src/connectivity/wlan/lib/common/rust/:wlan-common", |
| "//src/connectivity/wlan/lib/ieee80211", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/storage/lib/vfs/rust:vfs", |
| "//third_party/rust_crates:test-case", |
| ] |
| |
| rustc_binary("bin") { |
| name = "wlandevicemonitor" |
| with_unit_tests = true |
| edition = "2021" |
| |
| deps = wlandevicemonitor_deps |
| test_deps = wlandevicemonitor_test_deps |
| sources = wlandevicemonitor_srcs |
| } |
| |
| # TODO(https://fxbug.dev/42173544): fuchsia_component_manifest will soon be unnecessary and can |
| # folded into the component |
| fuchsia_component_manifest("wlandevicemonitor-manifest") { |
| component_name = "wlandevicemonitor" |
| manifest = "meta/wlandevicemonitor.cml" |
| } |
| |
| fuchsia_component("wlandevicemonitor_component") { |
| cm_label = ":wlandevicemonitor-manifest" |
| deps = [ |
| ":bin", |
| ":wlan_metrics_registry", |
| ] |
| } |
| |
| fuchsia_structured_config_values("wlandevicemonitor-values") { |
| cm_label = ":wlandevicemonitor-manifest" |
| values = { |
| wep_supported = false |
| wpa1_supported = false |
| } |
| } |
| |
| fuchsia_structured_config_values("wlandevicemonitor-legacy-privacy-values") { |
| cm_label = ":wlandevicemonitor-manifest" |
| values = { |
| wep_supported = true |
| wpa1_supported = true |
| } |
| } |
| |
| fuchsia_structured_config_rust_lib("wlandevicemonitor_config") { |
| cm_label = ":wlandevicemonitor-manifest" |
| } |
| |
| fuchsia_package("wlandevicemonitor") { |
| deps = [ |
| ":wlandevicemonitor-values", |
| ":wlandevicemonitor_component", |
| ] |
| } |
| |
| fuchsia_package("wlandevicemonitor-legacy-privacy") { |
| package_name = "wlandevicemonitor" |
| deps = [ |
| ":wlandevicemonitor-legacy-privacy-values", |
| ":wlandevicemonitor_component", |
| ] |
| } |
| |
| fuchsia_unittest_package("wlandevicemonitor-tests") { |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| deps = [ ":bin_test" ] |
| } |