| # 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("//src/sys/build/components.gni") |
| |
| rustc_library("lib") { |
| name = "dns" |
| with_unit_tests = true |
| edition = "2018" |
| deps = [ |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.name:fuchsia.net.name-rustc", |
| "//src/connectivity/lib/net-declare", |
| "//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", |
| ] |
| test_deps = [ "//third_party/rust_crates:matches" ] |
| |
| sources = [ |
| "src/async_resolver.rs", |
| "src/lib.rs", |
| "src/policy.rs", |
| "src/tcp.rs", |
| "src/test_util.rs", |
| "src/udp.rs", |
| ] |
| } |
| |
| fuchsia_component("dns_lib_test") { |
| testonly = true |
| manifest = "meta/dns_lib_test.cmx" |
| deps = [ ":lib_test" ] |
| } |
| |
| rustc_binary("bin") { |
| name = "dns_resolver" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| ":lib", |
| "//garnet/lib/rust/never", |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.name:fuchsia.net.name-rustc", |
| "//sdk/fidl/fuchsia.net.routes:fuchsia.net.routes-rustc", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc", |
| "//src/connectivity/lib/net-declare", |
| "//src/connectivity/lib/net-types", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//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:lazy_static", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:trust-dns-proto", |
| "//third_party/rust_crates:trust-dns-resolver", |
| ] |
| |
| test_deps = [ "//src/connectivity/lib/net-declare" ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_unittest_package("dns-resolver-tests") { |
| executable_path = "bin/dns_resolver_bin_test" |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_test_package("dns-tests") { |
| test_components = [ ":dns_lib_test" ] |
| deps = [ "//src/connectivity/network/netstack:component-debug" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "dns-resolver" |
| manifest = "meta/dns-resolver.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_component("component-v2") { |
| component_name = "dns_resolver" |
| manifest = "meta/dns_resolver.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("dns-resolver") { |
| deps = [ ":component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":dns-resolver-tests", |
| ":dns-tests", |
| ] |
| } |