| # 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("//build/rust/rustc_library.gni") | |
| import("//build/test/test_package.gni") | |
| import("//build/testing/environments.gni") | |
| rustc_library("lib") { | |
| name = "dhcp" | |
| with_unit_tests = true | |
| edition = "2018" | |
| deps = [ | |
| "//garnet/lib/rust/fidl_fuchsia_hardware_ethernet_ext", | |
| "//garnet/lib/rust/never", | |
| "//garnet/public/lib/fidl/rust/fidl", | |
| "//garnet/public/rust/fuchsia-async", | |
| "//garnet/public/rust/fuchsia-component", | |
| "//garnet/public/rust/fuchsia-zircon", | |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc", | |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc", | |
| "//third_party/rust_crates:bytes", | |
| "//third_party/rust_crates:failure", | |
| "//third_party/rust_crates:log", | |
| "//third_party/rust_crates:num-derive", | |
| "//third_party/rust_crates:num-traits", | |
| "//third_party/rust_crates:rand", | |
| "//third_party/rust_crates:serde", | |
| "//third_party/rust_crates:serde_derive", | |
| "//third_party/rust_crates:serde_json", | |
| "//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc", | |
| ] | |
| } | |
| test_package("dhcp_tests") { | |
| deps = [ | |
| ":lib_test", | |
| ] | |
| tests = [ | |
| { | |
| name = "dhcp_lib_test" | |
| environments = [ qemu_env ] | |
| }, | |
| ] | |
| } | |
| rustc_binary("bin") { | |
| name = "dhcpd" | |
| with_unit_tests = true | |
| edition = "2018" | |
| deps = [ | |
| ":lib", | |
| "//garnet/public/lib/fidl/rust/fidl", | |
| "//garnet/public/rust/fuchsia-async", | |
| "//garnet/public/rust/fuchsia-component", | |
| "//garnet/public/rust/fuchsia-syslog", | |
| "//garnet/public/rust/fuchsia-zircon", | |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc", | |
| "//src/lib/argh", | |
| "//third_party/rust_crates:failure", | |
| "//third_party/rust_crates:futures", | |
| "//third_party/rust_crates:getopts", | |
| "//third_party/rust_crates:log", | |
| "//third_party/rust_crates:void", | |
| "//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc", | |
| ] | |
| test_deps = [ | |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc", | |
| "//third_party/rust_crates:rand", | |
| ] | |
| } | |
| package("dhcpd") { | |
| deps = [ | |
| ":bin", | |
| ] | |
| meta = [ | |
| { | |
| path = rebase_path("meta/dhcpd.cmx") | |
| dest = "dhcpd.cmx" | |
| }, | |
| { | |
| path = rebase_path("meta/dhcpd_test.cmx") | |
| dest = "dhcpd_test.cmx" | |
| }, | |
| ] | |
| resources = [ | |
| { | |
| path = rebase_path("data/default_config.json") | |
| dest = "config.json" | |
| }, | |
| { | |
| path = rebase_path("data/test_config.json") | |
| dest = "test_config.json" | |
| }, | |
| ] | |
| binaries = [ | |
| { | |
| name = "dhcpd" | |
| }, | |
| ] | |
| } | |
| test_package("dhcpd_tests") { | |
| deps = [ | |
| ":bin_test", | |
| ] | |
| tests = [ | |
| { | |
| name = "dhcpd_bin_test" | |
| environments = [ qemu_env ] | |
| }, | |
| ] | |
| } | |
| group("dhcp") { | |
| testonly = true | |
| public_deps = [ | |
| ":dhcpd", | |
| "//src/connectivity/network/dhcp/config", | |
| ] | |
| } |