| # Copyright 2020 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/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| |
| rustc_library("lib") { |
| name = "dns" |
| with_unit_tests = true |
| edition = "2018" |
| deps = [ |
| "//sdk/fidl/fuchsia.net.name:fuchsia.net.name-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:trust-dns-proto", |
| "//third_party/rust_crates:trust-dns-resolver", |
| "//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc", |
| ] |
| } |
| |
| test_package("dns-tests") { |
| deps = [ ":lib_test" ] |
| |
| tests = [ |
| { |
| name = "dns_lib_test" |
| environments = [ qemu_env ] |
| }, |
| ] |
| } |
| |
| rustc_binary("bin") { |
| name = "dns_resolver" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| ":lib", |
| "//garnet/lib/rust/fidl_fuchsia_net_ext", |
| "//garnet/lib/rust/never", |
| "//sdk/fidl/fuchsia.net.name:fuchsia.net.name-rustc", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/inspect/rust/fuchsia-inspect", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:trust-dns-proto", |
| "//third_party/rust_crates:trust-dns-resolver", |
| "//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc", |
| ] |
| } |
| |
| package("dns-resolver") { |
| deps = [ ":bin" ] |
| binaries = [ |
| { |
| name = "dns_resolver" |
| }, |
| ] |
| meta = [ |
| { |
| path = rebase_path("meta/dns-resolver.cmx") |
| dest = "dns-resolver.cmx" |
| }, |
| ] |
| } |
| |
| unittest_package("dns-resolver-tests") { |
| deps = [ ":bin_test" ] |
| |
| tests = [ |
| { |
| name = "dns_resolver_bin_test" |
| environments = [ qemu_env ] |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":dns-resolver-tests", |
| ":dns-tests", |
| ] |
| } |