1// Copyright (C) 2016 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
16package {
17    // See: http://go/android-license-faq
18    // A large-scale-change added 'default_applicable_licenses' to import
19    // all of the 'license_kinds' from "system_tools_hidl_license"
20    // to get the below license kinds:
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["system_tools_hidl_license"],
23}
24
25genrule {
26    name: "c2hal_test_genc++_headers",
27    tools: [
28        "c2hal",
29        "hidl-gen",
30    ],
31    cmd: "$(location c2hal) -o $(genDir)/c2hal_test/1.0 " +
32        "    -p [email protected] $(location simple.h) && " +
33        "$(location hidl-gen) -o $(genDir) -Lc++ " +
34        "    -r android.hardware:$(genDir) " +
35        "    -r android.hidl:system/libhidl/transport " +
36        "    [email protected]",
37    srcs: [
38        "simple.h",
39        ":[email protected]_hal",
40    ],
41    out: [
42        "android/hardware/c2hal_test/1.0/BnHwSimple.h",
43        "android/hardware/c2hal_test/1.0/BpHwSimple.h",
44        "android/hardware/c2hal_test/1.0/BsSimple.h",
45        "android/hardware/c2hal_test/1.0/IHwSimple.h",
46        "android/hardware/c2hal_test/1.0/ISimple.h",
47        "android/hardware/c2hal_test/1.0/BnHwSimpleLocation.h",
48        "android/hardware/c2hal_test/1.0/BpHwSimpleLocation.h",
49        "android/hardware/c2hal_test/1.0/BsSimpleLocation.h",
50        "android/hardware/c2hal_test/1.0/IHwSimpleLocation.h",
51        "android/hardware/c2hal_test/1.0/ISimpleLocation.h",
52        "android/hardware/c2hal_test/1.0/types.h",
53        "android/hardware/c2hal_test/1.0/hwtypes.h",
54    ],
55}
56
57genrule {
58    name: "c2hal_test_genc++",
59    tools: [
60        "c2hal",
61        "hidl-gen",
62    ],
63    cmd: "$(location c2hal) -o $(genDir)/c2hal_test/1.0 " +
64        "    -p [email protected] $(location simple.h) && " +
65        "$(location hidl-gen) -o $(genDir) -Lc++ " +
66        "    -r android.hardware:$(genDir) " +
67        "    -r android.hidl:system/libhidl/transport " +
68        "    [email protected]",
69    srcs: [
70        "simple.h",
71        ":[email protected]_hal",
72    ],
73    out: [
74        "android/hardware/c2hal_test/1.0/SimpleAll.cpp",
75        "android/hardware/c2hal_test/1.0/types.cpp",
76    ],
77}
78
79cc_test_library {
80    name: "c2hal_test",
81    defaults: ["hidl-module-defaults"],
82    generated_headers: ["c2hal_test_genc++_headers"],
83    generated_sources: ["c2hal_test_genc++"],
84    export_generated_headers: ["c2hal_test_genc++_headers"],
85    shared_libs: [
86        "libhidlbase",
87        "liblog",
88        "libutils",
89        "libcutils",
90    ],
91    gtest: false,
92}
93