Files
nearby/cpp/platform/base/BUILD
T
suetfei 287f0d7174 Internal Flow change for BUILD.
PiperOrigin-RevId: 424991730
2022-02-02 11:51:37 -08:00

238 lines
6.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("//ads/util/non_compile:non_compile.bzl", "cc_with_non_compile_test")
licenses(["notice"])
cc_library(
name = "base",
srcs = [
"base64_utils.cc",
"bluetooth_utils.cc",
"input_stream.cc",
"nsd_service_info.cc",
"prng.cc",
],
hdrs = [
"base64_utils.h",
"bluetooth_utils.h",
"byte_array.h",
"callable.h",
"exception.h",
"feature_flags.h",
"input_stream.h",
"listeners.h",
"nsd_service_info.h",
"output_stream.h",
"payload_id.h",
"prng.h",
"runnable.h",
"socket.h",
"types.h",
],
copts = ["-DCORE_ADAPTER_DLL"],
visibility = [
"//cpp/core:__subpackages__",
"//cpp/platform:__subpackages__",
"//cpp/platform/api:__subpackages__",
"//internal/analytics:__subpackages__",
"//internal/proto/analytics:__subpackages__",
"//third_party/nearby/cpp/cal:__subpackages__",
],
deps = [
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/meta:type_traits",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "util",
srcs = [
"base_input_stream.cc",
"base_pipe.cc",
"byte_utils.cc",
],
hdrs = [
"base_input_stream.h",
"base_mutex_lock.h",
"base_pipe.h",
"byte_utils.h",
],
visibility = [
"//cpp/core:__subpackages__",
"//cpp/platform/impl:__subpackages__",
"//cpp/platform/public:__pkg__",
],
deps = [
":base",
"//cpp/platform/api:types",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/strings:str_format",
],
)
cc_library(
name = "logging",
hdrs = [
"logging.h",
],
visibility = [
"//cpp/platform:__subpackages__",
"//googlemac/iPhone/Shared/Nearby/Connections:__subpackages__",
],
deps = [
"@com_google_glog//:glog",
"//cpp/platform/api:platform",
"//cpp/platform/api:types",
],
)
cc_library(
name = "cancellation_flag",
srcs = [
"cancellation_flag.cc",
],
hdrs = [
"cancellation_flag.h",
"cancellation_flag_listener.h",
],
visibility = [
"//cpp/core/internal:__subpackages__",
"//cpp/platform/api:__subpackages__",
"//cpp/platform/impl:__subpackages__",
"//cpp/platform/public:__pkg__",
],
deps = [
":base",
":util",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/synchronization",
],
)
cc_library(
name = "error_code_recorder",
srcs = [
"error_code_recorder.cc",
],
hdrs = [
"error_code_params.h",
"error_code_recorder.h",
],
visibility = [
"//cpp/core/internal:__subpackages__",
"//cpp/platform/impl:__subpackages__",
"//internal/analytics:__subpackages__",
],
deps = [
":logging",
"//proto:connections_enums_portable_proto",
"//proto/errorcode:error_code_enums_portable_proto",
],
)
cc_library(
name = "test_util",
testonly = True,
srcs = [
"medium_environment.cc",
],
hdrs = [
"medium_environment.h",
],
visibility = [
"//cpp/core:__subpackages__",
"//cpp/platform/impl:__subpackages__",
"//cpp/platform/public:__pkg__",
],
deps = [
":base",
":logging",
"//cpp/platform/api:comm",
"//cpp/platform/public:types",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/strings",
],
)
cc_test(
name = "platform_base_test",
srcs = [
"bluetooth_utils_test.cc",
"byte_array_test.cc",
"feature_flags_test.cc",
"prng_test.cc",
],
deps = [
":base",
":test_util",
"//cpp/platform/impl/g3", # build_cleaner: keep
"@com_google_googletest//:gtest_main","@com_github_protobuf_matchers//protobuf-matchers:protobuf-matchers",
],
)
cc_test(
name = "platform_util_test",
srcs = [
"byte_utils_test.cc",
],
deps = [
":base",
":util",
"@com_google_googletest//:gtest_main","@com_github_protobuf_matchers//protobuf-matchers:protobuf-matchers",
],
)
cc_test(
name = "cancellation_flag_test",
srcs = [
"cancellation_flag_test.cc",
],
deps = [
":base",
":cancellation_flag",
":test_util",
"//cpp/platform/impl/g3", # build_cleaner: keep
"@com_google_googletest//:gtest_main","@com_github_protobuf_matchers//protobuf-matchers:protobuf-matchers",
],
)
cc_test(
name = "error_code_recorder_test",
srcs = [
"error_code_recorder_test.cc",
],
deps = [
":error_code_recorder",
":test_util",
"//cpp/platform/impl/g3", # build_cleaner: keep
"@com_google_googletest//:gtest_main","@com_github_protobuf_matchers//protobuf-matchers:protobuf-matchers",
],
)
cc_with_non_compile_test(
name = "exception_test",
srcs = [
"exception_test.cc",
],
deps = [
":base",
"@com_google_googletest//:gtest_main","@com_github_protobuf_matchers//protobuf-matchers:protobuf-matchers",
],
)