| # Copyright 2018 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/config.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| |
| group("sessions") { |
| testonly = true |
| deps = [ |
| ":mediasession", |
| ":tests", |
| "//src/media/sessions/examples", |
| "//src/media/sessions/mediasession_cli_tool", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":mediasession_tests" ] |
| } |
| |
| rustc_binary("bin") { |
| name = "mediasession" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.media:fuchsia.media_rust", |
| "//sdk/fidl/fuchsia.media.audio:fuchsia.media.audio_rust", |
| "//sdk/fidl/fuchsia.media.sessions2:fuchsia.media.sessions2_rust", |
| "//src/lib/async-utils", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fidl_table_validation", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/mpmc", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", |
| "//src/lib/fuchsia-component-test", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:futures-test", |
| ] |
| |
| sources = [ |
| "src/id.rs", |
| "src/interrupter.rs", |
| "src/main.rs", |
| "src/proxies.rs", |
| "src/proxies/observer.rs", |
| "src/proxies/player.rs", |
| "src/services.rs", |
| "src/services/active_session.rs", |
| "src/services/discovery.rs", |
| "src/services/discovery/filter.rs", |
| "src/services/discovery/watcher.rs", |
| "src/services/publisher.rs", |
| "src/test.rs", |
| "src/test/integration.rs", |
| ] |
| } |
| |
| fuchsia_unittest_package("mediasession_tests") { |
| manifest = "meta/mediasession_bin_test.cml" |
| deps = [ |
| ":bin_test", |
| ":component", |
| "//src/lib/fuchsia-component-test/realm_builder_server:realm_builder_server_component", |
| ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "mediasession" |
| manifest = "meta/mediasession.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("mediasession") { |
| deps = [ ":component" ] |
| } |
| |
| core_shard("mediasession_core_shard") { |
| shard_file = "meta/mediasession.core_shard.cml" |
| } |