| Muhammad Qureshi | a3dcefc | 2019-12-02 20:27:46 -0800 | [diff] [blame] | 1 | // | 
 | 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 | // ========================================================================= | 
 | 20 | cc_library { | 
 | 21 |     name: "libstatssocket", | 
 | 22 |     srcs: [ | 
| Muhammad Qureshi | 962cc23 | 2019-11-06 15:15:23 -0800 | [diff] [blame] | 23 |         "stats_buffer_writer.c", | 
| Muhammad Qureshi | a3dcefc | 2019-12-02 20:27:46 -0800 | [diff] [blame] | 24 |         "stats_event.c", | 
| Muhammad Qureshi | 962cc23 | 2019-11-06 15:15:23 -0800 | [diff] [blame] | 25 |         // TODO(b/145573568): Remove stats_event_list once stats_event | 
 | 26 |         // migration is complete. | 
| Muhammad Qureshi | a3dcefc | 2019-12-02 20:27:46 -0800 | [diff] [blame] | 27 |         "stats_event_list.c", | 
 | 28 |         "statsd_writer.c", | 
 | 29 |     ], | 
 | 30 |     host_supported: true, | 
 | 31 |     cflags: [ | 
 | 32 |         "-Wall", | 
 | 33 |         "-Werror", | 
 | 34 |         "-DLIBLOG_LOG_TAG=1006", | 
 | 35 |         "-DWRITE_TO_STATSD=1", | 
 | 36 |         "-DWRITE_TO_LOGD=0", | 
 | 37 |     ], | 
 | 38 |     export_include_dirs: ["include"], | 
 | 39 |     shared_libs: [ | 
 | 40 |         "libcutils", | 
 | 41 |         "liblog", | 
 | 42 |     ], | 
| Ruchir Rastogi | 5dbcae5 | 2019-12-19 15:44:58 -0800 | [diff] [blame] | 43 |  | 
 | 44 |     // enumerate stable entry points for APEX use | 
 | 45 |     stubs: { | 
 | 46 |         symbol_file: "libstatssocket.map.txt", | 
 | 47 |         versions: [ | 
 | 48 |             "1", | 
 | 49 |         ], | 
 | 50 |     } | 
| Muhammad Qureshi | a3dcefc | 2019-12-02 20:27:46 -0800 | [diff] [blame] | 51 | } | 
| Ruchir Rastogi | 926fa88 | 2019-12-10 18:46:23 -0800 | [diff] [blame] | 52 |  | 
 | 53 | cc_library_headers { | 
 | 54 |     name: "libstatssocket_headers", | 
 | 55 |     export_include_dirs: ["include"], | 
 | 56 |     host_supported: true, | 
 | 57 | } | 
| Ruchir Rastogi | 79dd3ea | 2019-12-12 17:16:59 -0800 | [diff] [blame] | 58 |  | 
 | 59 | cc_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", | 
 | 74 |         "liblog", | 
 | 75 |         "libgtest_prod", | 
 | 76 |     ], | 
 | 77 | } | 
| Ruchir Rastogi | c6e6c44 | 2020-01-07 09:36:04 -0800 | [diff] [blame] | 78 |  | 
 | 79 | cc_test { | 
 | 80 |     name: "libstatssocket_test", | 
 | 81 |     srcs: ["tests/stats_event_test.cpp"], | 
 | 82 |     cflags: [ | 
 | 83 |         "-Wall", | 
 | 84 |         "-Werror", | 
 | 85 |     ], | 
 | 86 |     static_libs: [ | 
 | 87 |         "libgmock", | 
 | 88 |         "libstatssocket", | 
 | 89 |     ], | 
 | 90 |     shared_libs: [ | 
 | 91 |         "libcutils", | 
 | 92 |         "liblog", | 
 | 93 |         "libutils", | 
 | 94 |     ], | 
 | 95 |     test_suites: ["device_tests"], | 
 | 96 | } |