blob: 60b35bc4b65ecf9f9801378f95105a0426b5319d [file] [log] [blame]
# Copyright 2018 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")
rustc_library("lib") {
name = "net_cli"
with_unit_tests = true
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_rust",
"//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network_rust",
"//sdk/fidl/fuchsia.net:fuchsia.net_rust",
"//sdk/fidl/fuchsia.net.debug:fuchsia.net.debug_rust",
"//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp_rust",
"//sdk/fidl/fuchsia.net.filter:fuchsia.net.filter_rust",
"//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust",
"//sdk/fidl/fuchsia.net.interfaces.admin:fuchsia.net.interfaces.admin_rust",
"//sdk/fidl/fuchsia.net.name:fuchsia.net.name_rust",
"//sdk/fidl/fuchsia.net.neighbor:fuchsia.net.neighbor_rust",
"//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack_rust",
"//sdk/fidl/fuchsia.netstack:fuchsia.netstack_rust",
"//src/connectivity/lib/fidl_fuchsia_net_neighbor_ext",
"//src/connectivity/lib/fidl_fuchsia_net_stack_ext",
"//src/connectivity/network/lib/netfilter",
"//src/developer/ffx/lib/writer:lib",
"//src/lib/fidl/rust/fidl",
"//src/lib/network/fidl_fuchsia_net_ext",
"//src/lib/network/fidl_fuchsia_net_interfaces_ext",
"//src/lib/zircon/rust:fuchsia-zircon-status",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:log",
"//third_party/rust_crates:prettytable-rs",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//src/connectivity/lib/net-declare",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:pretty_assertions",
"//third_party/rust_crates:proptest",
"//third_party/rust_crates:test-case",
]
sources = [
"src/lib.rs",
"src/opts/dhcpd.rs",
"src/opts/dns.rs",
"src/opts/mod.rs",
"src/ser.rs",
]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
rustc_binary("bin") {
name = "net"
edition = "2021"
deps = [
":lib",
"//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_rust",
"//sdk/fidl/fuchsia.net.debug:fuchsia.net.debug_rust",
"//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp_rust",
"//sdk/fidl/fuchsia.net.filter:fuchsia.net.filter_rust",
"//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust",
"//sdk/fidl/fuchsia.net.name:fuchsia.net.name_rust",
"//sdk/fidl/fuchsia.net.neighbor:fuchsia.net.neighbor_rust",
"//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack_rust",
"//sdk/fidl/fuchsia.netstack:fuchsia.netstack_rust",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust",
"//src/developer/ffx/lib/writer:lib",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:log",
]
sources = [ "src/main.rs" ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_shell_package("net-cli") {
deps = [
":bin",
"//build/validate:non_production_tag",
]
}
fuchsia_unittest_package("net-cli-tests") {
deps = [ ":lib_test" ]
}
group("tests") {
testonly = true
deps = [
":lib_test($host_toolchain)",
":net-cli-tests",
]
}