| # 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/config.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") |
| import("//src/sys/core/build/core_shard.gni") |
| |
| group("remote-control") { |
| testonly = true |
| |
| public_deps = [ |
| ":remote-control-package", |
| ":tests", |
| ] |
| } |
| |
| resource("selector-maps") { |
| sources = [ "data/selector-maps.json" ] |
| outputs = [ "data/selector-maps.json" ] |
| } |
| |
| resource("moniker-map") { |
| sources = [ "data/moniker-map.json" ] |
| outputs = [ "data/moniker-map.json" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":remote-control-lib-tests", |
| "//src/developer/remote-control/diagnostics-bridge:tests", |
| "//src/developer/remote-control/runner:tests", |
| ] |
| } |
| |
| rustc_library("lib") { |
| name = "remote-control" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_rust", |
| "//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:fuchsia.diagnostics_rust", |
| "//sdk/fidl/fuchsia.hwinfo:fuchsia.hwinfo_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_rust", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//src/developer/ffx/lib/selector-maps", |
| "//src/lib/diagnostics/selectors", |
| "//src/lib/fdio/rust:fdio", |
| "//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_ext", |
| "//src/lib/network/fidl_fuchsia_net_interfaces_ext", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/component_debug", |
| "//src/sys/lib/moniker", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.net:fuchsia.net_rust", |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:assert_matches", |
| ] |
| |
| sources = [ |
| "src/host_identifier.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| output_name = "remote_control_bin" |
| edition = "2021" |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol_rust", |
| "//sdk/fidl/fuchsia.hardware.overnet:fuchsia.hardware.overnet_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.overnet:fuchsia.overnet_rust", |
| "//src/connectivity/overnet/lib/circuit", |
| "//src/connectivity/overnet/lib/core", |
| "//src/connectivity/overnet/lib/hoist", |
| "//src/developer/remote-control/diagnostics-bridge", |
| "//src/lib/diagnostics/log/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ |
| "src/args.rs", |
| "src/main.rs", |
| "src/usb.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_package_with_single_component("pkg-diagnostics-bridge") { |
| package_name = "remote-diagnostics-bridge" |
| deps = [ |
| ":bin", |
| "//build/validate:non_production_tag", |
| "//src/developer/remote-control/diagnostics-bridge", |
| ] |
| manifest = "diagnostics-bridge/meta/remote-diagnostics-bridge.cml" |
| } |
| |
| fuchsia_component("remote-control-component") { |
| component_name = "remote-control" |
| manifest = "meta/remote-control.cml" |
| deps = [ |
| ":bin", |
| "//src/connectivity/overnet/overnetstack:certificates", |
| "//src/developer/remote-control/diagnostics-bridge", |
| ] |
| } |
| |
| fuchsia_package("remote-control-package") { |
| package_name = "remote-control" |
| deps = [ |
| ":moniker-map", |
| ":remote-control-component", |
| ":selector-maps", |
| "//src/developer/remote-control/runner:bin", |
| ] |
| } |
| |
| fuchsia_package_archive("remote-control-archive") { |
| package = ":remote-control-package" |
| } |
| |
| # This shard enables ffx component laboratory functionality. |
| # Note that the laboratory core shard requires the `laboratory-env`, so when |
| # the laboratory shard is included in a product, a core shard must also be |
| # included that defines this environment. |
| core_shard("laboratory-core-shard") { |
| shard_file = "meta/laboratory.core_shard.cml" |
| } |