| # 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/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//src/sys/build/components.gni") |
| |
| rustc_binary("bin") { |
| name = "net" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "//garnet/lib/rust/io_util", |
| "//garnet/lib/rust/netfilter", |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc", |
| "//sdk/fidl/fuchsia.inspect.deprecated:fuchsia.inspect.deprecated-rustc", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger-rustc", |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc", |
| "//sdk/fidl/fuchsia.net.filter:fuchsia.net.filter-rustc", |
| "//sdk/fidl/fuchsia.net.neighbor:fuchsia.net.neighbor-rustc", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc", |
| "//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc", |
| "//src/diagnostics/lib/inspect-fidl-load", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//src/lib/network/fidl_fuchsia_net_neighbor_ext", |
| "//src/lib/network/fidl_fuchsia_net_stack_ext", |
| "//src/lib/network/fidl_fuchsia_netstack_ext", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/tools/cs:lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:prettytable-rs", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "src/main.rs", |
| "src/opts.rs", |
| ] |
| } |
| |
| package("net-cli") { |
| deps = [ |
| ":bin", |
| "//build/validate:non_production_tag", |
| ] |
| |
| binaries = [ |
| { |
| name = "net" |
| shell = true |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = "meta/net.cmx" |
| dest = "net.cmx" |
| }, |
| ] |
| } |
| |
| fuchsia_unittest_package("net-cli-tests") { |
| deps = [ ":bin_test" ] |
| executable_path = "bin/net_bin_test" |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":net-cli-tests" ] |
| } |