| # Copyright 2019 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/rust/rustc_binary.gni") |
| import("//src/sys/build/fuchsia_component.gni") |
| import("//src/sys/build/fuchsia_package.gni") |
| import("//src/sys/build/fuchsia_unittest_package.gni") |
| |
| rustc_binary("bin") { |
| name = "reachability" |
| version = "0.1.0" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "core:lib", |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc", |
| "//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc", |
| "//src/connectivity/management/network-manager/core:lib", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//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:thiserror", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:environment-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:network-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:sandbox-rustc", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:pin-utils", |
| ] |
| |
| sources = [ |
| "src/eventloop.rs", |
| "src/main.rs", |
| "src/worker.rs", |
| ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "reachability" |
| manifest = "meta/reachability.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("reachability") { |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_unittest_package("reachability-tests") { |
| deps = [ ":bin_test" ] |
| manifest = "meta/reachability_bin_test.cmx" |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":reachability-tests", |
| "core:tests", |
| ] |
| } |
| |
| config_data("reachability_sysmgr_config") { |
| for_pkg = "sysmgr" |
| sources = [ rebase_path("config/reachability.sysmgr_config") ] |
| } |