blob: 92960e4895fa03228abcc944526f503de8a3c654 [file] [log] [blame]
# 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/components.gni")
import("//build/rust/rustc_binary.gni")
import("//build/security.gni")
group("tests") {
testonly = true
deps = [
":example",
":unittests",
]
}
rustc_binary("bin") {
edition = "2021"
output_name = "full_resolver"
# Generates a GN target for unit-tests with the label `bin_test`, and
# a binary named `full_resolver_bin_test`.
with_unit_tests = true
deps = [
":config_lib",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.component.resolution:fuchsia.component.resolution_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-url",
"//src/sys/lib/mem_util",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//sdk/fidl/fuchsia.component.config:fuchsia.component.config_rust",
"//sdk/fidl/fuchsia.mem:fuchsia.mem_rust",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component-test",
"//src/lib/storage/vfs/rust:vfs",
"//third_party/rust_crates:assert_matches",
]
sources = [ "src/main.rs" ]
}
fuchsia_component_manifest("manifest") {
component_name = "full-resolver"
manifest = "meta/full-resolver.cml"
}
fuchsia_component("component") {
cm_label = ":manifest"
deps = [ ":bin" ]
}
fuchsia_structured_config_rust_lib("config_lib") {
cm_label = ":manifest"
name = "full_resolver_config"
visibility = [ ":*" ]
}
fuchsia_structured_config_values("config_values_from_gn") {
cm_label = ":manifest"
values = {
enable_subpackages = full_resolver_enable_subpackages
}
}
fuchsia_structured_config_values("config_values_from_gn_for_test") {
cm_label = ":manifest"
values = {
enable_subpackages = full_resolver_enable_subpackages
}
}
fuchsia_package("full-resolver") {
deps = [
":component",
":config_values_from_gn",
]
}
fuchsia_component("example") {
manifest = "meta/example.cml"
}
fuchsia_unittest_package("unittests") {
package_name = "full-resolver-unittests"
manifest = "meta/full-resolver-unittests.cml"
deps = [
":bin_test",
":component",
":config_values_from_gn_for_test",
]
}