blob: e78ca57fc8549d57b4ee78ae25791dd628158dc3 [file] [log] [blame]
# Copyright 2021 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/fidl/fidl.gni")
import("//build/rust/rustc_binary.gni")
group("services") {
testonly = true
deps = [ ":tests" ]
}
group("tests") {
testonly = true
deps = [ ":service-examples" ]
}
fidl("fuchsia.examples.services") {
sources = [ "test.fidl" ]
}
rustc_test("branch-bin") {
deps = [
":fuchsia.examples.services-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
]
sources = [ "src/branch.rs" ]
source_root = "src/branch.rs"
}
rustc_binary("provider-bin") {
deps = [
":fuchsia.examples.services-rustc",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
]
sources = [ "src/provider.rs" ]
source_root = "src/provider.rs"
}
fuchsia_component("services-cmp") {
testonly = true
component_name = "services"
manifest = "meta/services.cml"
unstable_features = [ "services" ]
}
fuchsia_component("branch-cmp") {
testonly = true
component_name = "branch"
manifest = "meta/branch.cml"
unstable_features = [ "services" ]
deps = [ ":branch-bin" ]
}
fuchsia_component("provider-a-cmp") {
testonly = true
component_name = "provider-a"
manifest = "meta/provider-a.cml"
unstable_features = [ "services" ]
deps = [ ":provider-bin" ]
}
fuchsia_component("provider-b-cmp") {
testonly = true
component_name = "provider-b"
manifest = "meta/provider-b.cml"
unstable_features = [ "services" ]
deps = [ ":provider-bin" ]
}
# Run with `fx test service-examples`.
fuchsia_test_package("service-examples") {
test_components = [ ":services-cmp" ]
deps = [
":branch-cmp",
":provider-a-cmp",
":provider-b-cmp",
]
}