blob: bc4c35b350dca4371f8cbe9ee9a65d65146a347f [file] [log] [blame] [edit]
# 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/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
import("//build/testing/test_spec.gni")
group("remote-control") {
testonly = true
public_deps = [
":pkg",
":tests",
]
}
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 = "2018"
with_unit_tests = true
deps = [
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol-rustc",
"//sdk/fidl/fuchsia.device:fuchsia.device-rustc",
"//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc",
"//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.net:fuchsia.net-rustc",
"//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//sdk/fidl/fuchsia.test:fuchsia.test-rustc",
"//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager-rustc",
"//src/connectivity/overnet/lib/hoist",
"//src/diagnostics/lib/selectors",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/lib/zircon/rust:fuchsia-zircon-sys",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:log",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/lib.rs",
"src/service_discovery.rs",
]
}
rustc_binary("bin") {
name = "remote-control-bin"
edition = "2018"
deps = [
":lib",
"//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol-rustc",
"//sdk/fidl/fuchsia.overnet:fuchsia.overnet-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//src/connectivity/overnet/lib/hoist",
"//src/developer/remote-control/diagnostics-bridge",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/args.rs",
"src/main.rs",
]
}
test_package("remote-control-lib-tests") {
deps = [
":lib_test",
"//src/developer/remote-control/testing/mock-sys-launcher:mock-sys-launcher-bin",
]
meta = [
{
path = rebase_path("testing/mock-sys-launcher/meta/mock_sys_launcher.cml")
dest = "mock_sys_launcher.cm"
},
{
path = rebase_path("meta/test_driver.cml")
dest = "test_driver.cm"
},
]
binaries = [
{
name = "mock_sys_launcher"
},
]
v2_tests = [
{
name = "remote_control_lib_test"
environments = basic_envs
},
]
}
package("pkg-diagnostics-bridge") {
package_name = "remote-diagnostics-bridge"
deps = [
":bin",
"//build/validate:non_production_tag",
"//src/developer/remote-control/diagnostics-bridge",
]
binaries = [
{
name = "remote_control_bin"
},
]
meta = [
{
path = rebase_path("diagnostics-bridge/meta/diagnostics-bridge.cml")
dest = "diagnostics-bridge.cm"
},
]
}
package("pkg") {
package_name = "remote-control"
deps = [
":bin",
"//build/validate:non_production_tag",
"//src/developer/remote-control/diagnostics-bridge",
"//src/developer/remote-control/runner",
]
binaries = [
{
name = "remote_control_bin"
},
{
name = "remote_control_runner"
shell = true
},
]
meta = [
{
path = rebase_path("meta/remote-control.cml")
dest = "remote-control.cm"
},
{
path = rebase_path("runner/meta/remote-control-runner.cmx")
dest = "remote-control-runner.cmx"
},
]
}
# This group is cached in core. Only add dependencies to this
# if they belong in core.
group("runtime") {
deps = [
":pkg",
":pkg-diagnostics-bridge",
"//src/connectivity/overnet:runtime",
]
}