• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "hardware_interfaces_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["hardware_interfaces_license"],
24}
25
26filegroup {
27    name: "VehicleHalProtoFiles",
28    srcs: ["**/*.proto"],
29    visibility: ["//hardware/interfaces/automotive/vehicle:__subpackages__"],
30}
31
32genrule {
33    name: "VehicleProtoStub_h",
34    tools: [
35        "aprotoc",
36        "protoc-gen-grpc-cpp-plugin",
37    ],
38    cmd: "$(location aprotoc) -Ihardware/interfaces/automotive/vehicle/aidl/impl/current/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
39    srcs: [
40        ":VehicleHalProtoFiles",
41    ],
42    out: [
43        "android/hardware/automotive/vehicle/DumpOptions.pb.h",
44        "android/hardware/automotive/vehicle/DumpResult.pb.h",
45        "android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.pb.h",
46        "android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.pb.h",
47        "android/hardware/automotive/vehicle/HasSupportedValueInfo.pb.h",
48        "android/hardware/automotive/vehicle/PropIdAreaId.pb.h",
49        "android/hardware/automotive/vehicle/RawPropValues.pb.h",
50        "android/hardware/automotive/vehicle/StatusCode.pb.h",
51        "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h",
52        "android/hardware/automotive/vehicle/VehiclePropConfig.pb.h",
53        "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.h",
54        "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.h",
55        "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.h",
56        "android/hardware/automotive/vehicle/VehiclePropValue.pb.h",
57        "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.h",
58        "android/hardware/automotive/vehicle/SubscribeOptions.pb.h",
59        "android/hardware/automotive/vehicle/SubscribeRequest.pb.h",
60        "android/hardware/automotive/vehicle/UnsubscribeRequest.pb.h",
61    ],
62}
63
64genrule {
65    name: "VehicleProtoStub_cc",
66    tools: [
67        "aprotoc",
68        "protoc-gen-grpc-cpp-plugin",
69    ],
70    cmd: "$(location aprotoc) -Ihardware/interfaces/automotive/vehicle/aidl/impl/current/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
71    srcs: [
72        ":VehicleHalProtoFiles",
73    ],
74    out: [
75        "android/hardware/automotive/vehicle/DumpOptions.pb.cc",
76        "android/hardware/automotive/vehicle/DumpResult.pb.cc",
77        "android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.pb.cc",
78        "android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.pb.cc",
79        "android/hardware/automotive/vehicle/HasSupportedValueInfo.pb.cc",
80        "android/hardware/automotive/vehicle/PropIdAreaId.pb.cc",
81        "android/hardware/automotive/vehicle/RawPropValues.pb.cc",
82        "android/hardware/automotive/vehicle/StatusCode.pb.cc",
83        "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.cc",
84        "android/hardware/automotive/vehicle/VehiclePropConfig.pb.cc",
85        "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.cc",
86        "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.cc",
87        "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.cc",
88        "android/hardware/automotive/vehicle/VehiclePropValue.pb.cc",
89        "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.cc",
90        "android/hardware/automotive/vehicle/SubscribeOptions.pb.cc",
91        "android/hardware/automotive/vehicle/SubscribeRequest.pb.cc",
92        "android/hardware/automotive/vehicle/UnsubscribeRequest.pb.cc",
93    ],
94}
95
96cc_library_static {
97    name: "VehicleHalProtos",
98    vendor: true,
99    host_supported: true,
100    include_dirs: [
101        "external/protobuf/src",
102    ],
103    generated_headers: [
104        "VehicleProtoStub_h",
105    ],
106    export_generated_headers: [
107        "VehicleProtoStub_h",
108    ],
109    generated_sources: [
110        "VehicleProtoStub_cc",
111    ],
112    shared_libs: [
113        "libgrpc++_unsecure",
114    ],
115    cflags: [
116        "-Wno-unused-parameter",
117    ],
118}
119
120rust_protobuf {
121    name: "libvehicle_hal_property_protos",
122    crate_name: "vehicle_hal_property_protos",
123    protos: [":VehicleHalProtoFiles"],
124    source_stem: "vehicle_hal_property_protos",
125    host_supported: true,
126    vendor_available: true,
127    product_available: true,
128    apex_available: [
129        "//apex_available:platform",
130        "//apex_available:anyapex",
131    ],
132    exported_include_dirs: ["."],
133    proto_flags: [
134        "-I external/protobuf/src",
135    ],
136    min_sdk_version: "35",
137}
138