blob: 0d3253b9f878cea90311607457d658eb6845b26e [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"],
Yuncheol Heo38ec2402021-04-15 15:25:39 -070087 cflags: ["-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING"],
Tri Vofc871402017-07-10 17:13:23 -070088 srcs: [
Yu Shan6029a372021-06-22 19:11:05 -070089 "impl/vhal_v2_0/DefaultVehicleHal.cpp",
Hao Chena6d6fa32020-02-14 11:51:26 -080090 "impl/vhal_v2_0/VehicleHalClient.cpp",
Yu Shan6029a372021-06-22 19:11:05 -070091 "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
Chao Yanf63c2ca2018-04-17 11:32:39 -070092 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
93 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
Chao Yan0f85dd12018-06-04 14:03:02 -070094 "impl/vhal_v2_0/GeneratorHub.cpp",
Yu Shan122eea62021-07-20 18:22:23 -070095 "impl/vhal_v2_0/FakeObd2Frame.cpp",
Tri Vofc871402017-07-10 17:13:23 -070096 ],
97 local_include_dirs: ["common/include/vhal_v2_0"],
98 export_include_dirs: ["impl"],
felipeal9c998c02020-04-17 14:32:53 -070099 whole_static_libs: [
Yu Shan58f71e72021-08-03 16:49:40 -0700100 "android.hardware.automotive.vehicle@2.0-fake-user-hal-lib",
felipeal9c998c02020-04-17 14:32:53 -0700101 "android.hardware.automotive.vehicle@2.0-manager-lib",
102 ],
Tri Vofc871402017-07-10 17:13:23 -0700103 shared_libs: [
104 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900105 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700106 "libprotobuf-cpp-lite",
107 ],
108 static_libs: [
Tri Vofc871402017-07-10 17:13:23 -0700109 "android.hardware.automotive.vehicle@2.0-libproto-native",
110 ],
111}
112
Hao Chenc324db92020-06-03 18:29:31 -0700113// Vehicle HAL Server reference impl lib
114cc_library_static {
115 name: "android.hardware.automotive.vehicle@2.0-server-common-lib",
116 vendor: true,
117 host_supported: true,
118 defaults: ["vhal_v2_0_defaults"],
119 local_include_dirs: ["common/include/vhal_v2_0"],
120 export_include_dirs: ["common/include"],
121 srcs: [
122 "common/src/Obd2SensorStore.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700123 "common/src/ProtoMessageConverter.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700124 "common/src/VehicleObjectPool.cpp",
Hao Chen0b7c2872021-05-12 12:21:33 -0700125 "common/src/VehiclePropertyStore.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700126 "common/src/VehicleUtils.cpp",
127 ],
Yu Shan6029a372021-06-22 19:11:05 -0700128 static_libs: [
129 "android.hardware.automotive.vehicle@2.0-libproto-native",
130 ],
Hao Chenc324db92020-06-03 18:29:31 -0700131}
132
133// Vehicle HAL Server default implementation
134cc_library_static {
135 name: "android.hardware.automotive.vehicle@2.0-server-impl-lib",
136 vendor: true,
137 host_supported: true,
138 defaults: ["vhal_v2_0_defaults"],
139 local_include_dirs: ["common/include/vhal_v2_0"],
140 export_include_dirs: ["impl"],
141 srcs: [
Hao Chenc324db92020-06-03 18:29:31 -0700142 "impl/vhal_v2_0/GeneratorHub.cpp",
143 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
144 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700145 "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
Yu Shan122eea62021-07-20 18:22:23 -0700146 "impl/vhal_v2_0/FakeObd2Frame.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700147 ],
148 whole_static_libs: [
149 "android.hardware.automotive.vehicle@2.0-server-common-lib",
150 ],
151 static_libs: [
152 "android.hardware.automotive.vehicle@2.0-libproto-native",
153 ],
154 shared_libs: [
155 "libbase",
156 "libjsoncpp",
157 ],
158}
159
Tri Vofc871402017-07-10 17:13:23 -0700160cc_test {
161 name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests",
Tri Vo22b2d682017-07-11 12:53:12 -0700162 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700163 defaults: ["vhal_v2_0_target_defaults"],
Tri Vofc871402017-07-10 17:13:23 -0700164 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
Chih-Hung Hsiehad1bf312022-02-17 21:56:13 -0800165 tidy_timeout_srcs: [
166 "tests/VmsUtils_test.cpp",
167 ],
Tri Vofc871402017-07-10 17:13:23 -0700168 srcs: [
169 "tests/RecurrentTimer_test.cpp",
170 "tests/SubscriptionManager_test.cpp",
171 "tests/VehicleHalManager_test.cpp",
172 "tests/VehicleObjectPool_test.cpp",
173 "tests/VehiclePropConfigIndex_test.cpp",
Aditi Nagaraj8dcab8e2018-01-10 17:10:01 -0800174 "tests/VmsUtils_test.cpp",
Tri Vofc871402017-07-10 17:13:23 -0700175 ],
Felipe Leme75a27f82020-01-31 15:25:55 -0800176 shared_libs: [
177 "libbase",
Yu Shan8ae3ea92021-06-01 15:44:43 -0700178 "libcutils",
Felipe Leme75a27f82020-01-31 15:25:55 -0800179 ],
Yu Shan39844572021-06-23 20:42:24 -0700180 // Exclude share libraries from default because they might be missing on
181 // some test platforms and we are using static libraries instead.
Yu Shan045138d2021-06-02 16:15:29 -0700182 exclude_shared_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900183 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700184 "android.hardware.automotive.vehicle@2.0",
185 ],
186 static_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900187 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700188 "android.hardware.automotive.vehicle@2.0",
189 ],
Tri Vofc871402017-07-10 17:13:23 -0700190 header_libs: ["libbase_headers"],
Keun Soo YIMff84c372018-11-27 14:04:42 -0800191 test_suites: ["general-tests"],
Tri Vofc871402017-07-10 17:13:23 -0700192}
193
Hao Chen1c1fdca2019-11-15 14:20:34 -0800194cc_test {
195 name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests",
196 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700197 defaults: ["vhal_v2_0_target_defaults"],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800198 srcs: [
199 "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp",
Yu Shan39844572021-06-23 20:42:24 -0700200 "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800201 ],
202 static_libs: [
Yu Shan39844572021-06-23 20:42:24 -0700203 "libbase",
204 "libcutils",
Yu Shan795f4de2021-07-01 15:41:19 -0700205 "libgmock",
Yu Shan39844572021-06-23 20:42:24 -0700206 "libjsoncpp",
207 "libprotobuf-cpp-lite",
208 ],
209 // Exclude share libraries from default because they might be missing on
210 // some test platforms and we are using static libraries instead.
211 exclude_shared_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900212 "android.automotive.watchdog-V2-ndk",
Yu Shan39844572021-06-23 20:42:24 -0700213 "android.hardware.automotive.vehicle@2.0",
214 ],
215 whole_static_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900216 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700217 "android.hardware.automotive.vehicle@2.0",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800218 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
219 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan045138d2021-06-02 16:15:29 -0700220 ],
Yu Shan4a239012021-07-20 18:12:53 -0700221 data: [
Yu Shan4a239012021-07-20 18:12:53 -0700222 ":vhal_test_json",
Yu Shan56020bc2021-07-16 15:51:16 -0700223 ":vhal_test_override_json",
Yu Shan4a239012021-07-20 18:12:53 -0700224 ],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800225 test_suites: ["general-tests"],
226}
227
Tri Vofc871402017-07-10 17:13:23 -0700228cc_binary {
Yu Shan612dbf62021-07-02 18:11:08 -0700229 name: "android.hardware.automotive.vehicle@2.0-default-service",
Hao Chenc324db92020-06-03 18:29:31 -0700230 defaults: ["vhal_v2_0_target_defaults"],
Calvin Huanga6536162020-04-20 12:41:20 -0700231 vintf_fragments: [
Yu Shan612dbf62021-07-02 18:11:08 -0700232 "android.hardware.automotive.vehicle@2.0-default-service.xml",
Calvin Huanga6536162020-04-20 12:41:20 -0700233 ],
Yu Shan612dbf62021-07-02 18:11:08 -0700234 init_rc: ["android.hardware.automotive.vehicle@2.0-default-service.rc"],
Tri Vo22b2d682017-07-11 12:53:12 -0700235 vendor: true,
Tri Vofc871402017-07-10 17:13:23 -0700236 relative_install_path: "hw",
237 srcs: ["VehicleService.cpp"],
238 shared_libs: [
239 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900240 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700241 "libprotobuf-cpp-lite",
242 ],
243 static_libs: [
244 "android.hardware.automotive.vehicle@2.0-manager-lib",
Tri Vofc871402017-07-10 17:13:23 -0700245 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan612dbf62021-07-02 18:11:08 -0700246 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
Tri Vofc871402017-07-10 17:13:23 -0700247 ],
248}
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530249
250cc_fuzz {
251 name: "vehicleManager_fuzzer",
252 vendor: true,
253 defaults: ["vhal_v2_0_target_defaults"],
254 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
255 srcs: [
256 "tests/fuzzer/VehicleManager_fuzzer.cpp",
257 ],
258 shared_libs: [
259 "libbase",
260 "libcutils",
261 "libbinder_ndk",
262 ],
263 header_libs: ["libbase_headers"],
264 local_include_dirs: [
265 "common/include",
266 "tests",
267 ],
268 fuzz_config: {
269 cc: [
270 "android-media-fuzzing-reports@google.com",
271 ],
272 componentid: 533764,
273 },
274}