blob: 33e211ca8c370bd9a1d346d692b186de2271b2a4 [file] [log] [blame]
Tri Vofc871402017-07-10 17:13:23 -07001// Copyright (C) 2017 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Bob Badourc22b35b2021-02-23 14:26:20 -080015package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "hardware_interfaces_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["hardware_interfaces_license"],
22}
23
Tri Vofc871402017-07-10 17:13:23 -070024cc_defaults {
25 name: "vhal_v2_0_defaults",
26 shared_libs: [
27 "libhidlbase",
Tri Vofc871402017-07-10 17:13:23 -070028 "liblog",
29 "libutils",
30 "android.hardware.automotive.vehicle@2.0",
31 ],
32 cflags: [
33 "-Wall",
34 "-Wextra",
35 "-Werror",
36 ],
37}
38
Hao Chenc324db92020-06-03 18:29:31 -070039cc_defaults {
40 name: "vhal_v2_0_target_defaults",
41 defaults: ["vhal_v2_0_defaults"],
42 shared_libs: [
43 "libbinder_ndk",
Jiyong Parkc426c6d2021-08-04 12:48:07 +090044 "android.automotive.watchdog-V2-ndk",
Hao Chenc324db92020-06-03 18:29:31 -070045 ],
46}
47
Tri Vofc871402017-07-10 17:13:23 -070048cc_library_headers {
49 name: "vhal_v2_0_common_headers",
Yu Shan6029a372021-06-22 19:11:05 -070050 visibility: ["//visibility:public"],
Tri Vo22b2d682017-07-11 12:53:12 -070051 vendor: true,
Tri Vofc871402017-07-10 17:13:23 -070052 export_include_dirs: ["common/include/vhal_v2_0"],
53}
54
55// Vehicle reference implementation lib
Anthony Maha9d8c0d2017-10-03 16:22:22 -070056cc_library {
Tri Vofc871402017-07-10 17:13:23 -070057 name: "android.hardware.automotive.vehicle@2.0-manager-lib",
Tri Vo22b2d682017-07-11 12:53:12 -070058 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -070059 defaults: ["vhal_v2_0_target_defaults"],
Tri Vofc871402017-07-10 17:13:23 -070060 srcs: [
Pavel Maltsev250139c2017-08-24 15:09:41 -070061 "common/src/Obd2SensorStore.cpp",
Yu Shan6029a372021-06-22 19:11:05 -070062 "common/src/ProtoMessageConverter.cpp",
Tri Vofc871402017-07-10 17:13:23 -070063 "common/src/SubscriptionManager.cpp",
64 "common/src/VehicleHalManager.cpp",
65 "common/src/VehicleObjectPool.cpp",
66 "common/src/VehiclePropertyStore.cpp",
67 "common/src/VehicleUtils.cpp",
Aditi Nagaraj8dcab8e2018-01-10 17:10:01 -080068 "common/src/VmsUtils.cpp",
Eric Jeong908101a2020-04-23 09:43:55 -070069 "common/src/WatchdogClient.cpp",
Tri Vofc871402017-07-10 17:13:23 -070070 ],
Felipe Leme75a27f82020-01-31 15:25:55 -080071 shared_libs: [
72 "libbase",
Yu Shan6029a372021-06-22 19:11:05 -070073 "libprotobuf-cpp-lite",
Felipe Leme75a27f82020-01-31 15:25:55 -080074 ],
Tri Vofc871402017-07-10 17:13:23 -070075 local_include_dirs: ["common/include/vhal_v2_0"],
76 export_include_dirs: ["common/include"],
Yu Shan6029a372021-06-22 19:11:05 -070077 static_libs: [
78 "android.hardware.automotive.vehicle@2.0-libproto-native",
79 ],
Tri Vofc871402017-07-10 17:13:23 -070080}
81
Tri Vofc871402017-07-10 17:13:23 -070082// Vehicle default VehicleHAL implementation
83cc_library_static {
84 name: "android.hardware.automotive.vehicle@2.0-default-impl-lib",
Tri Vo22b2d682017-07-11 12:53:12 -070085 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -070086 defaults: ["vhal_v2_0_target_defaults"],
Yu Shan2842eb52022-08-31 18:08:10 -070087 cflags: [
88 "-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING",
89 "-DENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS",
90 ],
Tri Vofc871402017-07-10 17:13:23 -070091 srcs: [
Yu Shan6029a372021-06-22 19:11:05 -070092 "impl/vhal_v2_0/DefaultVehicleHal.cpp",
Hao Chena6d6fa32020-02-14 11:51:26 -080093 "impl/vhal_v2_0/VehicleHalClient.cpp",
Yu Shan6029a372021-06-22 19:11:05 -070094 "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
Chao Yanf63c2ca2018-04-17 11:32:39 -070095 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
96 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
Chao Yan0f85dd12018-06-04 14:03:02 -070097 "impl/vhal_v2_0/GeneratorHub.cpp",
Yu Shan122eea62021-07-20 18:22:23 -070098 "impl/vhal_v2_0/FakeObd2Frame.cpp",
Tri Vofc871402017-07-10 17:13:23 -070099 ],
100 local_include_dirs: ["common/include/vhal_v2_0"],
101 export_include_dirs: ["impl"],
felipeal9c998c02020-04-17 14:32:53 -0700102 whole_static_libs: [
Yu Shan58f71e72021-08-03 16:49:40 -0700103 "android.hardware.automotive.vehicle@2.0-fake-user-hal-lib",
felipeal9c998c02020-04-17 14:32:53 -0700104 "android.hardware.automotive.vehicle@2.0-manager-lib",
105 ],
Tri Vofc871402017-07-10 17:13:23 -0700106 shared_libs: [
107 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900108 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700109 "libprotobuf-cpp-lite",
110 ],
111 static_libs: [
Tri Vofc871402017-07-10 17:13:23 -0700112 "android.hardware.automotive.vehicle@2.0-libproto-native",
113 ],
114}
115
Hao Chenc324db92020-06-03 18:29:31 -0700116// Vehicle HAL Server reference impl lib
117cc_library_static {
118 name: "android.hardware.automotive.vehicle@2.0-server-common-lib",
119 vendor: true,
120 host_supported: true,
121 defaults: ["vhal_v2_0_defaults"],
122 local_include_dirs: ["common/include/vhal_v2_0"],
123 export_include_dirs: ["common/include"],
124 srcs: [
125 "common/src/Obd2SensorStore.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700126 "common/src/ProtoMessageConverter.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700127 "common/src/VehicleObjectPool.cpp",
Hao Chen0b7c2872021-05-12 12:21:33 -0700128 "common/src/VehiclePropertyStore.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700129 "common/src/VehicleUtils.cpp",
130 ],
Yu Shan6029a372021-06-22 19:11:05 -0700131 static_libs: [
132 "android.hardware.automotive.vehicle@2.0-libproto-native",
133 ],
Hao Chenc324db92020-06-03 18:29:31 -0700134}
135
136// Vehicle HAL Server default implementation
137cc_library_static {
138 name: "android.hardware.automotive.vehicle@2.0-server-impl-lib",
139 vendor: true,
140 host_supported: true,
141 defaults: ["vhal_v2_0_defaults"],
142 local_include_dirs: ["common/include/vhal_v2_0"],
143 export_include_dirs: ["impl"],
144 srcs: [
Hao Chenc324db92020-06-03 18:29:31 -0700145 "impl/vhal_v2_0/GeneratorHub.cpp",
146 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
147 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700148 "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
Yu Shan122eea62021-07-20 18:22:23 -0700149 "impl/vhal_v2_0/FakeObd2Frame.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700150 ],
151 whole_static_libs: [
152 "android.hardware.automotive.vehicle@2.0-server-common-lib",
153 ],
154 static_libs: [
155 "android.hardware.automotive.vehicle@2.0-libproto-native",
156 ],
157 shared_libs: [
158 "libbase",
159 "libjsoncpp",
160 ],
161}
162
Tri Vofc871402017-07-10 17:13:23 -0700163cc_test {
164 name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests",
Tri Vo22b2d682017-07-11 12:53:12 -0700165 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700166 defaults: ["vhal_v2_0_target_defaults"],
Tri Vofc871402017-07-10 17:13:23 -0700167 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
Chih-Hung Hsiehad1bf312022-02-17 21:56:13 -0800168 tidy_timeout_srcs: [
169 "tests/VmsUtils_test.cpp",
170 ],
Tri Vofc871402017-07-10 17:13:23 -0700171 srcs: [
172 "tests/RecurrentTimer_test.cpp",
173 "tests/SubscriptionManager_test.cpp",
174 "tests/VehicleHalManager_test.cpp",
175 "tests/VehicleObjectPool_test.cpp",
176 "tests/VehiclePropConfigIndex_test.cpp",
Aditi Nagaraj8dcab8e2018-01-10 17:10:01 -0800177 "tests/VmsUtils_test.cpp",
Tri Vofc871402017-07-10 17:13:23 -0700178 ],
Felipe Leme75a27f82020-01-31 15:25:55 -0800179 shared_libs: [
180 "libbase",
Yu Shan8ae3ea92021-06-01 15:44:43 -0700181 "libcutils",
Felipe Leme75a27f82020-01-31 15:25:55 -0800182 ],
Yu Shan39844572021-06-23 20:42:24 -0700183 // Exclude share libraries from default because they might be missing on
184 // some test platforms and we are using static libraries instead.
Yu Shan045138d2021-06-02 16:15:29 -0700185 exclude_shared_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900186 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700187 "android.hardware.automotive.vehicle@2.0",
188 ],
189 static_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900190 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700191 "android.hardware.automotive.vehicle@2.0",
192 ],
Tri Vofc871402017-07-10 17:13:23 -0700193 header_libs: ["libbase_headers"],
Keun Soo YIMff84c372018-11-27 14:04:42 -0800194 test_suites: ["general-tests"],
Tri Vofc871402017-07-10 17:13:23 -0700195}
196
Hao Chen1c1fdca2019-11-15 14:20:34 -0800197cc_test {
198 name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests",
199 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700200 defaults: ["vhal_v2_0_target_defaults"],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800201 srcs: [
202 "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp",
Yu Shan39844572021-06-23 20:42:24 -0700203 "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800204 ],
205 static_libs: [
Yu Shan39844572021-06-23 20:42:24 -0700206 "libbase",
207 "libcutils",
Yu Shan795f4de2021-07-01 15:41:19 -0700208 "libgmock",
Yu Shan39844572021-06-23 20:42:24 -0700209 "libjsoncpp",
210 "libprotobuf-cpp-lite",
211 ],
212 // Exclude share libraries from default because they might be missing on
213 // some test platforms and we are using static libraries instead.
214 exclude_shared_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900215 "android.automotive.watchdog-V2-ndk",
Yu Shan39844572021-06-23 20:42:24 -0700216 "android.hardware.automotive.vehicle@2.0",
217 ],
218 whole_static_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900219 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700220 "android.hardware.automotive.vehicle@2.0",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800221 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
222 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan045138d2021-06-02 16:15:29 -0700223 ],
Yu Shan4a239012021-07-20 18:12:53 -0700224 data: [
Yu Shan4a239012021-07-20 18:12:53 -0700225 ":vhal_test_json",
Yu Shan56020bc2021-07-16 15:51:16 -0700226 ":vhal_test_override_json",
Yu Shan4a239012021-07-20 18:12:53 -0700227 ],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800228 test_suites: ["general-tests"],
229}
230
Yu Shan2842eb52022-08-31 18:08:10 -0700231cc_test {
232 name: "android.hardware.automotive.vehicle@2.0-default-config-test",
233 vendor: true,
234 defaults: ["vhal_v2_0_target_defaults"],
235 srcs: [
236 "impl/vhal_v2_0/tests/DefaultConfigSupportedPropertyIds_test.cpp",
237 ],
238 cflags: [
239 "-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING",
240 "-DENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS",
241 ],
242 static_libs: [
243 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
244 "libgtest",
245 "libgmock",
246 ],
247 test_suites: ["general-tests"],
248}
249
Tri Vofc871402017-07-10 17:13:23 -0700250cc_binary {
Yu Shan612dbf62021-07-02 18:11:08 -0700251 name: "android.hardware.automotive.vehicle@2.0-default-service",
Hao Chenc324db92020-06-03 18:29:31 -0700252 defaults: ["vhal_v2_0_target_defaults"],
Calvin Huanga6536162020-04-20 12:41:20 -0700253 vintf_fragments: [
Yu Shan612dbf62021-07-02 18:11:08 -0700254 "android.hardware.automotive.vehicle@2.0-default-service.xml",
Calvin Huanga6536162020-04-20 12:41:20 -0700255 ],
Yu Shan612dbf62021-07-02 18:11:08 -0700256 init_rc: ["android.hardware.automotive.vehicle@2.0-default-service.rc"],
Tri Vo22b2d682017-07-11 12:53:12 -0700257 vendor: true,
Tri Vofc871402017-07-10 17:13:23 -0700258 relative_install_path: "hw",
259 srcs: ["VehicleService.cpp"],
260 shared_libs: [
261 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900262 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700263 "libprotobuf-cpp-lite",
264 ],
265 static_libs: [
266 "android.hardware.automotive.vehicle@2.0-manager-lib",
Tri Vofc871402017-07-10 17:13:23 -0700267 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan612dbf62021-07-02 18:11:08 -0700268 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
Tri Vofc871402017-07-10 17:13:23 -0700269 ],
270}
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530271
272cc_fuzz {
273 name: "vehicleManager_fuzzer",
274 vendor: true,
275 defaults: ["vhal_v2_0_target_defaults"],
276 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
277 srcs: [
278 "tests/fuzzer/VehicleManager_fuzzer.cpp",
279 ],
280 shared_libs: [
281 "libbase",
282 "libcutils",
283 "libbinder_ndk",
284 ],
285 header_libs: ["libbase_headers"],
286 local_include_dirs: [
287 "common/include",
288 "tests",
289 ],
290 fuzz_config: {
291 cc: [
292 "android-media-fuzzing-reports@google.com",
293 ],
294 componentid: 533764,
295 },
296}