blob: 80966df19abb966805560009aa63ceb503dcc83f [file] [log] [blame]
Yu Shana2bbcd22021-09-09 18:06:03 -07001/*
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
17filegroup {
18 name: "VehicleHalProtoFiles",
19 srcs: ["**/*.proto"],
20 visibility: ["//hardware/interfaces/automotive/vehicle:__subpackages__"],
21}
22
23genrule {
24 name: "VehicleProtoStub_h",
25 tools: [
26 "aprotoc",
27 "protoc-gen-grpc-cpp-plugin",
28 ],
29 cmd: "$(location aprotoc) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
30 srcs: [
31 ":VehicleHalProtoFiles",
32 ],
33 out: [
34 "android/hardware/automotive/vehicle/DumpResult.pb.h",
35 "android/hardware/automotive/vehicle/StatusCode.pb.h",
36 "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h",
37 "android/hardware/automotive/vehicle/VehiclePropConfig.pb.h",
38 "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.h",
39 "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.h",
40 "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.h",
41 "android/hardware/automotive/vehicle/VehiclePropValue.pb.h",
42 "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.h",
43 ],
44}
45
46genrule {
47 name: "VehicleProtoStub_cc",
48 tools: [
49 "aprotoc",
50 "protoc-gen-grpc-cpp-plugin",
51 ],
52 cmd: "$(location aprotoc) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
53 srcs: [
54 ":VehicleHalProtoFiles",
55 ],
56 out: [
57 "android/hardware/automotive/vehicle/DumpResult.pb.cc",
58 "android/hardware/automotive/vehicle/StatusCode.pb.cc",
59 "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.cc",
60 "android/hardware/automotive/vehicle/VehiclePropConfig.pb.cc",
61 "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.cc",
62 "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.cc",
63 "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.cc",
64 "android/hardware/automotive/vehicle/VehiclePropValue.pb.cc",
65 "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.cc",
66 ],
67}
68
69cc_library_static {
70 name: "VehicleHalProtos",
71 vendor: true,
72 host_supported: true,
73 include_dirs: [
74 "external/protobuf/src",
75 ],
76 generated_headers: [
77 "VehicleProtoStub_h",
78 ],
79 export_generated_headers: [
80 "VehicleProtoStub_h",
81 ],
82 generated_sources: [
83 "VehicleProtoStub_cc",
84 ],
85 shared_libs: [
86 "libgrpc++_unsecure",
87 ],
88 cflags: [
89 "-Wno-unused-parameter",
90 ],
91}