chromium/chromeos/ash/components/nearby/presence/BUILD.gn

# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//testing/test.gni")

assert(is_chromeos_ash, "Non-Chrome-OS builds must not depend on //ash")

static_library("presence") {
  sources = [
    "nearby_presence_service.cc",
    "nearby_presence_service.h",
    "nearby_presence_service_enum_coversions.cc",
    "nearby_presence_service_enum_coversions.h",
    "nearby_presence_service_impl.cc",
    "nearby_presence_service_impl.h",
    "prefs/nearby_presence_prefs.cc",
    "prefs/nearby_presence_prefs.h",
  ]

  deps = [
    "//ash/constants",
    "//ash/public/cpp",
    "//base",
    "//chrome/browser/profiles:profile",
    "//chromeos/ash/components/nearby/presence/conversions",
    "//chromeos/ash/components/nearby/presence/credentials",
    "//chromeos/ash/components/nearby/presence/metrics",
    "//chromeos/ash/components/nearby/presence/proto",
    "//chromeos/ash/services/nearby/public/cpp:cpp",
    "//chromeos/ash/services/nearby/public/mojom",
    "//components/cross_device/logging:logging",
    "//components/keyed_service/content:content",
    "//components/keyed_service/core",
    "//components/pref_registry:pref_registry",
    "//components/prefs",
    "//components/push_notification:push_notification",
    "//content/public/browser",
  ]

  public_deps = [
    ":enums",
    ":nearby_presence_connections_manager",
    "//third_party/nearby:connections_metadata_proto",
    "//third_party/nearby:presence_types",
  ]
}

static_library("enums") {
  sources = [
    "enums/nearby_presence_enums.cc",
    "enums/nearby_presence_enums.h",
  ]

  deps = [ "//mojo/public/mojom/base" ]
}

source_set("nearby_presence_connections_manager") {
  sources = [
    "nearby_presence_connections_manager.cc",
    "nearby_presence_connections_manager.h",
  ]

  deps = [
    "//base",
    "//chromeos/ash/components/nearby/common/connections_manager:connections_manager",
    "//components/cross_device/logging:logging",
  ]
}

source_set("test_support") {
  testonly = true
  sources = [
    "fake_nearby_presence_service.cc",
    "fake_nearby_presence_service.h",
  ]
  deps = [
    ":nearby_presence_connections_manager",
    ":presence",
    "//base",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "nearby_presence_connections_manager_unittest.cc",
    "nearby_presence_service_impl_unittest.cc",
  ]

  deps = [
    ":nearby_presence_connections_manager",
    ":presence",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//chrome/test:test_support",
    "//chromeos/ash/components/nearby/presence/conversions:unit_tests",
    "//chromeos/ash/components/nearby/presence/credentials",
    "//chromeos/ash/components/nearby/presence/credentials:test_support",
    "//chromeos/ash/components/nearby/presence/credentials:unit_tests",
    "//chromeos/ash/services/nearby/public/cpp:test_support",
    "//components/prefs:prefs",
    "//components/prefs:test_support",
    "//components/push_notification:test_support",
    "//content/public/browser",
    "//content/test:test_support",
    "//mojo/public/cpp/bindings:bindings",
    "//testing/gtest",
  ]
}