Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 1 | // 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 Badour | c22b35b | 2021-02-23 14:26:20 -0800 | [diff] [blame] | 15 | package { |
| 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 Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 24 | cc_defaults { |
| 25 | name: "vhal_v2_0_defaults", |
| 26 | shared_libs: [ |
| 27 | "libhidlbase", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 28 | "liblog", |
| 29 | "libutils", |
| 30 | "android.hardware.automotive.vehicle@2.0", |
| 31 | ], |
| 32 | cflags: [ |
| 33 | "-Wall", |
| 34 | "-Wextra", |
| 35 | "-Werror", |
| 36 | ], |
| 37 | } |
| 38 | |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 39 | cc_defaults { |
| 40 | name: "vhal_v2_0_target_defaults", |
| 41 | defaults: ["vhal_v2_0_defaults"], |
| 42 | shared_libs: [ |
| 43 | "libbinder_ndk", |
Jiyong Park | c426c6d | 2021-08-04 12:48:07 +0900 | [diff] [blame] | 44 | "android.automotive.watchdog-V2-ndk", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 45 | ], |
| 46 | } |
| 47 | |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 48 | cc_library_headers { |
| 49 | name: "vhal_v2_0_common_headers", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 50 | visibility: ["//visibility:public"], |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 51 | vendor: true, |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 52 | export_include_dirs: ["common/include/vhal_v2_0"], |
| 53 | } |
| 54 | |
| 55 | // Vehicle reference implementation lib |
Anthony Mah | a9d8c0d | 2017-10-03 16:22:22 -0700 | [diff] [blame] | 56 | cc_library { |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 57 | name: "android.hardware.automotive.vehicle@2.0-manager-lib", |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 58 | vendor: true, |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 59 | defaults: ["vhal_v2_0_target_defaults"], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 60 | srcs: [ |
Pavel Maltsev | 250139c | 2017-08-24 15:09:41 -0700 | [diff] [blame] | 61 | "common/src/Obd2SensorStore.cpp", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 62 | "common/src/ProtoMessageConverter.cpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 63 | "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 Nagaraj | 8dcab8e | 2018-01-10 17:10:01 -0800 | [diff] [blame] | 68 | "common/src/VmsUtils.cpp", |
Eric Jeong | 908101a | 2020-04-23 09:43:55 -0700 | [diff] [blame] | 69 | "common/src/WatchdogClient.cpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 70 | ], |
Felipe Leme | 75a27f8 | 2020-01-31 15:25:55 -0800 | [diff] [blame] | 71 | shared_libs: [ |
| 72 | "libbase", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 73 | "libprotobuf-cpp-lite", |
Felipe Leme | 75a27f8 | 2020-01-31 15:25:55 -0800 | [diff] [blame] | 74 | ], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 75 | local_include_dirs: ["common/include/vhal_v2_0"], |
| 76 | export_include_dirs: ["common/include"], |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 77 | static_libs: [ |
| 78 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
| 79 | ], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 80 | } |
| 81 | |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 82 | // Vehicle default VehicleHAL implementation |
| 83 | cc_library_static { |
| 84 | name: "android.hardware.automotive.vehicle@2.0-default-impl-lib", |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 85 | vendor: true, |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 86 | defaults: ["vhal_v2_0_target_defaults"], |
Yuncheol Heo | 38ec240 | 2021-04-15 15:25:39 -0700 | [diff] [blame] | 87 | cflags: ["-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING"], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 88 | srcs: [ |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 89 | "impl/vhal_v2_0/DefaultVehicleHal.cpp", |
Hao Chen | a6d6fa3 | 2020-02-14 11:51:26 -0800 | [diff] [blame] | 90 | "impl/vhal_v2_0/VehicleHalClient.cpp", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 91 | "impl/vhal_v2_0/DefaultVehicleHalServer.cpp", |
Chao Yan | f63c2ca | 2018-04-17 11:32:39 -0700 | [diff] [blame] | 92 | "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", |
| 93 | "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", |
Chao Yan | 0f85dd1 | 2018-06-04 14:03:02 -0700 | [diff] [blame] | 94 | "impl/vhal_v2_0/GeneratorHub.cpp", |
Yu Shan | 122eea6 | 2021-07-20 18:22:23 -0700 | [diff] [blame] | 95 | "impl/vhal_v2_0/FakeObd2Frame.cpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 96 | ], |
| 97 | local_include_dirs: ["common/include/vhal_v2_0"], |
| 98 | export_include_dirs: ["impl"], |
felipeal | 9c998c0 | 2020-04-17 14:32:53 -0700 | [diff] [blame] | 99 | whole_static_libs: [ |
Yu Shan | 58f71e7 | 2021-08-03 16:49:40 -0700 | [diff] [blame^] | 100 | "android.hardware.automotive.vehicle@2.0-fake-user-hal-lib", |
felipeal | 9c998c0 | 2020-04-17 14:32:53 -0700 | [diff] [blame] | 101 | "android.hardware.automotive.vehicle@2.0-manager-lib", |
| 102 | ], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 103 | shared_libs: [ |
| 104 | "libbase", |
Inseob Kim | 31ab19f | 2019-09-10 14:56:19 +0900 | [diff] [blame] | 105 | "libjsoncpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 106 | "libprotobuf-cpp-lite", |
| 107 | ], |
| 108 | static_libs: [ |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 109 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
| 110 | ], |
| 111 | } |
| 112 | |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 113 | // Vehicle HAL Server reference impl lib |
| 114 | cc_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 Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 123 | "common/src/ProtoMessageConverter.cpp", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 124 | "common/src/VehicleObjectPool.cpp", |
Hao Chen | 0b7c287 | 2021-05-12 12:21:33 -0700 | [diff] [blame] | 125 | "common/src/VehiclePropertyStore.cpp", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 126 | "common/src/VehicleUtils.cpp", |
| 127 | ], |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 128 | static_libs: [ |
| 129 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
| 130 | ], |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | // Vehicle HAL Server default implementation |
| 134 | cc_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 Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 142 | "impl/vhal_v2_0/GeneratorHub.cpp", |
| 143 | "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", |
| 144 | "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 145 | "impl/vhal_v2_0/DefaultVehicleHalServer.cpp", |
Yu Shan | 122eea6 | 2021-07-20 18:22:23 -0700 | [diff] [blame] | 146 | "impl/vhal_v2_0/FakeObd2Frame.cpp", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 147 | ], |
| 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 Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 160 | cc_test { |
| 161 | name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests", |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 162 | vendor: true, |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 163 | defaults: ["vhal_v2_0_target_defaults"], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 164 | 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 Nagaraj | 8dcab8e | 2018-01-10 17:10:01 -0800 | [diff] [blame] | 171 | "tests/VmsUtils_test.cpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 172 | ], |
Felipe Leme | 75a27f8 | 2020-01-31 15:25:55 -0800 | [diff] [blame] | 173 | shared_libs: [ |
| 174 | "libbase", |
Yu Shan | 8ae3ea9 | 2021-06-01 15:44:43 -0700 | [diff] [blame] | 175 | "libcutils", |
Felipe Leme | 75a27f8 | 2020-01-31 15:25:55 -0800 | [diff] [blame] | 176 | ], |
Yu Shan | 3984457 | 2021-06-23 20:42:24 -0700 | [diff] [blame] | 177 | // Exclude share libraries from default because they might be missing on |
| 178 | // some test platforms and we are using static libraries instead. |
Yu Shan | 045138d | 2021-06-02 16:15:29 -0700 | [diff] [blame] | 179 | exclude_shared_libs: [ |
Jiyong Park | c426c6d | 2021-08-04 12:48:07 +0900 | [diff] [blame] | 180 | "android.automotive.watchdog-V2-ndk", |
Yu Shan | 045138d | 2021-06-02 16:15:29 -0700 | [diff] [blame] | 181 | "android.hardware.automotive.vehicle@2.0", |
| 182 | ], |
| 183 | static_libs: [ |
Jiyong Park | c426c6d | 2021-08-04 12:48:07 +0900 | [diff] [blame] | 184 | "android.automotive.watchdog-V2-ndk", |
Yu Shan | 045138d | 2021-06-02 16:15:29 -0700 | [diff] [blame] | 185 | "android.hardware.automotive.vehicle@2.0", |
| 186 | ], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 187 | header_libs: ["libbase_headers"], |
Keun Soo YIM | ff84c37 | 2018-11-27 14:04:42 -0800 | [diff] [blame] | 188 | test_suites: ["general-tests"], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 189 | } |
| 190 | |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 191 | cc_test { |
| 192 | name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests", |
| 193 | vendor: true, |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 194 | defaults: ["vhal_v2_0_target_defaults"], |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 195 | srcs: [ |
| 196 | "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp", |
Yu Shan | 3984457 | 2021-06-23 20:42:24 -0700 | [diff] [blame] | 197 | "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp", |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 198 | ], |
| 199 | static_libs: [ |
Yu Shan | 3984457 | 2021-06-23 20:42:24 -0700 | [diff] [blame] | 200 | "libbase", |
| 201 | "libcutils", |
Yu Shan | 795f4de | 2021-07-01 15:41:19 -0700 | [diff] [blame] | 202 | "libgmock", |
Yu Shan | 3984457 | 2021-06-23 20:42:24 -0700 | [diff] [blame] | 203 | "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: [ |
Jiyong Park | c426c6d | 2021-08-04 12:48:07 +0900 | [diff] [blame] | 209 | "android.automotive.watchdog-V2-ndk", |
Yu Shan | 3984457 | 2021-06-23 20:42:24 -0700 | [diff] [blame] | 210 | "android.hardware.automotive.vehicle@2.0", |
| 211 | ], |
| 212 | whole_static_libs: [ |
Jiyong Park | c426c6d | 2021-08-04 12:48:07 +0900 | [diff] [blame] | 213 | "android.automotive.watchdog-V2-ndk", |
Yu Shan | 045138d | 2021-06-02 16:15:29 -0700 | [diff] [blame] | 214 | "android.hardware.automotive.vehicle@2.0", |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 215 | "android.hardware.automotive.vehicle@2.0-default-impl-lib", |
| 216 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
Yu Shan | 045138d | 2021-06-02 16:15:29 -0700 | [diff] [blame] | 217 | ], |
Yu Shan | 4a23901 | 2021-07-20 18:12:53 -0700 | [diff] [blame] | 218 | data: [ |
Yu Shan | 4a23901 | 2021-07-20 18:12:53 -0700 | [diff] [blame] | 219 | ":vhal_test_json", |
Yu Shan | 56020bc | 2021-07-16 15:51:16 -0700 | [diff] [blame] | 220 | ":vhal_test_override_json", |
Yu Shan | 4a23901 | 2021-07-20 18:12:53 -0700 | [diff] [blame] | 221 | ], |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 222 | test_suites: ["general-tests"], |
| 223 | } |
| 224 | |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 225 | cc_binary { |
Yu Shan | 612dbf6 | 2021-07-02 18:11:08 -0700 | [diff] [blame] | 226 | name: "android.hardware.automotive.vehicle@2.0-default-service", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 227 | defaults: ["vhal_v2_0_target_defaults"], |
Calvin Huang | a653616 | 2020-04-20 12:41:20 -0700 | [diff] [blame] | 228 | vintf_fragments: [ |
Yu Shan | 612dbf6 | 2021-07-02 18:11:08 -0700 | [diff] [blame] | 229 | "android.hardware.automotive.vehicle@2.0-default-service.xml", |
Calvin Huang | a653616 | 2020-04-20 12:41:20 -0700 | [diff] [blame] | 230 | ], |
Yu Shan | 612dbf6 | 2021-07-02 18:11:08 -0700 | [diff] [blame] | 231 | init_rc: ["android.hardware.automotive.vehicle@2.0-default-service.rc"], |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 232 | vendor: true, |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 233 | relative_install_path: "hw", |
| 234 | srcs: ["VehicleService.cpp"], |
| 235 | shared_libs: [ |
| 236 | "libbase", |
Inseob Kim | 31ab19f | 2019-09-10 14:56:19 +0900 | [diff] [blame] | 237 | "libjsoncpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 238 | "libprotobuf-cpp-lite", |
| 239 | ], |
| 240 | static_libs: [ |
| 241 | "android.hardware.automotive.vehicle@2.0-manager-lib", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 242 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
Yu Shan | 612dbf6 | 2021-07-02 18:11:08 -0700 | [diff] [blame] | 243 | "android.hardware.automotive.vehicle@2.0-default-impl-lib", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 244 | ], |
| 245 | } |
Ayushi Khopkar | b3057b0 | 2020-08-31 10:59:52 +0530 | [diff] [blame] | 246 | |
| 247 | cc_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 | } |