blob: aefb86838da3e4f206851c30e118352a28e3da5e [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/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
import("//src/sys/build/components.gni")
rustc_binary("bin") {
output_name = "dhcpd_cli"
edition = "2018"
deps = [
"//sdk/fidl/fuchsia.net:fuchsia.net-rustc",
"//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/network/fidl_fuchsia_hardware_ethernet_ext",
"//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:thiserror",
]
sources = [
"src/args.rs",
"src/main.rs",
]
}
fuchsia_component("component") {
component_name = "dhcpd-cli"
deps = [ ":bin" ]
manifest = "meta/dhcpd-cli.cmx"
}
rustc_test("dhcpd-cli-test") {
edition = "2018"
deps = [
"//sdk/fidl/fuchsia.net:fuchsia.net-rustc",
"//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc",
"//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket-rustc",
"//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//src/connectivity/lib/net-declare",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
]
sources = [ "src/lib.rs" ]
}
fuchsia_component("dhcpd-cli-test-component") {
testonly = true
deps = [ ":dhcpd-cli-test" ]
manifest = "meta/dhcpd_cli_test.cmx"
}
package("dhcpd-cli") {
deps = [ ":bin" ]
binaries = [
{
name = "dhcpd_cli"
dest = "dhcpd-cli"
shell = true
},
]
}
fuchsia_test_package("dhcpd-cli-tests") {
test_components = [ ":dhcpd-cli-test-component" ]
deps = [
":component",
"//src/connectivity/network/dhcp:component",
"//src/connectivity/network/netstack:component-debug",
"//src/sys/stash:stash_secure",
]
}
group("tests") {
testonly = true
deps = [ ":dhcpd-cli-tests" ]
}