blob: 8bf6bbea876547f1f3bf0dd31a2dd8de3dcc16f6 [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: [
felipeal9c998c02020-04-17 14:32:53 -0700100 "android.hardware.automotive.vehicle@2.0-manager-lib",
101 ],
Tri Vofc871402017-07-10 17:13:23 -0700102 shared_libs: [
103 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900104 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700105 "libprotobuf-cpp-lite",
106 ],
107 static_libs: [
Tri Vofc871402017-07-10 17:13:23 -0700108 "android.hardware.automotive.vehicle@2.0-libproto-native",
109 ],
110}
111
Hao Chenc324db92020-06-03 18:29:31 -0700112// Vehicle HAL Server reference impl lib
113cc_library_static {
114 name: "android.hardware.automotive.vehicle@2.0-server-common-lib",
115 vendor: true,
116 host_supported: true,
117 defaults: ["vhal_v2_0_defaults"],
118 local_include_dirs: ["common/include/vhal_v2_0"],
119 export_include_dirs: ["common/include"],
120 srcs: [
121 "common/src/Obd2SensorStore.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700122 "common/src/ProtoMessageConverter.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700123 "common/src/VehicleObjectPool.cpp",
Hao Chen0b7c2872021-05-12 12:21:33 -0700124 "common/src/VehiclePropertyStore.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700125 "common/src/VehicleUtils.cpp",
126 ],
Yu Shan6029a372021-06-22 19:11:05 -0700127 static_libs: [
128 "android.hardware.automotive.vehicle@2.0-libproto-native",
129 ],
Hao Chenc324db92020-06-03 18:29:31 -0700130}
131
132// Vehicle HAL Server default implementation
133cc_library_static {
134 name: "android.hardware.automotive.vehicle@2.0-server-impl-lib",
135 vendor: true,
136 host_supported: true,
137 defaults: ["vhal_v2_0_defaults"],
138 local_include_dirs: ["common/include/vhal_v2_0"],
139 export_include_dirs: ["impl"],
140 srcs: [
Hao Chenc324db92020-06-03 18:29:31 -0700141 "impl/vhal_v2_0/GeneratorHub.cpp",
142 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
143 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700144 "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
Yu Shan122eea62021-07-20 18:22:23 -0700145 "impl/vhal_v2_0/FakeObd2Frame.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700146 ],
147 whole_static_libs: [
148 "android.hardware.automotive.vehicle@2.0-server-common-lib",
149 ],
150 static_libs: [
151 "android.hardware.automotive.vehicle@2.0-libproto-native",
152 ],
153 shared_libs: [
154 "libbase",
155 "libjsoncpp",
156 ],
157}
158
Tri Vofc871402017-07-10 17:13:23 -0700159cc_test {
160 name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests",
Tri Vo22b2d682017-07-11 12:53:12 -0700161 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700162 defaults: ["vhal_v2_0_target_defaults"],
Tri Vofc871402017-07-10 17:13:23 -0700163 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
164 srcs: [
165 "tests/RecurrentTimer_test.cpp",
166 "tests/SubscriptionManager_test.cpp",
167 "tests/VehicleHalManager_test.cpp",
168 "tests/VehicleObjectPool_test.cpp",
169 "tests/VehiclePropConfigIndex_test.cpp",
Aditi Nagaraj8dcab8e2018-01-10 17:10:01 -0800170 "tests/VmsUtils_test.cpp",
Tri Vofc871402017-07-10 17:13:23 -0700171 ],
Felipe Leme75a27f82020-01-31 15:25:55 -0800172 shared_libs: [
173 "libbase",
Yu Shan8ae3ea92021-06-01 15:44:43 -0700174 "libcutils",
Felipe Leme75a27f82020-01-31 15:25:55 -0800175 ],
Yu Shan39844572021-06-23 20:42:24 -0700176 // Exclude share libraries from default because they might be missing on
177 // some test platforms and we are using static libraries instead.
Yu Shan045138d2021-06-02 16:15:29 -0700178 exclude_shared_libs: [
179 "android.automotive.watchdog-V2-ndk_platform",
180 "android.hardware.automotive.vehicle@2.0",
181 ],
182 static_libs: [
183 "android.automotive.watchdog-V2-ndk_platform",
184 "android.hardware.automotive.vehicle@2.0",
185 ],
Tri Vofc871402017-07-10 17:13:23 -0700186 header_libs: ["libbase_headers"],
Keun Soo YIMff84c372018-11-27 14:04:42 -0800187 test_suites: ["general-tests"],
Tri Vofc871402017-07-10 17:13:23 -0700188}
189
Hao Chen1c1fdca2019-11-15 14:20:34 -0800190cc_test {
191 name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests",
192 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700193 defaults: ["vhal_v2_0_target_defaults"],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800194 srcs: [
195 "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp",
Yu Shan39844572021-06-23 20:42:24 -0700196 "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800197 ],
198 static_libs: [
Yu Shan39844572021-06-23 20:42:24 -0700199 "libbase",
200 "libcutils",
Yu Shan795f4de2021-07-01 15:41:19 -0700201 "libgmock",
Yu Shan39844572021-06-23 20:42:24 -0700202 "libjsoncpp",
203 "libprotobuf-cpp-lite",
204 ],
205 // Exclude share libraries from default because they might be missing on
206 // some test platforms and we are using static libraries instead.
207 exclude_shared_libs: [
208 "android.automotive.watchdog-V2-ndk_platform",
209 "android.hardware.automotive.vehicle@2.0",
210 ],
211 whole_static_libs: [
Yu Shan045138d2021-06-02 16:15:29 -0700212 "android.automotive.watchdog-V2-ndk_platform",
213 "android.hardware.automotive.vehicle@2.0",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800214 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
215 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan045138d2021-06-02 16:15:29 -0700216 ],
Yu Shan4a239012021-07-20 18:12:53 -0700217 data: [
218 ":vhal_test_override_json",
219 ":vhal_test_json",
220 ],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800221 test_suites: ["general-tests"],
222}
223
Tri Vofc871402017-07-10 17:13:23 -0700224cc_binary {
225 name: "android.hardware.automotive.vehicle@2.0-service",
Hao Chenc324db92020-06-03 18:29:31 -0700226 defaults: ["vhal_v2_0_target_defaults"],
Calvin Huanga6536162020-04-20 12:41:20 -0700227 vintf_fragments: [
228 "android.hardware.automotive.vehicle@2.0-service.xml",
229 ],
Tri Vofc871402017-07-10 17:13:23 -0700230 init_rc: ["android.hardware.automotive.vehicle@2.0-service.rc"],
Tri Vo22b2d682017-07-11 12:53:12 -0700231 vendor: true,
Tri Vofc871402017-07-10 17:13:23 -0700232 relative_install_path: "hw",
233 srcs: ["VehicleService.cpp"],
234 shared_libs: [
235 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900236 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700237 "libprotobuf-cpp-lite",
238 ],
239 static_libs: [
240 "android.hardware.automotive.vehicle@2.0-manager-lib",
Tri Vofc871402017-07-10 17:13:23 -0700241 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan795f4de2021-07-01 15:41:19 -0700242 "android.hardware.automotive.vehicle@2.0-emulator-impl-lib",
Tri Vofc871402017-07-10 17:13:23 -0700243 ],
244}
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530245
246cc_fuzz {
247 name: "vehicleManager_fuzzer",
248 vendor: true,
249 defaults: ["vhal_v2_0_target_defaults"],
250 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
251 srcs: [
252 "tests/fuzzer/VehicleManager_fuzzer.cpp",
253 ],
254 shared_libs: [
255 "libbase",
256 "libcutils",
257 "libbinder_ndk",
258 ],
259 header_libs: ["libbase_headers"],
260 local_include_dirs: [
261 "common/include",
262 "tests",
263 ],
264 fuzz_config: {
265 cc: [
266 "android-media-fuzzing-reports@google.com",
267 ],
268 componentid: 533764,
269 },
270}