blob: 2c3422e82d8e349ab0bf7113bbf1ec04c60a2b0a [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",
Jeongik Cha38533912021-01-28 00:49:49 +090044 "android.automotive.watchdog-V2-ndk_platform",
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 Shan56020bc2021-07-16 15:51:16 -0700100 "android.hardware.automotive.vehicle@2.0-emulated-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"],
165 srcs: [
166 "tests/RecurrentTimer_test.cpp",
167 "tests/SubscriptionManager_test.cpp",
168 "tests/VehicleHalManager_test.cpp",
169 "tests/VehicleObjectPool_test.cpp",
170 "tests/VehiclePropConfigIndex_test.cpp",
Aditi Nagaraj8dcab8e2018-01-10 17:10:01 -0800171 "tests/VmsUtils_test.cpp",
Tri Vofc871402017-07-10 17:13:23 -0700172 ],
Felipe Leme75a27f82020-01-31 15:25:55 -0800173 shared_libs: [
174 "libbase",
Yu Shan8ae3ea92021-06-01 15:44:43 -0700175 "libcutils",
Felipe Leme75a27f82020-01-31 15:25:55 -0800176 ],
Yu Shan39844572021-06-23 20:42:24 -0700177 // Exclude share libraries from default because they might be missing on
178 // some test platforms and we are using static libraries instead.
Yu Shan045138d2021-06-02 16:15:29 -0700179 exclude_shared_libs: [
180 "android.automotive.watchdog-V2-ndk_platform",
181 "android.hardware.automotive.vehicle@2.0",
182 ],
183 static_libs: [
184 "android.automotive.watchdog-V2-ndk_platform",
185 "android.hardware.automotive.vehicle@2.0",
186 ],
Tri Vofc871402017-07-10 17:13:23 -0700187 header_libs: ["libbase_headers"],
Keun Soo YIMff84c372018-11-27 14:04:42 -0800188 test_suites: ["general-tests"],
Tri Vofc871402017-07-10 17:13:23 -0700189}
190
Hao Chen1c1fdca2019-11-15 14:20:34 -0800191cc_test {
192 name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests",
193 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700194 defaults: ["vhal_v2_0_target_defaults"],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800195 srcs: [
196 "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp",
Yu Shan39844572021-06-23 20:42:24 -0700197 "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800198 ],
199 static_libs: [
Yu Shan39844572021-06-23 20:42:24 -0700200 "libbase",
201 "libcutils",
Yu Shan795f4de2021-07-01 15:41:19 -0700202 "libgmock",
Yu Shan39844572021-06-23 20:42:24 -0700203 "libjsoncpp",
204 "libprotobuf-cpp-lite",
205 ],
206 // Exclude share libraries from default because they might be missing on
207 // some test platforms and we are using static libraries instead.
208 exclude_shared_libs: [
209 "android.automotive.watchdog-V2-ndk_platform",
210 "android.hardware.automotive.vehicle@2.0",
211 ],
212 whole_static_libs: [
Yu Shan045138d2021-06-02 16:15:29 -0700213 "android.automotive.watchdog-V2-ndk_platform",
214 "android.hardware.automotive.vehicle@2.0",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800215 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
216 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan045138d2021-06-02 16:15:29 -0700217 ],
Yu Shan4a239012021-07-20 18:12:53 -0700218 data: [
Yu Shan4a239012021-07-20 18:12:53 -0700219 ":vhal_test_json",
Yu Shan56020bc2021-07-16 15:51:16 -0700220 ":vhal_test_override_json",
Yu Shan4a239012021-07-20 18:12:53 -0700221 ],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800222 test_suites: ["general-tests"],
223}
224
Tri Vofc871402017-07-10 17:13:23 -0700225cc_binary {
226 name: "android.hardware.automotive.vehicle@2.0-service",
Hao Chenc324db92020-06-03 18:29:31 -0700227 defaults: ["vhal_v2_0_target_defaults"],
Calvin Huanga6536162020-04-20 12:41:20 -0700228 vintf_fragments: [
229 "android.hardware.automotive.vehicle@2.0-service.xml",
230 ],
Tri Vofc871402017-07-10 17:13:23 -0700231 init_rc: ["android.hardware.automotive.vehicle@2.0-service.rc"],
Tri Vo22b2d682017-07-11 12:53:12 -0700232 vendor: true,
Tri Vofc871402017-07-10 17:13:23 -0700233 relative_install_path: "hw",
234 srcs: ["VehicleService.cpp"],
235 shared_libs: [
236 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900237 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700238 "libprotobuf-cpp-lite",
239 ],
240 static_libs: [
241 "android.hardware.automotive.vehicle@2.0-manager-lib",
Tri Vofc871402017-07-10 17:13:23 -0700242 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan795f4de2021-07-01 15:41:19 -0700243 "android.hardware.automotive.vehicle@2.0-emulator-impl-lib",
Tri Vofc871402017-07-10 17:13:23 -0700244 ],
245}
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530246
247cc_fuzz {
248 name: "vehicleManager_fuzzer",
249 vendor: true,
250 defaults: ["vhal_v2_0_target_defaults"],
251 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
252 srcs: [
253 "tests/fuzzer/VehicleManager_fuzzer.cpp",
254 ],
255 shared_libs: [
256 "libbase",
257 "libcutils",
258 "libbinder_ndk",
259 ],
260 header_libs: ["libbase_headers"],
261 local_include_dirs: [
262 "common/include",
263 "tests",
264 ],
265 fuzz_config: {
266 cc: [
267 "android-media-fuzzing-reports@google.com",
268 ],
269 componentid: 533764,
270 },
271}