| # 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/host.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| bin_deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc", |
| "//src/connectivity/overnet/lib/hoist", |
| "//src/diagnostics/lib/selectors", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/diagnostics/hierarchy/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:clap", |
| "//third_party/rust_crates:difference", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:structopt", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:termion", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| bin_sources = [ "src/main.rs" ] |
| |
| rustc_binary("bin") { |
| name = "diag_tool" |
| version = "0.1.0" |
| edition = "2018" |
| |
| deps = bin_deps |
| |
| sources = bin_sources |
| } |
| |
| rustc_test("diag-tool-unittests") { |
| deps = [ ":bin" ] + bin_deps |
| source_root = "src/main.rs" |
| sources = bin_sources |
| } |
| |
| install_host_tools("diag_tool_host") { |
| deps = [ ":bin($host_toolchain)" ] |
| outputs = [ "diag_tool" ] |
| } |
| |
| group("host_tests") { |
| testonly = true |
| deps = [ ":diag-tool-unittests($host_toolchain)" ] |
| } |