| # 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/config.gni") |
| import("//build/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| declare_args() { |
| netcfg_autostart = true |
| } |
| |
| rustc_binary("bin") { |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "//garnet/lib/rust/fidl_fuchsia_hardware_ethernet_ext", |
| "//garnet/lib/rust/fidl_fuchsia_net_ext", |
| "//garnet/lib/rust/fidl_fuchsia_net_stack_ext", |
| "//garnet/lib/rust/fidl_fuchsia_netstack_ext", |
| "//garnet/lib/rust/io_util", |
| "//garnet/lib/rust/netfilter", |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc", |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc", |
| "//sdk/fidl/fuchsia.net.filter:fuchsia.net.filter-rustc", |
| "//sdk/fidl/fuchsia.net.name:fuchsia.net.name-rustc", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc", |
| "//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc", |
| "//src/connectivity/management/network_manager/core/interface:lib", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/storage/fuchsia-vfs-watcher", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:pin-utils", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:thiserror", |
| "//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc", |
| ] |
| |
| name = "netcfg" |
| } |
| |
| package("netcfg") { |
| deps = [ ":bin" ] |
| |
| binary = "netcfg" |
| |
| meta = [ |
| { |
| path = rebase_path("meta/netcfg.cmx") |
| dest = "netcfg.cmx" |
| }, |
| ] |
| } |
| |
| config_data("config_default") { |
| for_pkg = "netcfg" |
| sources = [ rebase_path("config/default.json") ] |
| outputs = [ "default.json" ] |
| } |
| |
| config_data("config_no_ssh_over_wlan") { |
| for_pkg = "netcfg" |
| sources = [ rebase_path("config/no_ssh_over_wlan.json") ] |
| outputs = [ "default.json" ] |
| } |
| |
| if (netcfg_autostart) { |
| config_data("config") { |
| for_pkg = "sysmgr" |
| sources = [ "netcfg.config" ] |
| } |
| } else { |
| group("config") { |
| } |
| } |
| |
| test_package("netcfg_tests") { |
| deps = [ ":bin_test" ] |
| tests = [ |
| { |
| name = "netcfg_bin_test" |
| dest = "netcfg_bin_test" |
| environments = basic_envs |
| }, |
| ] |
| } |