Hao Chen | 6cb8689 | 2023-04-10 15:21:59 -0700 | [diff] [blame] | 1 | // 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 | |
| 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
| 19 | genrule { |
| 20 | name: "VehicleServerProtoStub_h@default-grpc", |
| 21 | tools: [ |
| 22 | "aprotoc", |
| 23 | "protoc-gen-grpc-cpp-plugin", |
| 24 | ], |
Yu Shan | f1a8690 | 2024-05-16 15:39:51 -0700 | [diff] [blame] | 25 | 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 Chen | 6cb8689 | 2023-04-10 15:21:59 -0700 | [diff] [blame] | 26 | srcs: [ |
| 27 | "proto/VehicleServer.proto", |
Cole Faust | 52d7446 | 2023-11-20 14:35:58 -0800 | [diff] [blame] | 28 | ":libprotobuf-internal-protos", |
| 29 | ":VehicleHalProtoFiles", |
Hao Chen | 6cb8689 | 2023-04-10 15:21:59 -0700 | [diff] [blame] | 30 | ], |
| 31 | out: [ |
| 32 | "VehicleServer.pb.h", |
| 33 | "VehicleServer.grpc.pb.h", |
Yu Shan | f1a8690 | 2024-05-16 15:39:51 -0700 | [diff] [blame] | 34 | "VehicleServer_mock.grpc.pb.h", |
Hao Chen | 6cb8689 | 2023-04-10 15:21:59 -0700 | [diff] [blame] | 35 | ], |
| 36 | visibility: ["//visibility:private"], |
| 37 | } |
| 38 | |
| 39 | genrule { |
| 40 | name: "VehicleServerProtoStub_cc@default-grpc", |
| 41 | tools: [ |
| 42 | "aprotoc", |
| 43 | "protoc-gen-grpc-cpp-plugin", |
| 44 | ], |
Cole Faust | 52d7446 | 2023-11-20 14:35:58 -0800 | [diff] [blame] | 45 | 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 Chen | 6cb8689 | 2023-04-10 15:21:59 -0700 | [diff] [blame] | 46 | srcs: [ |
| 47 | "proto/VehicleServer.proto", |
Cole Faust | 52d7446 | 2023-11-20 14:35:58 -0800 | [diff] [blame] | 48 | ":libprotobuf-internal-protos", |
| 49 | ":VehicleHalProtoFiles", |
Hao Chen | 6cb8689 | 2023-04-10 15:21:59 -0700 | [diff] [blame] | 50 | ], |
| 51 | out: [ |
| 52 | "VehicleServer.pb.cc", |
| 53 | "VehicleServer.grpc.pb.cc", |
| 54 | ], |
| 55 | visibility: ["//visibility:private"], |
| 56 | } |
| 57 | |
| 58 | cc_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 | |
| 85 | cc_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 Chen | 32d4670 | 2023-04-10 15:59:50 -0700 | [diff] [blame] | 108 | |
| 109 | cc_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 Shan | 9d35138 | 2024-05-15 10:49:20 -0700 | [diff] [blame] | 131 | host_supported: true, |
Hao Chen | 32d4670 | 2023-04-10 15:59:50 -0700 | [diff] [blame] | 132 | } |