blob: 3698a5759a2a1f4485c0e67f09c74d4629b0987f [file] [log] [blame]
Tej Singh9f028032019-11-21 12:47:37 -08001//
2// Copyright (C) 2019 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 register a pull atom callback with statsd
19// ==========================================================
Bob Badour21c8a122021-02-03 18:34:19 -080020package {
21 default_applicable_licenses: ["Android-Apache-2.0"],
22}
23
Tej Singhbb1b8432020-01-29 15:56:52 -080024cc_defaults {
25 name: "libstatspull_defaults",
Tej Singh9f028032019-11-21 12:47:37 -080026 srcs: [
Tej Singh9f028032019-11-21 12:47:37 -080027 "stats_pull_atom_callback.cpp",
28 ],
29 cflags: [
30 "-Wall",
31 "-Werror",
32 ],
33 export_include_dirs: ["include"],
34 shared_libs: [
Ruchir Rastogi17a06642020-01-24 18:21:36 -080035 "libbinder_ndk",
Jeffrey Huang2fc870d2020-02-12 14:22:01 -080036 "liblog",
Tej Singh9f028032019-11-21 12:47:37 -080037 ],
38 static_libs: [
Tej Singh9f028032019-11-21 12:47:37 -080039 "libutils",
Tej Singh79cc0c22020-04-06 15:01:41 -070040 "statsd-aidl-ndk_platform",
Tej Singhbb1b8432020-01-29 15:56:52 -080041 ],
Salud Lemus6c82f462020-07-22 19:53:44 +000042 target: {
43 android: {
44 shared_libs: ["libstatssocket"],
45 },
46 host: {
47 static_libs: ["libstatssocket"],
48 },
49 },
Tej Singhbb1b8432020-01-29 15:56:52 -080050}
Salud Lemus6c82f462020-07-22 19:53:44 +000051cc_library {
Tej Singhbb1b8432020-01-29 15:56:52 -080052 name: "libstatspull",
53 defaults: [
Salud Lemus6c82f462020-07-22 19:53:44 +000054 "libstatspull_defaults",
55 "libbinder_ndk_host_user",
Tej Singh4f3ef0a2020-01-14 13:46:27 -080056 ],
Salud Lemus6c82f462020-07-22 19:53:44 +000057 host_supported: true,
58 target: {
59 android: {
60 static: {
61 enabled: false,
62 },
63 },
64 host: {
65 shared: {
66 enabled: false,
67 },
68 },
69 },
Tej Singh4f3ef0a2020-01-14 13:46:27 -080070 // enumerate stable entry points for APEX use
71 stubs: {
72 symbol_file: "libstatspull.map.txt",
73 versions: [
74 "30",
75 ],
76 },
Jeffrey Huang2fc870d2020-02-12 14:22:01 -080077 apex_available: [
78 "com.android.os.statsd",
79 "test_com.android.os.statsd",
80 ],
Jooyung Hanbe20da02021-02-16 17:31:47 +090081 min_sdk_version: "30",
Tej Singh79cc0c22020-04-06 15:01:41 -070082
83 stl: "libc++_static",
84
Hsin-Yi Chen7a8a9362020-03-23 11:26:38 +080085 // TODO(b/151102177): Enable it when the build error is fixed.
86 header_abi_checker: {
87 enabled: false,
88 },
Tej Singh9f028032019-11-21 12:47:37 -080089}
Tej Singhbb1b8432020-01-29 15:56:52 -080090
Tej Singh14be4722021-03-10 22:01:52 -080091cc_library_headers {
92 name: "libstatspull_headers",
93 export_include_dirs: ["include"],
94}
95
Tej Singhbb1b8432020-01-29 15:56:52 -080096// ONLY USE IN TESTS.
97cc_library_static {
98 name: "libstatspull_private",
99 defaults: [
100 "libstatspull_defaults",
101 ],
Salud Lemus22d48d62020-07-28 18:09:32 +0000102 cflags: [
103 "-DLIB_STATS_PULL_TESTS_FLAG",
104 ],
Tej Singhbb1b8432020-01-29 15:56:52 -0800105 visibility: [
Baligh Uddindd9eda62020-12-04 04:03:15 +0000106 "//packages/modules/StatsD/apex/tests/libstatspull",
Tej Singhbb1b8432020-01-29 15:56:52 -0800107 ],
108}
Tej Singha2e008e2020-03-13 19:14:05 -0700109
110// Note: These unit tests only test PullAtomMetadata.
111// For full E2E tests of libstatspull, use LibStatsPullTests
112cc_test {
113 name: "libstatspull_test",
114 srcs: [
115 "tests/pull_atom_metadata_test.cpp",
116 ],
117 shared_libs: [
118 "libstatspull",
119 "libstatssocket",
120 ],
Kimberly Kreider74df6282020-12-15 16:16:48 -0800121 test_suites: ["general-tests", "mts-statsd"],
Chen Zhu611401c2020-05-20 13:06:24 -0700122 test_config: "libstatspull_test.xml",
123
Jeffrey Huang9d968752020-04-22 17:09:30 -0700124 //TODO(b/153588990): Remove when the build system properly separates
125 //32bit and 64bit architectures.
126 compile_multilib: "both",
127 multilib: {
128 lib64: {
129 suffix: "64",
Chen Zhu611401c2020-05-20 13:06:24 -0700130 },
131 lib32: {
132 suffix: "32",
133 },
Jeffrey Huang9d968752020-04-22 17:09:30 -0700134 },
Tej Singha2e008e2020-03-13 19:14:05 -0700135 cflags: [
136 "-Wall",
137 "-Werror",
138 "-Wno-missing-field-initializers",
139 "-Wno-unused-variable",
140 "-Wno-unused-function",
141 "-Wno-unused-parameter",
142 ],
Jeffrey Huang6efcb092020-04-24 10:43:08 -0700143 require_root: true,
Hsin-Yi Chen7a8a9362020-03-23 11:26:38 +0800144}