Tej Singh | 9f02803 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 1 | // |
| 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 Badour | 21c8a12 | 2021-02-03 18:34:19 -0800 | [diff] [blame] | 20 | package { |
| 21 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 22 | } |
| 23 | |
Tej Singh | bb1b843 | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 24 | cc_defaults { |
| 25 | name: "libstatspull_defaults", |
Tej Singh | 9f02803 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 26 | srcs: [ |
Tej Singh | 9f02803 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 27 | "stats_pull_atom_callback.cpp", |
| 28 | ], |
| 29 | cflags: [ |
| 30 | "-Wall", |
| 31 | "-Werror", |
| 32 | ], |
| 33 | export_include_dirs: ["include"], |
| 34 | shared_libs: [ |
Ruchir Rastogi | 17a0664 | 2020-01-24 18:21:36 -0800 | [diff] [blame] | 35 | "libbinder_ndk", |
Jeffrey Huang | 2fc870d | 2020-02-12 14:22:01 -0800 | [diff] [blame] | 36 | "liblog", |
Tej Singh | 9f02803 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 37 | ], |
| 38 | static_libs: [ |
Tej Singh | 9f02803 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 39 | "libutils", |
Tej Singh | 79cc0c2 | 2020-04-06 15:01:41 -0700 | [diff] [blame] | 40 | "statsd-aidl-ndk_platform", |
Tej Singh | bb1b843 | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 41 | ], |
Salud Lemus | 6c82f46 | 2020-07-22 19:53:44 +0000 | [diff] [blame] | 42 | target: { |
| 43 | android: { |
| 44 | shared_libs: ["libstatssocket"], |
| 45 | }, |
| 46 | host: { |
| 47 | static_libs: ["libstatssocket"], |
| 48 | }, |
| 49 | }, |
Tej Singh | bb1b843 | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 50 | } |
Salud Lemus | 6c82f46 | 2020-07-22 19:53:44 +0000 | [diff] [blame] | 51 | cc_library { |
Tej Singh | bb1b843 | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 52 | name: "libstatspull", |
| 53 | defaults: [ |
Salud Lemus | 6c82f46 | 2020-07-22 19:53:44 +0000 | [diff] [blame] | 54 | "libstatspull_defaults", |
| 55 | "libbinder_ndk_host_user", |
Tej Singh | 4f3ef0a | 2020-01-14 13:46:27 -0800 | [diff] [blame] | 56 | ], |
Salud Lemus | 6c82f46 | 2020-07-22 19:53:44 +0000 | [diff] [blame] | 57 | 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 Singh | 4f3ef0a | 2020-01-14 13:46:27 -0800 | [diff] [blame] | 70 | // enumerate stable entry points for APEX use |
| 71 | stubs: { |
| 72 | symbol_file: "libstatspull.map.txt", |
| 73 | versions: [ |
| 74 | "30", |
| 75 | ], |
| 76 | }, |
Jeffrey Huang | 2fc870d | 2020-02-12 14:22:01 -0800 | [diff] [blame] | 77 | apex_available: [ |
| 78 | "com.android.os.statsd", |
| 79 | "test_com.android.os.statsd", |
| 80 | ], |
Jooyung Han | be20da0 | 2021-02-16 17:31:47 +0900 | [diff] [blame] | 81 | min_sdk_version: "30", |
Tej Singh | 79cc0c2 | 2020-04-06 15:01:41 -0700 | [diff] [blame] | 82 | |
| 83 | stl: "libc++_static", |
| 84 | |
Hsin-Yi Chen | 7a8a936 | 2020-03-23 11:26:38 +0800 | [diff] [blame] | 85 | // TODO(b/151102177): Enable it when the build error is fixed. |
| 86 | header_abi_checker: { |
| 87 | enabled: false, |
| 88 | }, |
Tej Singh | 9f02803 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 89 | } |
Tej Singh | bb1b843 | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 90 | |
Tej Singh | 14be472 | 2021-03-10 22:01:52 -0800 | [diff] [blame] | 91 | cc_library_headers { |
| 92 | name: "libstatspull_headers", |
| 93 | export_include_dirs: ["include"], |
| 94 | } |
| 95 | |
Tej Singh | bb1b843 | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 96 | // ONLY USE IN TESTS. |
| 97 | cc_library_static { |
| 98 | name: "libstatspull_private", |
| 99 | defaults: [ |
| 100 | "libstatspull_defaults", |
| 101 | ], |
Salud Lemus | 22d48d6 | 2020-07-28 18:09:32 +0000 | [diff] [blame] | 102 | cflags: [ |
| 103 | "-DLIB_STATS_PULL_TESTS_FLAG", |
| 104 | ], |
Tej Singh | bb1b843 | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 105 | visibility: [ |
Baligh Uddin | dd9eda6 | 2020-12-04 04:03:15 +0000 | [diff] [blame] | 106 | "//packages/modules/StatsD/apex/tests/libstatspull", |
Tej Singh | bb1b843 | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 107 | ], |
| 108 | } |
Tej Singh | a2e008e | 2020-03-13 19:14:05 -0700 | [diff] [blame] | 109 | |
| 110 | // Note: These unit tests only test PullAtomMetadata. |
| 111 | // For full E2E tests of libstatspull, use LibStatsPullTests |
| 112 | cc_test { |
| 113 | name: "libstatspull_test", |
| 114 | srcs: [ |
| 115 | "tests/pull_atom_metadata_test.cpp", |
| 116 | ], |
| 117 | shared_libs: [ |
| 118 | "libstatspull", |
| 119 | "libstatssocket", |
| 120 | ], |
Kimberly Kreider | 74df628 | 2020-12-15 16:16:48 -0800 | [diff] [blame] | 121 | test_suites: ["general-tests", "mts-statsd"], |
Chen Zhu | 611401c | 2020-05-20 13:06:24 -0700 | [diff] [blame] | 122 | test_config: "libstatspull_test.xml", |
| 123 | |
Jeffrey Huang | 9d96875 | 2020-04-22 17:09:30 -0700 | [diff] [blame] | 124 | //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 Zhu | 611401c | 2020-05-20 13:06:24 -0700 | [diff] [blame] | 130 | }, |
| 131 | lib32: { |
| 132 | suffix: "32", |
| 133 | }, |
Jeffrey Huang | 9d96875 | 2020-04-22 17:09:30 -0700 | [diff] [blame] | 134 | }, |
Tej Singh | a2e008e | 2020-03-13 19:14:05 -0700 | [diff] [blame] | 135 | cflags: [ |
| 136 | "-Wall", |
| 137 | "-Werror", |
| 138 | "-Wno-missing-field-initializers", |
| 139 | "-Wno-unused-variable", |
| 140 | "-Wno-unused-function", |
| 141 | "-Wno-unused-parameter", |
| 142 | ], |
Jeffrey Huang | 6efcb09 | 2020-04-24 10:43:08 -0700 | [diff] [blame] | 143 | require_root: true, |
Hsin-Yi Chen | 7a8a936 | 2020-03-23 11:26:38 +0800 | [diff] [blame] | 144 | } |