1/*
2 * Copyright (C) 2020 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    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21genrule {
22    name: "DumpstateServerProtoStub_h",
23    tools: [
24        "aprotoc",
25        "protoc-gen-grpc-cpp-plugin",
26    ],
27    cmd: "$(location aprotoc) -I$$(dirname $(in)) -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
28    srcs: [
29        "proto/DumpstateServer.proto",
30    ],
31    out: [
32        "DumpstateServer.pb.h",
33        "DumpstateServer.grpc.pb.h",
34    ],
35}
36
37genrule {
38    name: "DumpstateServerProtoStub_cc",
39    tools: [
40        "aprotoc",
41        "protoc-gen-grpc-cpp-plugin",
42    ],
43    cmd: "$(location aprotoc) -I$$(dirname $(in)) -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
44    srcs: [
45        "proto/DumpstateServer.proto",
46    ],
47    out: [
48        "DumpstateServer.pb.cc",
49        "DumpstateServer.grpc.pb.cc",
50    ],
51}
52
53cc_binary {
54    name: "android.hardware.dumpstate@1.1-service.trout",
55    srcs: [
56        "DumpstateDevice.cpp",
57        "service.cpp",
58        "WatchdogClient.cpp",
59    ],
60    generated_headers: [
61        "dumpstate_hal_configuration_V1_0",
62        "DumpstateServerProtoStub_h",
63    ],
64    generated_sources: [
65        "dumpstate_hal_configuration_V1_0",
66        "DumpstateServerProtoStub_cc",
67    ],
68    static_libs: [
69        "android.hardware.automotive@libc++fs",
70        "android.hardware.automotive.utils.vsockinfo",
71        "libxml2",
72    ],
73    shared_libs: [
74        "android.hardware.automotive.utils.watchdog",
75        "android.hardware.dumpstate@1.0",
76        "android.hardware.dumpstate@1.1",
77        "android.automotive.watchdog-V2-ndk_platform",
78        "libbase",
79        "libbinder_ndk",
80        "libcutils",
81        "libdumpstateutil",
82        "libgrpc++",
83        "libhidlbase",
84        "liblog",
85        "libprotobuf-cpp-full",
86        "libutils",
87    ],
88    cflags: [
89        "-Wno-unused-parameter",
90    ],
91    relative_install_path: "hw",
92    init_rc: [
93        "android.hardware.dumpstate@1.1-service.trout.rc",
94    ],
95    defaults: ["cuttlefish_guest_only"],
96    vintf_fragments: ["manifest_android.hardware.dumpstate@1.1-service.trout.xml"],
97}
98