blob: 2e8ca66473024ba3a8365c4511bf6e855fcdd6f2 [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",
Tri Vofc871402017-07-10 17:13:23 -070095 ],
96 local_include_dirs: ["common/include/vhal_v2_0"],
97 export_include_dirs: ["impl"],
felipeal9c998c02020-04-17 14:32:53 -070098 whole_static_libs: [
felipeal9c998c02020-04-17 14:32:53 -070099 "android.hardware.automotive.vehicle@2.0-manager-lib",
100 ],
Tri Vofc871402017-07-10 17:13:23 -0700101 shared_libs: [
102 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900103 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700104 "libprotobuf-cpp-lite",
105 ],
106 static_libs: [
Tri Vofc871402017-07-10 17:13:23 -0700107 "android.hardware.automotive.vehicle@2.0-libproto-native",
108 ],
109}
110
Hao Chenc324db92020-06-03 18:29:31 -0700111// Vehicle HAL Server reference impl lib
112cc_library_static {
113 name: "android.hardware.automotive.vehicle@2.0-server-common-lib",
114 vendor: true,
115 host_supported: true,
116 defaults: ["vhal_v2_0_defaults"],
117 local_include_dirs: ["common/include/vhal_v2_0"],
118 export_include_dirs: ["common/include"],
119 srcs: [
120 "common/src/Obd2SensorStore.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700121 "common/src/ProtoMessageConverter.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700122 "common/src/VehicleObjectPool.cpp",
Hao Chen0b7c2872021-05-12 12:21:33 -0700123 "common/src/VehiclePropertyStore.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700124 "common/src/VehicleUtils.cpp",
125 ],
Yu Shan6029a372021-06-22 19:11:05 -0700126 static_libs: [
127 "android.hardware.automotive.vehicle@2.0-libproto-native",
128 ],
Hao Chenc324db92020-06-03 18:29:31 -0700129}
130
131// Vehicle HAL Server default implementation
132cc_library_static {
133 name: "android.hardware.automotive.vehicle@2.0-server-impl-lib",
134 vendor: true,
135 host_supported: true,
136 defaults: ["vhal_v2_0_defaults"],
137 local_include_dirs: ["common/include/vhal_v2_0"],
138 export_include_dirs: ["impl"],
139 srcs: [
Hao Chenc324db92020-06-03 18:29:31 -0700140 "impl/vhal_v2_0/GeneratorHub.cpp",
141 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
142 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700143 "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700144 ],
145 whole_static_libs: [
146 "android.hardware.automotive.vehicle@2.0-server-common-lib",
Lakshman Annadoraibfdb1ac2020-08-06 14:25:03 -0700147 "android.hardware.automotive.vehicle@2.0-user-hal-helper-lib",
Hao Chenc324db92020-06-03 18:29:31 -0700148 ],
149 static_libs: [
150 "android.hardware.automotive.vehicle@2.0-libproto-native",
151 ],
152 shared_libs: [
153 "libbase",
154 "libjsoncpp",
155 ],
156}
157
Tri Vofc871402017-07-10 17:13:23 -0700158cc_test {
159 name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests",
Tri Vo22b2d682017-07-11 12:53:12 -0700160 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700161 defaults: ["vhal_v2_0_target_defaults"],
Tri Vofc871402017-07-10 17:13:23 -0700162 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
163 srcs: [
164 "tests/RecurrentTimer_test.cpp",
165 "tests/SubscriptionManager_test.cpp",
166 "tests/VehicleHalManager_test.cpp",
167 "tests/VehicleObjectPool_test.cpp",
168 "tests/VehiclePropConfigIndex_test.cpp",
Aditi Nagaraj8dcab8e2018-01-10 17:10:01 -0800169 "tests/VmsUtils_test.cpp",
Tri Vofc871402017-07-10 17:13:23 -0700170 ],
Felipe Leme75a27f82020-01-31 15:25:55 -0800171 shared_libs: [
172 "libbase",
Yu Shan8ae3ea92021-06-01 15:44:43 -0700173 "libcutils",
Felipe Leme75a27f82020-01-31 15:25:55 -0800174 ],
Yu Shan39844572021-06-23 20:42:24 -0700175 // Exclude share libraries from default because they might be missing on
176 // some test platforms and we are using static libraries instead.
Yu Shan045138d2021-06-02 16:15:29 -0700177 exclude_shared_libs: [
178 "android.automotive.watchdog-V2-ndk_platform",
179 "android.hardware.automotive.vehicle@2.0",
180 ],
181 static_libs: [
182 "android.automotive.watchdog-V2-ndk_platform",
183 "android.hardware.automotive.vehicle@2.0",
184 ],
Tri Vofc871402017-07-10 17:13:23 -0700185 header_libs: ["libbase_headers"],
Keun Soo YIMff84c372018-11-27 14:04:42 -0800186 test_suites: ["general-tests"],
Tri Vofc871402017-07-10 17:13:23 -0700187}
188
Hao Chen1c1fdca2019-11-15 14:20:34 -0800189cc_test {
190 name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests",
191 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700192 defaults: ["vhal_v2_0_target_defaults"],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800193 srcs: [
194 "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp",
Yu Shan39844572021-06-23 20:42:24 -0700195 "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800196 ],
197 static_libs: [
Yu Shan39844572021-06-23 20:42:24 -0700198 "libbase",
199 "libcutils",
Yu Shan795f4de2021-07-01 15:41:19 -0700200 "libgmock",
Yu Shan39844572021-06-23 20:42:24 -0700201 "libjsoncpp",
202 "libprotobuf-cpp-lite",
203 ],
204 // Exclude share libraries from default because they might be missing on
205 // some test platforms and we are using static libraries instead.
206 exclude_shared_libs: [
207 "android.automotive.watchdog-V2-ndk_platform",
208 "android.hardware.automotive.vehicle@2.0",
209 ],
210 whole_static_libs: [
Yu Shan045138d2021-06-02 16:15:29 -0700211 "android.automotive.watchdog-V2-ndk_platform",
212 "android.hardware.automotive.vehicle@2.0",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800213 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
214 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan045138d2021-06-02 16:15:29 -0700215 ],
Yu Shan795f4de2021-07-01 15:41:19 -0700216 data: [":vhal_test_json"],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800217 test_suites: ["general-tests"],
218}
219
Tri Vofc871402017-07-10 17:13:23 -0700220cc_binary {
221 name: "android.hardware.automotive.vehicle@2.0-service",
Hao Chenc324db92020-06-03 18:29:31 -0700222 defaults: ["vhal_v2_0_target_defaults"],
Calvin Huanga6536162020-04-20 12:41:20 -0700223 vintf_fragments: [
224 "android.hardware.automotive.vehicle@2.0-service.xml",
225 ],
Tri Vofc871402017-07-10 17:13:23 -0700226 init_rc: ["android.hardware.automotive.vehicle@2.0-service.rc"],
Tri Vo22b2d682017-07-11 12:53:12 -0700227 vendor: true,
Tri Vofc871402017-07-10 17:13:23 -0700228 relative_install_path: "hw",
229 srcs: ["VehicleService.cpp"],
230 shared_libs: [
231 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900232 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700233 "libprotobuf-cpp-lite",
234 ],
235 static_libs: [
236 "android.hardware.automotive.vehicle@2.0-manager-lib",
Tri Vofc871402017-07-10 17:13:23 -0700237 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan795f4de2021-07-01 15:41:19 -0700238 "android.hardware.automotive.vehicle@2.0-emulator-impl-lib",
Tri Vofc871402017-07-10 17:13:23 -0700239 ],
240}
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530241
242cc_fuzz {
243 name: "vehicleManager_fuzzer",
244 vendor: true,
245 defaults: ["vhal_v2_0_target_defaults"],
246 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
247 srcs: [
248 "tests/fuzzer/VehicleManager_fuzzer.cpp",
249 ],
250 shared_libs: [
251 "libbase",
252 "libcutils",
253 "libbinder_ndk",
254 ],
255 header_libs: ["libbase_headers"],
256 local_include_dirs: [
257 "common/include",
258 "tests",
259 ],
260 fuzz_config: {
261 cc: [
262 "android-media-fuzzing-reports@google.com",
263 ],
264 componentid: 533764,
265 },
266}