1/*
2 * Copyright (C) 2019 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
17genrule {
18    name: "hidl_format_test_diff",
19    tools: ["hidl-gen"],
20    cmd: "$(location hidl-gen) -L format -o $(genDir)/ " +
21        "-r hidl_format_test_pkg:system/tools/hidl/test/format_test " +
22        "hidl_format_test_pkg@1.0 && " +
23        "cp $$(dirname $(in) | uniq)/Android.bp $(genDir)/system/tools/hidl/test/format_test/1.0 && " +
24        "diff -r -C3 $(genDir)/system/tools/hidl/test/format_test/1.0 $$(dirname $(in) | uniq)",
25    srcs: [
26        "1.0/Android.bp",
27        "1.0/IBar.hal",
28        "1.0/IFoo.hal",
29        "1.0/types.hal",
30    ],
31    out: [
32        "system/tools/hidl/test/format_test/1.0/Android.bp",
33        "system/tools/hidl/test/format_test/1.0/IBar.hal",
34        "system/tools/hidl/test/format_test/1.0/IFoo.hal",
35        "system/tools/hidl/test/format_test/1.0/types.hal",
36    ],
37}
38
39hidl_package_root {
40    name: "hidl_format_test_pkg",
41}
42
43phony {
44    name: "hidl_format_test",
45    required: [
46        "hidl_format_test_diff",
47        "hidl_format_test_pkg@1.0",
48    ],
49}
50