Files
nearby/internal/platform/implementation/g3/BUILD
T
hai007 0fb3683e55 Automated Code Change
PiperOrigin-RevId: 940848701
2026-06-30 22:14:59 -07:00

255 lines
8.0 KiB
Python

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
licenses(["notice"])
cc_library(
name = "linux_path_util",
hdrs = ["linux_path_util.h"],
visibility = ["//visibility:public"],
deps = [
"//internal/base:file_path",
"//internal/base:files",
],
)
cc_library(
name = "types",
testonly = True,
srcs = [
"preferences_manager.cc",
"scheduled_executor.cc",
"system_clock.cc",
],
hdrs = [
"atomic_boolean.h",
"atomic_reference.h",
"condition_variable.h",
"device_info.h",
"multi_thread_executor.h",
"mutex.h",
"preferences_manager.h",
"scheduled_executor.h",
"single_thread_executor.h",
"timer.h",
],
visibility = ["//visibility:private"],
deps = [
":linux_path_util",
":preferences_repository",
"//internal/base:file_path",
"//internal/base:files",
"//internal/platform:base",
"//internal/platform:logging",
"//internal/platform:test_util",
"//internal/platform/implementation:types",
"//internal/platform/implementation/shared:count_down_latch",
"//internal/platform/implementation/shared:posix_mutex",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
"@com_google_absl//absl/types:span",
"@com_google_nisaba//nisaba/port:thread_pool",
"@com_google_protobuf//:protobuf",
"@com_google_protobuf//json",
"@nlohmann_json//:json",
],
alwayslink = 1,
)
cc_library(
name = "comm",
testonly = True,
srcs = [
"awdl.cc",
"ble.cc",
"bluetooth_adapter.cc",
"bluetooth_classic.cc",
"credential_storage_impl.cc",
"webrtc.cc",
"wifi_direct.cc",
"wifi_hotspot.cc",
"wifi_lan.cc",
],
hdrs = [
"awdl.h",
"ble.h",
"bluetooth_adapter.h",
"bluetooth_classic.h",
"credential_storage_impl.h",
"socket_base.h",
"webrtc.h",
"wifi.h",
"wifi_direct.h",
"wifi_hotspot.h",
"wifi_lan.h",
],
visibility = ["//visibility:private"],
deps = [
":types",
"//internal/platform:base",
"//internal/platform:cancellation_flag",
"//internal/platform:logging",
"//internal/platform:mac_address",
"//internal/platform:test_util",
"//internal/platform:types",
"//internal/platform:uuid",
"//internal/platform/implementation:comm",
"//internal/platform/implementation:webrtc_platform",
"//internal/platform/implementation:wifi_utils",
"//internal/proto:credential_cc_proto",
"//third_party/webrtc/files/stable/webrtc/api:create_modular_peer_connection_factory",
"//third_party/webrtc/files/stable/webrtc/api:peer_connection_interface",
"//third_party/webrtc/files/stable/webrtc/api:scoped_refptr",
"//third_party/webrtc/files/stable/webrtc/rtc_base:checks",
"//third_party/webrtc/files/stable/webrtc/rtc_base:threading",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)
cc_test(
name = "comm_test",
srcs = [
"awdl_test.cc",
"ble_test.cc",
],
deps = [
":comm",
":g3",
"//internal/platform:base",
"//internal/platform:cancellation_flag",
"//internal/platform:mac_address",
"//internal/platform:test_util",
"//internal/platform:uuid",
"//internal/platform/implementation:comm",
"//third_party/gloop/thread/fiber",
"@com_github_protobuf_matchers//protobuf-matchers",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings:string_view",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "crypto",
testonly = True,
srcs = [
"crypto.cc",
],
visibility = ["//internal/platform/implementation:__subpackages__"],
deps = [
"//internal/platform:base",
"//internal/platform/implementation:types",
"@boringssl//:crypto",
"@com_google_absl//absl/strings",
],
alwayslink = 1,
)
cc_library(
name = "g3",
testonly = True,
srcs = [
"platform.cc",
"webrtc_platform.cc",
],
visibility = [
"//connections:__subpackages__",
"//connections:partners",
"//internal/auth:__subpackages__",
"//internal/crypto:__subpackages__",
"//internal/data:__subpackages__",
"//internal/network:__subpackages__",
"//internal/platform:__subpackages__",
"//internal/proto/analytics:__subpackages__",
"//internal/weave:__subpackages__",
"//location/nearby/sharing/sdk:__subpackages__",
"//sharing:__subpackages__",
"//third_party/nearby/presence:__subpackages__",
],
deps = [
":comm",
":crypto", # build_cleaner: keep
":types",
"//internal/base:file_path",
"//internal/base:files",
"//internal/platform:base",
"//internal/platform:logging",
"//internal/platform:test_util",
"//internal/platform/implementation:comm",
"//internal/platform/implementation:platform",
"//internal/platform/implementation:types",
"//internal/platform/implementation:webrtc_platform",
"//internal/platform/implementation/shared:count_down_latch",
"//internal/platform/implementation/shared:file",
"//third_party/gloop/thread",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:no_destructor",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
],
alwayslink = 1,
)
cc_library(
name = "preferences_repository",
srcs = ["preferences_repository.cc"],
hdrs = ["preferences_repository.h"],
deps = [
"//internal/base:file_path",
"//internal/base:files",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
"@nlohmann_json//:json",
],
)
cc_test(
name = "scheduled_executor_test",
srcs = ["scheduled_executor_test.cc"],
deps = [
":g3",
":types",
"//internal/platform:base",
"//internal/platform:test_util",
"//internal/platform:types",
"@com_github_protobuf_matchers//protobuf-matchers",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
],
)