xref: /aosp_15_r20/system/core/libstats/expresslog/Android.bp (revision 00c7fec1bb09f3284aad6a6f96d2f63dfc3650ad)
1//
2// Copyright (C) 2023 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//
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18    default_team: "trendy_team_android_telemetry_client_infra",
19}
20
21cc_defaults {
22    name: "expresslog_defaults",
23    srcs: [
24        "Counter.cpp",
25        "Histogram.cpp",
26    ],
27}
28
29cc_library {
30    name: "libexpresslog",
31    host_supported: true,
32    defaults: ["expresslog_defaults"],
33    cflags: [
34        "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash",
35        "-Wall",
36        "-Werror",
37    ],
38    header_libs: [
39        "libtextclassifier_hash_headers",
40    ],
41    static_libs: [
42        "libstatslog_express",
43        "libtextclassifier_hash_static",
44    ],
45    shared_libs: [
46        "libbase",
47        "liblog",
48        "libstatssocket",
49    ],
50    export_include_dirs: ["include"],
51    min_sdk_version: "33",
52    apex_available: [
53        "//apex_available:platform",
54        "com.android.btservices",
55    ],
56}
57
58genrule {
59    name: "statslog_express.h",
60    tools: ["stats-log-api-gen"],
61    cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_express.h --module expresslog --namespace android,expresslog",
62    out: [
63        "statslog_express.h",
64    ],
65}
66
67genrule {
68    name: "statslog_express.cpp",
69    tools: ["stats-log-api-gen"],
70    cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_express.cpp --module expresslog --namespace android,expresslog --importHeader statslog_express.h",
71    out: [
72        "statslog_express.cpp",
73    ],
74}
75
76cc_library_static {
77    name: "libstatslog_express",
78    host_supported: true,
79    generated_sources: ["statslog_express.cpp"],
80    generated_headers: ["statslog_express.h"],
81    export_generated_headers: ["statslog_express.h"],
82    shared_libs: [
83        "libstatssocket",
84    ],
85    min_sdk_version: "33",
86    apex_available: [
87        "//apex_available:platform",
88        "com.android.btservices",
89    ],
90}
91
92cc_test {
93    name: "expresslog_test",
94    defaults: ["expresslog_defaults"],
95    test_suites: [
96        "general-tests",
97    ],
98    srcs: [
99        "tests/Histogram_test.cpp",
100    ],
101    local_include_dirs: [
102        "include",
103    ],
104    cflags: [
105        "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash",
106        "-Wall",
107        "-Wextra",
108        "-Wunused",
109        "-Wpedantic",
110        "-Werror",
111    ],
112    header_libs: [
113        "libtextclassifier_hash_headers",
114    ],
115    static_libs: [
116        "libgmock",
117        "libbase",
118        "liblog",
119        "libstatslog_express",
120        "libtextclassifier_hash_static",
121    ],
122    shared_libs: [
123        "libstatssocket",
124    ],
125}
126