blob: 2fc25c82d44aa9c658570d67bdc2b1c9afe9dd28 [file] [log] [blame]
# Copyright 2022 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_library.gni")
import("//src/developer/ffx/config.gni")
assert(is_host, "ffx_isolate is for use with the host toolchain only")
rustc_library("lib") {
name = "ffx_isolate"
version = "0.1.0"
edition = "2021"
with_unit_tests = true
deps = [
"//src/developer/ffx/config:lib",
"//src/developer/ffx/daemon:lib",
"//src/developer/ffx/lib/executor:lib",
"//src/developer/ffx/lib/sdk:lib",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tempfile",
]
_subtool_search_test_data =
rebase_path(ffx_test_host_tools_out_dir, root_build_dir)
_subtool_search_host_tools = rebase_path(host_tools_dir, root_build_dir)
# We pass the paths to the host tools and test data directories into the rust
# build as environment variables so that for unit-test situations, they can
# be used to find tools from the build root.
rustenv = [
"SUBTOOL_SEARCH_TEST_DATA=${_subtool_search_test_data}",
"SUBTOOL_SEARCH_HOST_TOOLS=${_subtool_search_host_tools}",
]
sources = [ "src/lib.rs" ]
}
group("tests") {
testonly = true
deps = [ ":lib_test" ]
}
group("isolate") {
testonly = true
deps = [
":lib",
":tests",
]
}