blob: 148b08648bb4ac06b5a593bc1048035315e515c8 [file] [log] [blame]
# 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")
group("remote-control") {
testonly = true
public_deps = [
":remote-control-package",
":tests",
]
}
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/runner:tests",
]
}
rustc_library("lib") {
name = "remote-control"
edition = "2021"
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:fuchsia.diagnostics_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",
"//src/developer/remote-control/fidl:fuchsia.developer.remotecontrol.connector_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/fuchsia-runtime",
"//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",
"//src/lib/fuchsia-async",
]
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",
"//src/connectivity/overnet/lib/circuit",
"//src/connectivity/overnet/lib/core",
"//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_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 = [
":moniker-map",
":remote-control-component",
"//src/developer/remote-control/runner:bin",
]
}
fuchsia_package_archive("remote-control-archive") {
package = ":remote-control-package"
}