• 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/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/DumpResult.pb.h",
44        "android/hardware/automotive/vehicle/StatusCode.pb.h",
45        "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h",
46        "android/hardware/automotive/vehicle/VehiclePropConfig.pb.h",
47        "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.h",
48        "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.h",
49        "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.h",
50        "android/hardware/automotive/vehicle/VehiclePropValue.pb.h",
51        "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.h",
52    ],
53}
54
55genrule {
56    name: "VehicleProtoStub_cc",
57    tools: [
58        "aprotoc",
59        "protoc-gen-grpc-cpp-plugin",
60    ],
61    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)",
62    srcs: [
63        ":VehicleHalProtoFiles",
64    ],
65    out: [
66        "android/hardware/automotive/vehicle/DumpResult.pb.cc",
67        "android/hardware/automotive/vehicle/StatusCode.pb.cc",
68        "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.cc",
69        "android/hardware/automotive/vehicle/VehiclePropConfig.pb.cc",
70        "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.cc",
71        "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.cc",
72        "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.cc",
73        "android/hardware/automotive/vehicle/VehiclePropValue.pb.cc",
74        "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.cc",
75    ],
76}
77
78cc_library_static {
79    name: "VehicleHalProtos",
80    vendor: true,
81    host_supported: true,
82    include_dirs: [
83        "external/protobuf/src",
84    ],
85    generated_headers: [
86        "VehicleProtoStub_h",
87    ],
88    export_generated_headers: [
89        "VehicleProtoStub_h",
90    ],
91    generated_sources: [
92        "VehicleProtoStub_cc",
93    ],
94    shared_libs: [
95        "libgrpc++_unsecure",
96    ],
97    cflags: [
98        "-Wno-unused-parameter",
99    ],
100}
101