| # 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/components.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//tools/cmc/build/expect_includes.gni") |
| |
| group("focus_chain_provider") { |
| testonly = true |
| deps = [ ":tests" ] |
| } |
| |
| # Private target containing just the library, without required CML includes. |
| # |
| # If using this library in production, use ":lib_with_includes". |
| # |
| # If using this library for tests, or as a dependency for another library |
| # that might not use `focus_chain_provider` in all configurations, use |
| # ":lib_without_includes". |
| rustc_library("lib") { |
| name = "focus_chain_provider" |
| visibility = [ ":*" ] |
| with_unit_tests = true |
| edition = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.ui.focus:fuchsia.ui.focus_rust", |
| "//src/lib/async-utils", |
| "//src/lib/fuchsia-async", |
| "//src/lib/ui/fidl_fuchsia_ui_focus_ext:lib", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| test_deps = [ |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/ui/fidl_fuchsia_ui_focus_ext:test-helpers-lib", |
| ] |
| sources = [ |
| "src/instance_counter.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| # The focus_chain_provider library, with required CML includes. Use this target |
| # in production. |
| group("lib_with_includes") { |
| public_deps = [ |
| ":lib", |
| ":lib_includes", |
| ] |
| } |
| |
| # The focus_chain_provider library, without enforcement of CML includes. Useful |
| # for test components and for cases where the library must be present but a |
| # `FocusChainProvider` is not actually exposed. |
| group("lib_without_includes") { |
| public_deps = [ ":lib" ] |
| } |
| |
| expect_includes("lib_includes") { |
| includes = [ "meta/client.shard.cml" ] |
| } |
| |
| fuchsia_unittest_package("lib_tests") { |
| deps = [ ":lib_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":lib_tests" ] |
| } |