blob: 8f43ed3227bb7aad039a401dd9b96b25113b6ae7 [file] [log] [blame]
# Copyright 2018 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/config.gni")
import("//build/rust/rustc_binary.gni")
import("//build/testing/environments.gni")
import("//src/sys/core/build/core_shard.gni")
import("//third_party/cobalt/metrics_registry.gni")
declare_args() {
# Selects the wlan configuration type to use. Choices:
# "client" - client mode
# "ap" - access point mode
# "" (empty string) - no configuration
wlancfg_config_type = "client"
}
rustc_binary("bin") {
name = "wlancfg"
with_unit_tests = true
edition = "2018"
deps = [
":wlan_metrics_registry_rustlib",
"//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt-rustc",
"//sdk/fidl/fuchsia.location.namedplace:fuchsia.location.namedplace-rustc",
"//sdk/fidl/fuchsia.location.sensor:fuchsia.location.sensor-rustc",
"//sdk/fidl/fuchsia.net:fuchsia.net-rustc",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle-rustc",
"//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc",
"//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common-rustc",
"//sdk/fidl/fuchsia.wlan.device:fuchsia.wlan.device-rustc",
"//sdk/fidl/fuchsia.wlan.device.service:fuchsia.wlan.device.service-rustc",
"//sdk/fidl/fuchsia.wlan.ieee80211:fuchsia.wlan.ieee80211-rustc",
"//sdk/fidl/fuchsia.wlan.internal:fuchsia.wlan.internal-rustc",
"//sdk/fidl/fuchsia.wlan.policy:fuchsia.wlan.policy-rustc",
"//sdk/fidl/fuchsia.wlan.policy:measure_tape_for_scan_result",
"//sdk/fidl/fuchsia.wlan.product.deprecatedclient:fuchsia.wlan.product.deprecatedclient-rustc",
"//sdk/fidl/fuchsia.wlan.product.deprecatedconfiguration:fuchsia.wlan.product.deprecatedconfiguration-rustc",
"//sdk/fidl/fuchsia.wlan.sme:fuchsia.wlan.sme-rustc",
"//sdk/fidl/fuchsia.wlan.stats:fuchsia.wlan.stats-rustc",
"//src/connectivity/wlan/lib/common/rust/:wlan-common",
"//src/connectivity/wlan/lib/inspect:wlan-inspect",
"//src/connectivity/wlan/lib/stash/:wlan-stash",
"//src/lib/cobalt/rust:fuchsia-cobalt",
"//src/lib/diagnostics/inspect/contrib/rust",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/cobalt/src/lib/client/rust:cobalt-client",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:base64",
"//third_party/rust_crates:eui48",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:log",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:num-traits",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:pin-utils",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:static_assertions",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:test-case",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:void",
]
sources = [
"src/access_point/mod.rs",
"src/access_point/state_machine.rs",
"src/access_point/types.rs",
"src/client/mod.rs",
"src/client/network_selection.rs",
"src/client/scan.rs",
"src/client/state_machine.rs",
"src/client/types.rs",
"src/config_management/config_manager.rs",
"src/config_management/mod.rs",
"src/config_management/network_config.rs",
"src/config_management/stash_conversion.rs",
"src/legacy/deprecated_client.rs",
"src/legacy/deprecated_configuration.rs",
"src/legacy/device.rs",
"src/legacy/known_ess_store.rs",
"src/legacy/mod.rs",
"src/main.rs",
"src/mode_management/iface_manager.rs",
"src/mode_management/iface_manager_api.rs",
"src/mode_management/iface_manager_types.rs",
"src/mode_management/mod.rs",
"src/mode_management/phy_manager.rs",
"src/regulatory_manager.rs",
"src/telemetry/mod.rs",
"src/telemetry/windowed_stats.rs",
"src/util/fuse_pending.rs",
"src/util/future_with_metadata.rs",
"src/util/listener/access_point.rs",
"src/util/listener/client.rs",
"src/util/listener/generic.rs",
"src/util/listener/mod.rs",
"src/util/mod.rs",
"src/util/state_machine.rs",
"src/util/testing/cobalt.rs",
"src/util/testing/fakes.rs",
"src/util/testing/generate_struct.rs",
"src/util/testing/mod.rs",
"src/util/testing/sme_stream.rs",
]
configs -= [ "//build/config/rust:allow_unused_results" ]
}
fuchsia_component("service") {
component_name = "wlancfg"
manifest = "meta/wlancfg.cml"
deps = [ ":bin" ]
}
fuchsia_package("wlancfg") {
deps = [ ":service" ]
}
# Keep around a V1 version of the manifest until all tests are migrated
fuchsia_component("service-v1") {
testonly = true
component_name = "wlancfg"
manifest = "meta/wlancfg.cmx"
deps = [ ":bin" ]
}
fuchsia_package("wlancfg-v1") {
testonly = true
deps = [ ":service-v1" ]
}
core_shard("wlancfg-core-shard") {
shard_file = "meta/wlancfg.core_shard.cml"
}
config_data("config") {
for_pkg = "wlancfg"
if (wlancfg_config_type == "ap") {
sources = [ rebase_path("config/ap.json") ]
outputs = [ "default.json" ]
} else if (wlancfg_config_type == "client") {
sources = [ rebase_path("config/client.json") ]
outputs = [ "default.json" ]
}
}
fuchsia_component("test_driver") {
testonly = true
manifest = "meta/test_driver.cml"
deps = [ ":bin_test" ]
}
fuchsia_component("wlancfg_bin_test") {
testonly = true
manifest = "meta/wlancfg_bin_test.cml"
}
fuchsia_test_package("wlancfg-tests") {
test_components = [ ":wlancfg_bin_test" ]
deps = [
":test_driver",
"//src/sys/stash:stash_secure_v2",
]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
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 # Generates a rust target with '_rustlib' appended
}