blob: f8b38ad0ba6965ed52c53f2a668f6750e881f972 [file] [log] [blame]
Muhammad Qureshia3dcefc2019-12-02 20:27:46 -08001//
2// Copyright (C) 2018 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17// =========================================================================
18// Native library to write stats log to statsd socket on Android R and later
19// =========================================================================
20cc_library {
21 name: "libstatssocket",
22 srcs: [
Muhammad Qureshi962cc232019-11-06 15:15:23 -080023 "stats_buffer_writer.c",
Muhammad Qureshia3dcefc2019-12-02 20:27:46 -080024 "stats_event.c",
Muhammad Qureshi2ebc2e32020-02-11 14:12:59 -080025 "stats_socket.c",
Muhammad Qureshia3dcefc2019-12-02 20:27:46 -080026 "statsd_writer.c",
27 ],
28 host_supported: true,
29 cflags: [
30 "-Wall",
31 "-Werror",
Muhammad Qureshia3dcefc2019-12-02 20:27:46 -080032 ],
33 export_include_dirs: ["include"],
Ruchir Rastogie1cff242020-02-14 12:03:35 -080034 static_libs: [
35 "libcutils", // does not expose a stable C API
Muhammad Qureshia3dcefc2019-12-02 20:27:46 -080036 ],
Ruchir Rastogi5dbcae52019-12-19 15:44:58 -080037
38 // enumerate stable entry points for APEX use
39 stubs: {
40 symbol_file: "libstatssocket.map.txt",
41 versions: [
Tej Singha8fd39d2020-01-14 13:46:27 -080042 "30",
Ruchir Rastogi5dbcae52019-12-19 15:44:58 -080043 ],
Jeffrey Huangb0a85dc2020-02-12 14:22:01 -080044 },
45 apex_available: [
46 "com.android.os.statsd",
47 "test_com.android.os.statsd",
48 //TODO(b/149340100): Remove this once libstatssocket is only linked as shared.
49 "//apex_available:platform",
50 ],
Muhammad Qureshia3dcefc2019-12-02 20:27:46 -080051}
Ruchir Rastogi926fa882019-12-10 18:46:23 -080052
53cc_library_headers {
54 name: "libstatssocket_headers",
55 export_include_dirs: ["include"],
56 host_supported: true,
57}
Ruchir Rastogi79dd3ea2019-12-12 17:16:59 -080058
59cc_benchmark {
60 name: "libstatssocket_benchmark",
61 srcs: [
62 "benchmark/main.cpp",
63 "benchmark/stats_event_benchmark.cpp",
64 ],
65 cflags: [
66 "-Wall",
67 "-Werror",
68 ],
69 static_libs: [
70 "libstatssocket",
71 ],
72 shared_libs: [
73 "libcutils",
Ruchir Rastogi79dd3ea2019-12-12 17:16:59 -080074 "libgtest_prod",
75 ],
76}
Ruchir Rastogi21c1f9c2020-01-07 09:36:04 -080077
78cc_test {
79 name: "libstatssocket_test",
80 srcs: ["tests/stats_event_test.cpp"],
81 cflags: [
82 "-Wall",
83 "-Werror",
84 ],
85 static_libs: [
86 "libgmock",
87 "libstatssocket",
88 ],
89 shared_libs: [
90 "libcutils",
Ruchir Rastogi21c1f9c2020-01-07 09:36:04 -080091 "libutils",
92 ],
Tej Singh0fca7362020-02-04 14:13:20 -080093 test_suites: ["device-tests"],
Ruchir Rastogi21c1f9c2020-01-07 09:36:04 -080094}