blob: 7a8da5907424d349eb0ca61625137eebc0cfd00f [file] [log] [blame]
Hao Chen6cb86892023-04-10 15:21:59 -07001// Copyright (C) 2023 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
15package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19genrule {
20 name: "VehicleServerProtoStub_h@default-grpc",
21 tools: [
22 "aprotoc",
23 "protoc-gen-grpc-cpp-plugin",
24 ],
Yu Shanf1a86902024-05-16 15:39:51 -070025 cmd: "$(location aprotoc) -I$$(dirname $(location proto/VehicleServer.proto)) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(location proto/VehicleServer.proto) --grpc_opt=generate_mock_code=true --grpc_out=$(genDir) --cpp_out=$(genDir)",
Hao Chen6cb86892023-04-10 15:21:59 -070026 srcs: [
27 "proto/VehicleServer.proto",
Cole Faust52d74462023-11-20 14:35:58 -080028 ":libprotobuf-internal-protos",
29 ":VehicleHalProtoFiles",
Hao Chen6cb86892023-04-10 15:21:59 -070030 ],
31 out: [
32 "VehicleServer.pb.h",
33 "VehicleServer.grpc.pb.h",
Yu Shanf1a86902024-05-16 15:39:51 -070034 "VehicleServer_mock.grpc.pb.h",
Hao Chen6cb86892023-04-10 15:21:59 -070035 ],
36 visibility: ["//visibility:private"],
37}
38
39genrule {
40 name: "VehicleServerProtoStub_cc@default-grpc",
41 tools: [
42 "aprotoc",
43 "protoc-gen-grpc-cpp-plugin",
44 ],
Cole Faust52d74462023-11-20 14:35:58 -080045 cmd: "$(location aprotoc) -I$$(dirname $(location proto/VehicleServer.proto)) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(location proto/VehicleServer.proto) --grpc_out=$(genDir) --cpp_out=$(genDir)",
Hao Chen6cb86892023-04-10 15:21:59 -070046 srcs: [
47 "proto/VehicleServer.proto",
Cole Faust52d74462023-11-20 14:35:58 -080048 ":libprotobuf-internal-protos",
49 ":VehicleHalProtoFiles",
Hao Chen6cb86892023-04-10 15:21:59 -070050 ],
51 out: [
52 "VehicleServer.pb.cc",
53 "VehicleServer.grpc.pb.cc",
54 ],
55 visibility: ["//visibility:private"],
56}
57
58cc_library_static {
59 name: "android.hardware.automotive.vehicle@default-grpc-libgrpc",
60 vendor: true,
61 host_supported: true,
62 include_dirs: [
63 "external/protobuf/src",
64 ],
65 generated_headers: [
66 "VehicleServerProtoStub_h@default-grpc",
67 ],
68 export_generated_headers: [
69 "VehicleServerProtoStub_h@default-grpc",
70 ],
71 generated_sources: [
72 "VehicleServerProtoStub_cc@default-grpc",
73 ],
74 whole_static_libs: [
75 "VehicleHalProtos",
76 ],
77 shared_libs: [
78 "libgrpc++",
79 ],
80 cflags: [
81 "-Wno-unused-parameter",
82 ],
83}
84
85cc_library_static {
86 name: "android.hardware.automotive.vehicle@default-grpc-hardware-lib",
87 defaults: ["VehicleHalDefaults"],
88 vendor: true,
89 srcs: [
90 "GRPCVehicleHardware.cpp",
91 ],
92 whole_static_libs: [
93 "android.hardware.automotive.vehicle@default-grpc-libgrpc",
94 "VehicleHalProtoMessageConverter",
95 ],
96 header_libs: [
97 "IVehicleHardware",
98 ],
99 shared_libs: [
100 "libgrpc++",
101 "libprotobuf-cpp-full",
102 ],
103 export_include_dirs: ["."],
104 cflags: [
105 "-Wno-unused-parameter",
106 ],
107}
Hao Chen32d46702023-04-10 15:59:50 -0700108
109cc_library_static {
110 name: "android.hardware.automotive.vehicle@default-grpc-server-lib",
111 defaults: ["VehicleHalDefaults"],
112 vendor: true,
113 srcs: [
114 "GRPCVehicleProxyServer.cpp",
115 ],
116 whole_static_libs: [
117 "android.hardware.automotive.vehicle@default-grpc-libgrpc",
118 "VehicleHalProtoMessageConverter",
119 ],
120 header_libs: [
121 "IVehicleHardware",
122 ],
123 shared_libs: [
124 "libgrpc++",
125 "libprotobuf-cpp-full",
126 ],
127 export_include_dirs: ["."],
128 cflags: [
129 "-Wno-unused-parameter",
130 ],
Yu Shan9d351382024-05-15 10:49:20 -0700131 host_supported: true,
Hao Chen32d46702023-04-10 15:59:50 -0700132}