blob: 6d4d1311672070ce56bd8fe9c2927819fabe3086 [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/rust/rustc_library.gni")
rustc_library("lib") {
name = "sl4f_lib"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.auth:fuchsia.auth-rustc",
"//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth-rustc",
"//sdk/fidl/fuchsia.bluetooth.avdtp:fuchsia.bluetooth.avdtp-rustc",
"//sdk/fidl/fuchsia.bluetooth.avrcp:fuchsia.bluetooth.avrcp-rustc",
"//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr-rustc",
"//sdk/fidl/fuchsia.bluetooth.gatt:fuchsia.bluetooth.gatt-rustc",
"//sdk/fidl/fuchsia.bluetooth.hfp:fuchsia.bluetooth.hfp-rustc",
"//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le-rustc",
"//sdk/fidl/fuchsia.bluetooth.rfcomm.test:fuchsia.bluetooth.rfcomm.test-rustc",
"//sdk/fidl/fuchsia.bluetooth.sys:fuchsia.bluetooth.sys-rustc",
"//sdk/fidl/fuchsia.developer.tiles:fuchsia.developer.tiles-rustc",
"//sdk/fidl/fuchsia.device:fuchsia.device-rustc",
"//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc",
"//sdk/fidl/fuchsia.factory:fuchsia.factory-rustc",
"//sdk/fidl/fuchsia.factory.lowpan:fuchsia.factory.lowpan-rustc",
"//sdk/fidl/fuchsia.feedback:fuchsia.feedback-rustc",
"//sdk/fidl/fuchsia.hardware.backlight:fuchsia.hardware.backlight-rustc",
"//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc",
"//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio-rustc",
"//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c-rustc",
"//sdk/fidl/fuchsia.hardware.light:fuchsia.hardware.light-rustc",
"//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network-rustc",
"//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol-rustc",
"//sdk/fidl/fuchsia.hardware.ram.metrics:fuchsia.hardware.ram.metrics-rustc",
"//sdk/fidl/fuchsia.hardware.temperature:fuchsia.hardware.temperature-rustc",
"//sdk/fidl/fuchsia.hwinfo:fuchsia.hwinfo-rustc",
"//sdk/fidl/fuchsia.images:fuchsia.images-rustc",
"//sdk/fidl/fuchsia.input.report:fuchsia.input.report-rustc",
"//sdk/fidl/fuchsia.intl:fuchsia.intl-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.kernel:fuchsia.kernel-rustc",
"//sdk/fidl/fuchsia.location.namedplace:fuchsia.location.namedplace-rustc",
"//sdk/fidl/fuchsia.location.position:fuchsia.location.position-rustc",
"//sdk/fidl/fuchsia.lowpan:fuchsia.lowpan-rustc",
"//sdk/fidl/fuchsia.lowpan.device:fuchsia.lowpan.device-rustc",
"//sdk/fidl/fuchsia.lowpan.test:fuchsia.lowpan.test-rustc",
"//sdk/fidl/fuchsia.math:fuchsia.math-rustc",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//sdk/fidl/fuchsia.modular:fuchsia.modular-rustc",
"//sdk/fidl/fuchsia.modular.internal:fuchsia.modular.internal-rustc",
"//sdk/fidl/fuchsia.modular.session:fuchsia.modular.session-rustc",
"//sdk/fidl/fuchsia.net:fuchsia.net-rustc",
"//sdk/fidl/fuchsia.net.debug:fuchsia.net.debug-rustc",
"//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces-rustc",
"//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc",
"//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc",
"//sdk/fidl/fuchsia.paver:fuchsia.paver-rustc",
"//sdk/fidl/fuchsia.recovery:fuchsia.recovery-rustc",
"//sdk/fidl/fuchsia.session:fuchsia.session-rustc",
"//sdk/fidl/fuchsia.settings:fuchsia.settings-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo-rustc",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc",
"//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager-rustc",
"//sdk/fidl/fuchsia.testing.sl4f:fuchsia.testing.sl4f-rustc",
"//sdk/fidl/fuchsia.time:fuchsia.time-rustc",
"//sdk/fidl/fuchsia.tracing.controller:fuchsia.tracing.controller-rustc",
"//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app-rustc",
"//sdk/fidl/fuchsia.ui.composition:fuchsia.ui.composition-rustc",
"//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input-rustc",
"//sdk/fidl/fuchsia.ui.policy:fuchsia.ui.policy-rustc",
"//sdk/fidl/fuchsia.ui.scenic:fuchsia.ui.scenic-rustc",
"//sdk/fidl/fuchsia.virtualaudio:fuchsia.virtualaudio-rustc",
"//sdk/fidl/fuchsia.weave:fuchsia.weave-rustc",
"//sdk/fidl/fuchsia.web:fuchsia.web-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.internal:fuchsia.wlan.internal-rustc",
"//sdk/fidl/fuchsia.wlan.policy:fuchsia.wlan.policy-rustc",
"//sdk/fidl/fuchsia.wlan.product.deprecatedconfiguration:fuchsia.wlan.product.deprecatedconfiguration-rustc",
"//sdk/fidl/fuchsia.wlan.sme:fuchsia.wlan.sme-rustc",
"//sdk/lib/syslog:client_includes",
"//src/camera/bin/virtual_camera:fuchsia.camera.test.virtualcamera-rustc",
"//src/chromium/web_engine/meta/shards:web_engine_base",
"//src/chromium/web_engine/meta/shards:web_engine_feature_network",
"//src/connectivity/bluetooth/lib/bt-avdtp",
"//src/connectivity/bluetooth/lib/bt-rfcomm",
"//src/connectivity/bluetooth/lib/fuchsia-bluetooth",
"//src/connectivity/bluetooth/testing/test-call-manager",
"//src/connectivity/bluetooth/testing/test-rfcomm-client",
"//src/connectivity/lowpan/lib/lowpan_driver_common",
"//src/connectivity/lowpan/tools/lowpanctl",
"//src/connectivity/wlan/lib/common/rust:wlan-common",
"//src/connectivity/wlan/lib/ieee80211",
"//src/connectivity/wlan/testing/wlan-service-util",
"//src/lib/async-utils",
"//src/lib/diagnostics/reader/rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/mapped-vmo",
"//src/lib/network/fidl_fuchsia_net_ext",
"//src/lib/network/fidl_fuchsia_net_interfaces_ext",
"//src/lib/storage/fuchsia-vfs-watcher",
"//src/lib/storage/vfs/rust:vfs",
"//src/lib/syslog/rust:syslog",
"//src/lib/ui/fuchsia-scenic",
"//src/lib/ui/input-synthesis",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/power/temperature-logger/fuchsia.thermal.test:fuchsia.thermal.test-rustc",
"//src/testing/sl4f/fidl:fuchsia.testing.proxy-rustc",
"//src/testing/system-metrics-logger/fuchsia.systemmetrics.test:fuchsia.systemmetrics.test-rustc",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-channel",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:base64",
"//third_party/rust_crates:bytes",
"//third_party/rust_crates:derivative",
"//third_party/rust_crates:eui48",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:glob",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:hyper",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:num-derive",
"//third_party/rust_crates:num-traits",
"//third_party/rust_crates:once_cell",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:pin-utils",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:slab",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:uuid",
"//third_party/rust_crates:void",
]
test_deps = [
"//src/lib/test_util",
"//src/testing/fidl:placeholders-rustc",
"//third_party/rust_crates:log",
]
sources = [
"src/audio/commands.rs",
"src/audio/facade.rs",
"src/audio/mod.rs",
"src/audio/types.rs",
"src/backlight/commands.rs",
"src/backlight/facade.rs",
"src/backlight/mod.rs",
"src/backlight/types.rs",
"src/bluetooth/avdtp_facade.rs",
"src/bluetooth/avrcp_facade.rs",
"src/bluetooth/ble_advertise_facade.rs",
"src/bluetooth/bt_sys_facade.rs",
"src/bluetooth/commands.rs",
"src/bluetooth/constants.rs",
"src/bluetooth/facade.rs",
"src/bluetooth/gatt_client_facade.rs",
"src/bluetooth/gatt_server_facade.rs",
"src/bluetooth/mod.rs",
"src/bluetooth/profile_server_facade.rs",
"src/bluetooth/types.rs",
"src/common_utils/buffer.rs",
"src/common_utils/common.rs",
"src/common_utils/error.rs",
"src/common_utils/fidl.rs",
"src/common_utils/lowpan_context.rs",
"src/common_utils/mod.rs",
"src/common_utils/namespace_binder.rs",
"src/common_utils/test.rs",
"src/component/commands.rs",
"src/component/facade.rs",
"src/component/mod.rs",
"src/component/types.rs",
"src/device/commands.rs",
"src/device/facade.rs",
"src/device/mod.rs",
"src/device/types.rs",
"src/diagnostics/commands.rs",
"src/diagnostics/facade.rs",
"src/diagnostics/mod.rs",
"src/diagnostics/types.rs",
"src/factory_reset/commands.rs",
"src/factory_reset/facade.rs",
"src/factory_reset/mod.rs",
"src/factory_reset/types.rs",
"src/factory_store/commands.rs",
"src/factory_store/facade.rs",
"src/factory_store/mod.rs",
"src/factory_store/types.rs",
"src/feedback_data_provider/commands.rs",
"src/feedback_data_provider/facade.rs",
"src/feedback_data_provider/mod.rs",
"src/feedback_data_provider/types.rs",
"src/fidl/mod.rs",
"src/fidl/sl4f.rs",
"src/file/commands.rs",
"src/file/facade.rs",
"src/file/mod.rs",
"src/file/types.rs",
"src/gpio/commands.rs",
"src/gpio/facade.rs",
"src/gpio/mod.rs",
"src/gpio/types.rs",
"src/hardware_power_statecontrol/commands.rs",
"src/hardware_power_statecontrol/facade.rs",
"src/hardware_power_statecontrol/mod.rs",
"src/hwinfo/commands.rs",
"src/hwinfo/facade.rs",
"src/hwinfo/mod.rs",
"src/hwinfo/types.rs",
"src/i2c/commands.rs",
"src/i2c/facade.rs",
"src/i2c/mod.rs",
"src/i2c/types.rs",
"src/input/commands.rs",
"src/input/facade.rs",
"src/input/mod.rs",
"src/input/types.rs",
"src/input_report/commands.rs",
"src/input_report/facade.rs",
"src/input_report/mod.rs",
"src/input_report/types.rs",
"src/kernel/commands.rs",
"src/kernel/facade.rs",
"src/kernel/mod.rs",
"src/kernel/types.rs",
"src/lib.rs",
"src/light/commands.rs",
"src/light/facade.rs",
"src/light/mod.rs",
"src/light/types.rs",
"src/location/commands.rs",
"src/location/emergency_provider_facade.rs",
"src/location/mod.rs",
"src/location/regulatory_region_facade.rs",
"src/location/types.rs",
"src/logging/commands.rs",
"src/logging/facade.rs",
"src/logging/mod.rs",
"src/logging/types.rs",
"src/modular/commands.rs",
"src/modular/facade.rs",
"src/modular/mod.rs",
"src/modular/types.rs",
"src/netstack/commands.rs",
"src/netstack/facade.rs",
"src/netstack/mod.rs",
"src/paver/commands.rs",
"src/paver/facade.rs",
"src/paver/mod.rs",
"src/paver/types.rs",
"src/proxy/commands.rs",
"src/proxy/facade.rs",
"src/proxy/mod.rs",
"src/ram/commands.rs",
"src/ram/facade.rs",
"src/ram/mod.rs",
"src/ram/types.rs",
"src/scenic/commands.rs",
"src/scenic/facade.rs",
"src/scenic/mod.rs",
"src/scenic/types.rs",
"src/server/constants.rs",
"src/server/mod.rs",
"src/server/sl4f.rs",
"src/server/sl4f_executor.rs",
"src/server/sl4f_types.rs",
"src/setui/commands.rs",
"src/setui/facade.rs",
"src/setui/mod.rs",
"src/setui/types.rs",
"src/sysinfo/commands.rs",
"src/sysinfo/facade.rs",
"src/sysinfo/mod.rs",
"src/sysinfo/types.rs",
"src/system_metrics/commands.rs",
"src/system_metrics/facade.rs",
"src/system_metrics/mod.rs",
"src/system_metrics/types.rs",
"src/temperature/commands.rs",
"src/temperature/facade.rs",
"src/temperature/mod.rs",
"src/temperature/types.rs",
"src/tiles/commands.rs",
"src/tiles/facade.rs",
"src/tiles/mod.rs",
"src/tiles/types.rs",
"src/time/commands.rs",
"src/time/facade.rs",
"src/time/mod.rs",
"src/traceutil/commands.rs",
"src/traceutil/facade.rs",
"src/traceutil/mod.rs",
"src/traceutil/types.rs",
"src/tracing/commands.rs",
"src/tracing/facade.rs",
"src/tracing/mod.rs",
"src/tracing/types.rs",
"src/virtual_camera/commands.rs",
"src/virtual_camera/facade.rs",
"src/virtual_camera/mod.rs",
"src/virtual_camera/types.rs",
"src/weave/commands.rs",
"src/weave/facade.rs",
"src/weave/mod.rs",
"src/weave/types.rs",
"src/webdriver/commands.rs",
"src/webdriver/facade.rs",
"src/webdriver/mod.rs",
"src/webdriver/types.rs",
"src/wlan/commands.rs",
"src/wlan/facade.rs",
"src/wlan/mod.rs",
"src/wlan/types.rs",
"src/wlan_deprecated/commands.rs",
"src/wlan_deprecated/facade.rs",
"src/wlan_deprecated/mod.rs",
"src/wlan_phy/commands.rs",
"src/wlan_phy/facade.rs",
"src/wlan_phy/mod.rs",
"src/wlan_policy/ap_facade.rs",
"src/wlan_policy/commands.rs",
"src/wlan_policy/facade.rs",
"src/wlan_policy/mod.rs",
"src/wlan_policy/types.rs",
"src/wpan/commands.rs",
"src/wpan/facade.rs",
"src/wpan/mod.rs",
"src/wpan/types.rs",
]
}
rustc_binary("bin") {
name = "sl4f"
with_unit_tests = true
edition = "2018"
deps = [
":lib",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-hyper",
"//src/lib/syslog/rust:syslog",
"//third_party/rust_crates:async-channel",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hyper",
"//third_party/rust_crates:log",
"//third_party/rust_crates:parking_lot",
]
sources = [ "src/main.rs" ]
}
fuchsia_component("sl4f_comp") {
component_name = "sl4f"
manifest = "meta/sl4f.cmx"
deps = [ ":bin" ]
}
fuchsia_component("data_proxy_comp") {
component_name = "data_proxy"
manifest = "proxy/meta/data_proxy.cmx"
deps = [ "proxy:bin" ]
}
# WARNING: Known to infrastructure.
fuchsia_package("sl4f") {
deps = [
":data_proxy_comp",
":sl4f_comp",
]
}
resource("sl4f-server-tests-files") {
sources = [
"testdata/alpha_factory_store.config",
"testdata/cast_factory_store.config",
"testdata/misc_factory_store.config",
"testdata/playready_factory_store.config",
"testdata/weave_factory_store.config",
"testdata/widevine_factory_store.config",
]
outputs = [ "data/{{source_file_part}}" ]
}
fuchsia_unittest_package("sl4f-service-tests") {
package_deps_for_infra_only = [
"//src/factory/fake_factory_store_providers:fake_factory_store_providers",
"//src/power/battery-manager:battery-manager",
]
manifest = "meta/sl4f_lib_lib_test.cmx"
deps = [
":lib_test",
":sl4f-server-tests-files",
]
}
config_data("fake-factory-store-providers-config") {
for_pkg = "fake_factory_store_providers"
sources = [
"testdata/alpha_factory_store.config",
"testdata/cast_factory_store.config",
"testdata/misc_factory_store.config",
"testdata/playready_factory_store.config",
"testdata/weave_factory_store.config",
"testdata/widevine_factory_store.config",
]
}
fuchsia_unittest_package("sl4f-tests") {
deps = [ ":bin_test" ]
}
group("service-tests") {
testonly = true
deps = [
":fake-factory-store-providers-config",
":sl4f-service-tests",
"//src/factory/fake_factory_store_providers",
]
}
group("tests") {
testonly = true
deps = [
":service-tests",
":sl4f-tests",
"proxy:data-proxy-test",
]
}
config_data("sl4f_sysmgr_config") {
for_pkg = "sysmgr"
outputs = [ "sl4f.config" ]
sources = [ "config/sl4f_sysmgr.config" ]
}