1//
2// Copyright (C) 2018 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
21cc_library_headers {
22    name: "libfiemap_headers",
23    ramdisk_available: true,
24    vendor_ramdisk_available: true,
25    recovery_available: true,
26    export_include_dirs: ["include"],
27}
28
29filegroup {
30    name: "libfiemap_srcs",
31    srcs: [
32        "fiemap_writer.cpp",
33        "fiemap_status.cpp",
34        "image_manager.cpp",
35        "metadata.cpp",
36        "split_fiemap_writer.cpp",
37        "utility.cpp",
38    ],
39}
40
41filegroup {
42    name: "libfiemap_binder_srcs",
43    srcs: [
44        "binder.cpp",
45    ],
46}
47
48cc_defaults {
49    name: "libfiemap_binder_defaults",
50    srcs: [":libfiemap_binder_srcs"],
51    whole_static_libs: [
52        "gsi_aidl_interface-cpp",
53        "libgsi",
54        "libgsid",
55    ],
56    shared_libs: [
57        "libbinder",
58        "libutils",
59    ],
60}
61
62// Open up a passthrough IImageManager interface. Use libfiemap_binder whenever
63// possible. This should only be used when binder is not available.
64filegroup {
65    name: "libfiemap_passthrough_srcs",
66    srcs: [
67        "passthrough.cpp",
68    ],
69}
70
71cc_test {
72    name: "fiemap_writer_test",
73    static_libs: [
74        "libbase",
75        "libdm",
76        "libfs_mgr",
77        "liblog",
78        "libgsi",
79    ],
80
81    data: [
82        "testdata/unaligned_file",
83        "testdata/file_4k",
84        "testdata/file_32k",
85    ],
86
87    srcs: [
88        "fiemap_writer_test.cpp",
89    ],
90
91    test_suites: ["vts", "device-tests"],
92    auto_gen_config: true,
93    test_options: {
94        min_shipping_api_level: 29,
95    },
96    header_libs: [
97        "libstorage_literals_headers",
98    ],
99    require_root: true,
100}
101
102cc_test {
103    name: "fiemap_image_test",
104    static_libs: [
105        "libcrypto_utils",
106        "libdm",
107        "libext4_utils",
108        "libfs_mgr",
109        "liblp",
110    ],
111    shared_libs: [
112        "libbase",
113        "libcrypto",
114        "libcutils",
115        "liblog",
116    ],
117    srcs: [
118        "image_test.cpp",
119    ],
120    test_suites: ["device-tests"],
121    auto_gen_config: true,
122    require_root: true,
123}
124