| # 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/components.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//build/testing/test_spec.gni") |
| |
| group("remote-control") { |
| testonly = true |
| |
| public_deps = [ |
| ":remote-control-package", |
| ":tests", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":remote-control-lib-tests", |
| "usb:tests", |
| "//src/developer/remote-control/runner:tests", |
| "//src/developer/remote-control/test:fdomain-connection-test", |
| ] |
| } |
| |
| fuchsia_component_manifest("manifest") { |
| component_name = "remote-control" |
| manifest = "meta/remote-control.cml" |
| } |
| |
| fuchsia_structured_config_rust_lib("remote_control_config") { |
| cm_label = ":manifest" |
| } |
| |
| rustc_library("lib") { |
| name = "remote-control" |
| edition = "2024" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.buildinfo:fuchsia.buildinfo_rust", |
| "//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol_rust", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_rust", |
| "//sdk/fidl/fuchsia.diagnostics.types:fuchsia.diagnostics.types_rust", |
| "//sdk/fidl/fuchsia.hwinfo:fuchsia.hwinfo_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo_rust", |
| "//sdk/rust/zx", |
| "//src/developer/remote-control/fidl:fuchsia.developer.remotecontrol.connector_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/network/fidl_fuchsia_net_interfaces_ext", |
| "//src/sys/lib/component_debug", |
| "//src/sys/lib/moniker", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.net:fuchsia.net_rust", |
| "//src/lib/fidl/rust/fidl_test_util", |
| "//src/lib/fuchsia", |
| ] |
| |
| sources = [ |
| "src/host_identifier.rs", |
| "src/http.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| output_name = "remote_control_bin" |
| edition = "2024" |
| with_unit_tests = true |
| |
| deps = [ |
| ":lib", |
| ":remote_control_config", |
| "//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.vsock:fuchsia.vsock_rust", |
| "//src/connectivity/overnet/lib/circuit", |
| "//src/connectivity/overnet/lib/core", |
| "//src/lib/diagnostics/log/rust", |
| "//src/lib/fdomain/container", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fidl/rust/fidl_message", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| |
| sources = [ |
| "src/fdomain.rs", |
| "src/main.rs", |
| "src/vsock.rs", |
| ] |
| } |
| |
| fuchsia_test_component("lib_test-test-driver") { |
| component_name = "test_driver" |
| manifest = "meta/test_driver.cml" |
| deps = [ ":lib_test" ] |
| } |
| |
| fuchsia_test_component("lib_test-component") { |
| component_name = "remote_control_lib_test" |
| manifest = "meta/remote_control_lib_test.cml" |
| } |
| |
| fuchsia_test_package("remote-control-lib-tests") { |
| test_components = [ ":lib_test-component" ] |
| deps = [ |
| ":lib_test-test-driver", |
| "//src/connectivity/network/netstack:component", |
| ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| fuchsia_component("remote-control-component") { |
| component_name = "remote-control" |
| manifest = "meta/remote-control.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("remote-control-package") { |
| package_name = "remote-control" |
| deps = [ |
| ":remote-control-component", |
| "//build/validate:non_production_tag", |
| "//src/developer/remote-control/fdomain-runner:bin", |
| "//src/developer/remote-control/runner:bin", |
| ] |
| } |
| |
| fuchsia_package_archive("remote-control-archive") { |
| package = ":remote-control-package" |
| } |